forked from Jayraj-R/PHC-Administration-Covid-19
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deallot_bed.php
22 lines (18 loc) · 996 Bytes
/
deallot_bed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
echo '<div class="d-none">'; #Bootstrap 'd-none' as mysql_connect is an old syntax.
$conn=mysql_connect('localhost','root',''); #for wampserver/xampserver user
$db=mysql_select_db('dbms_pr');
echo '</div>';
#------------------------------------------------- BED: setting the allotted bed and the patient entry NULL ------------------------------------------
$roll=$_POST['roll'];
$date=date("Y-m-d");
$qry="UPDATE BED SET VACANCY=1,IN_DATE=NULL,ROLL=NULL WHERE ROLL='$roll'";
$result=mysql_query($qry);
#--------------------------------------------------- BED_LOG: updating OUT_DATE of the deallotted patient --------------------------------------------
if($result){
$qry="UPDATE BED_LOG SET OUT_DATE='$date' WHERE ROLL='$roll'";
$result=mysql_query($qry);
}
#----------------------------------------------------------- Given ROLL is not allotted a bed --------------------------------------------------------
else echo'SORRY!! WRONG ENTRY<br>';
?>