-
Notifications
You must be signed in to change notification settings - Fork 0
/
addpat.php
203 lines (190 loc) · 10.1 KB
/
addpat.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php
include("pdo/connection.php");
error_reporting(0);
?>
<html>
<head>
<title>Add Patients Record</title>
</head>
<body id="acz">
<?php include 'pdo/headers.php'; ?>
<link rel="stylesheet" href="pdo/style.css">
<br>
<h1 style="margin-left:10px;">Enter New Patient Details</h1><br>
<div id="form">
<form action="" method="GET">
<div class="container">
<div class="row justify-content-center">
<div class="col-8">
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="pat_id">Patient ID* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="pat_id" placeholder="enter pat_id" id="pat_id" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="cz_id">Containment Zone ID* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="cz_id" placeholder="enter cz_id" id="cz_id" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="hsp_id">Hospital ID* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="hsp_id" placeholder="enter hsp_id" id="hsp_id" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="fname">First Name* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="fname" placeholder="enter fname" id="fname" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="lname">Last Name* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="lname" placeholder="enter lname" id="lname" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="adhno">Aadhar Number* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="adhno" placeholder="enter adhno" id="adhno" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="addr">Address* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="addr" placeholder="enter addr" id="addr" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="prof">Profession</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="prof" placeholder="enter prof" id="prof" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="phone">Phone Number* </label>
<div class="col-md-4">
<input type="text" class="form-control" name="phone" placeholder="enter phone" id="phone" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-2" for="age">Age </label>
<div class="col-sm-2">
<input type="text" class="form-control" name="age" placeholder="enter age" id="age" value="" />
</div>
</div>
<div class="form group ">
<label class="control-label col-md-3" for="gen">Gender </label>
<div class="col-sm-3">
<select id="gen" class="form-control" name="gen">
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="dob">Date Of Birth* </label>
<div class="col-sm-3">
<input type="date" class="form-control" name="dob" placeholder="enter date_of_birth" id="dob" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="doa">Date Of Admission* </label>
<div class="col-sm-3">
<input type="date" class="form-control" name="doa" placeholder="enter date_of_admission" id="doa" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="nof">Number of Family Member </label>
<div class="col-md-4">
<input type="number" min="0" class="form-control" name="nof" placeholder="enter nof" id="nof" value="" /><br>
</div>
</div>
</div><br>
<div class="row">
<div class="form group">
<label class="control-label col-md-4" for="mh">Medical History*</label>
<div class="col-sm-3">
<input type="text" class="form-control" name="mh" placeholder="enter mh" id="mh" value="" /><br>
</div>
</div>
</div><br>
</div>
</div>
</div>
<div class="row justify-content-center">
<button type="submit" class="btn btn-primary btn-large mb-2 " style="height:35px; width:70px;font-size:15px;" name="submit" value="submit" id="submit">Submit</button>
</div>
</form>
</div><br>
<?php
if ($_GET['submit']) {
$pid = $_GET['pat_id'];
$czid = $_GET['cz_id'];
$hid = $_GET['hsp_id'];
$fn = $_GET['fname'];
$ln = $_GET['lname'];
$adhno = $_GET['adhno'];
$add = $_GET['addr'];
$pro = $_GET['prof'];
$ph = $_GET['phone'];
$age = $_GET['age'];
$gen = $_GET['gen'];
$dob = $_GET['dob'];
$doa = $_GET['doa'];
$nof = $_GET['nof'];
$mh = $_GET['mh'];
if (
$pid != "" && $czid != "" && $hid != "" && $fn != "" && $ln != "" && $adhno != "" && $add != "" &&
$ph != "" && $dob != "" && $doa != "" && $mh !== ""
) {
$query = "INSERT INTO patient(`pat_id`,`cz_id`,`hsp_id`,`fname`,`lname`,`aadhar_no`,`address`,`proffession`,
`phone`,`age`,`gender`,`dob`,`doa`,`no_flymem`,`medic_hist`) VALUES ('$pid','$czid','$hid','$fn','$ln','$adhno','$add','$pro',
'$ph','$age','$gen', '$dob', '$doa','$nof','$mh')";
$res = mysqli_query($conn, $query);
if ($res) {
echo "<h4><font color='green'>DATA INSERTED INTO DATABASE SUCCESSFULLY!</font></h4>";
} else {
echo "<h4><font color='red'>Some error occured</font></h4>";
}
} else {
echo "<h4><font color='red'>* fields are required</font></h4>";
}
} else {
echo "<h3><font color='blue'>Click on Submit to add you Record</font></h3>";
}
?>
<br>
<button type="submit" class="btn btn-outline-secondary mb-2" style="height:35px; width:70px;font-size:15px; margin-left:10px;">
<a href="pat.php">Back</a></button>
</body>
</html>