-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpatientInfo.php
78 lines (75 loc) · 1.64 KB
/
patientInfo.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
include("connect.php");
?>
<?php
if($_POST['submit'])
{
$fname=$_POST['fname'];
// echo "fname : ".$fname;
$lname=$_POST['lname'];
$age=$_POST['age'];
$weight=$_POST['weight'];
$gender=$_POST['gender'];
$dob=$_POST['dob'];
$phoneno=$_POST['phoneNo'];
$disease=$_POST['disease'];
$doctorid=$_POST['doctorId'];
$address=$_POST['address'];
$medicine=$_POST['medicine'];
$pattype=$_POST['patType'];
if(strcmp($pattype,"in")==0)
{
$addate=$_POST['admDate'];
$didate=$_POST['disDate'];
$roomno=$_POST['roomNo'];
$bedno=$_POST['bedNo'];
}
else if(strcmp($pattype,"out")==0)
{
$outpatdate=$_POST['outPatDate'];
}
else if(strcmp($pattype,"reffered")==0)
{
$refto=$_POST['refferedTo'];
$refdate=$_POST['refferedDate'];
}
$rn=uniqid();
$q="INSERT INTO PATIENT VALUES('$rn','$fname','$lname','$age','$weight','$gender','$address','$phoneno','$disease','$medicine','$pattype')";
$q_str=mysqli_query($conn,$q);
if($q_str)
{
echo "inserted sucessfully";
}
if(strcmp($pattype,"in")==0)
{
$rn2=uniqid();
$q="INSERT INTO INDOR VALUES('$rn','$rn2','$addate','$didate','$roomno','$bedno')";
$q_str=mysqli_query($conn,$q);
if($q_str)
{
echo "inserted sucessfully";
}
}
else if(strcmp($pattype,"out")==0)
{
$rn3=uniqid();
$q="INSERT INTO OUTDOOR VALUES('$rn','$rn3','$outpatdate')";
$q_str=mysqli_query($conn,$q);
if($q_str)
{
echo "inserted sucessfully";
}
}
else
{
$rn4=uniqid();
$q="INSERT INTO REFFERED VALUES('$rn4','$refdate','$refto','$rn')";
$q_str=mysqli_query($conn,$q);
if($q_str)
{
echo "inserted sucessfully";
}
}
}
else echo "please submit first";
?>