-
Notifications
You must be signed in to change notification settings - Fork 1
/
staff_mda.php
167 lines (150 loc) · 5.16 KB
/
staff_mda.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
include('header_staff.php');
session_start();
if(!isset($_SESSION["id"]) || $_SESSION["status"] != 1){
header("location: logout.php");
} else {
$id = $_SESSION["id"];
}
if( $_SERVER['REQUEST_METHOD']=='POST' && isset($_POST['submit'] ) )
{
$id = $_POST["id"];
$name = $_POST["name"];
$age = $_POST["age"];
$blood_group = $_POST["blood_group"];
$phone= $_POST["phone"];
$email = $_POST["email"];
$symptoms = $_POST["symptoms"];
$weight = $_POST["weight"];
$height = $_POST["height"];
$doctor_id = $_POST["doctor_id"];
$sql="INSERT INTO
patients( id, roll ,
name ,
age ,
blood_group,
phone ,
email ,
symptoms ,
weight ,
height ,
doctor_id ,
dept, hall, analysis, rx, status
)
VALUES ( '',
'$id',
'$name',
'$age',
'$blood_group',
'$phone',
'$email',
'$symptoms' ,
'$weight' ,
'$height' ,
'$doctor_id' ,
'','','','',''
)";
$result = mysql_query($sql) or die(mysql_error());
if($result){
echo "<script>
alert(\"Record successfully added.\");
window.location = \"staff_mda.php\";
</script>";
} else {
echo "<script>
alert(\"Error occured !\");
</script>";
}
}
?>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1 class="text-center">Initial Patient Query</h1>
<hr>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-2 control-label">Student ID</label>
<div class="col-sm-10">
<input class="form-control" name="id" type="number" placeholder="Enter student id" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input class="form-control" name="name" type="text" placeholder="Enter Name" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Age</label>
<div class="col-sm-10">
<input class="form-control" name="age" type="number" placeholder="Enter age" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Blood Group</label>
<div class="col-sm-10">
<input class="form-control" name="blood_group" type="text" placeholder="Enter blood group" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Weight</label>
<div class="col-sm-10">
<input class="form-control" name="weight" type="text" placeholder="Enter weight in KG" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Height</label>
<div class="col-sm-10">
<input class="form-control" name="height" type="text" placeholder="Enter height in Metre" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Phone</label>
<div class="col-sm-10">
<input class="form-control" name="phone" type="number" placeholder="Enter phone number" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input class="form-control" name="email" type="text" placeholder="Enter email address">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Appointed Doctor</label>
<div class="col-sm-10">
<select class="form-control" name="doctor_id">
<option value="-1">Please Select</option>
<?php
$sql = "select * from doctors";
$result=mysql_query($sql);
$count = mysql_num_rows($result);
while( $row =mysql_fetch_assoc( $result )){
$id = $row['id'];
$name = $row['name'];
$dept = $row['dept'];
echo "<option value=\"$id\">$name ($dept)</option> ";
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Symptoms</label>
<div class="col-sm-10">
<textarea class="form-control" name="symptoms" placeholder="Enter symptoms" required></textarea>
</div>
</div>
<button type="submit" name="submit" class="btn btn-primary btn-block">Submit</button>
</form>
</div>
</div>
</div>
<?php include('footer.php') ?>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include indivnameual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>