-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdischarge_patient.php
More file actions
43 lines (41 loc) · 1.38 KB
/
Copy pathdischarge_patient.php
File metadata and controls
43 lines (41 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
include("assets/modules/global_module.php");
check_token("admin");
$patient = $_GET["patient_id"];
$bed = $_GET["bed_id"];
$staff = $_GET["staff_id"];
$admission = $_GET["admission_id"];
if(update_data("update patient set patient_type = 0, patient_status = 0 where patient_id = '$patient'"))
{
if(alter_capacity("+",$staff,3))
{
if(update_data("update bed set patient_id = NULL,staff_id = NULL,bed_status = 0 where bed_id = '$bed'" ))
{
if(update_data("update admission set admission_status = 1 where admission_id = '$admission'"))
{
setcookie("alert_true","Patient Discharged",time() + (10 * 365 * 24 * 60 * 60));
header("LOCATION:discharge.php");
}
else
{
setcookie("alert_false","Not Discharged",time() + (10 * 365 * 24 * 60 * 60));
header("LOCATION:discharge.php");
}
}
else
{
setcookie("alert_false","Bed Not Released",time() + (10 * 365 * 24 * 60 * 60));
header("LOCATION:discharge.php");
}
}
else
{
setcookie("alert_false","Capacity Not Restored",time() + (10 * 365 * 24 * 60 * 60));
header("LOCATION:discharge.php");
}
}
else
{
setcookie("alert_false","Patient Not Released",time() + (10 * 365 * 24 * 60 * 60));
header("LOCATION:discharge.php");
}