-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonor.php
256 lines (237 loc) · 13 KB
/
donor.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
$success=NULL;$message=NULL;
if(isset($_POST['submitBtn'])){
$fname = $_POST['firstName'];
$mname = $_POST['middleName'];
$lname = $_POST['lastName'];
$sex = $_POST['sex'];
$bType = $_POST['b_type'];
$dob = $_POST['dob'];
$address = $_POST['address'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];
$phone = $_POST['phone'];
//Medical Information
$donationDate = $_POST['don_date'];
$stats = $_POST['stats'];
$temp = $_POST['temp'];
$pulse = $_POST['pulse'];
$bp = $_POST['bp'];
$weight = $_POST['weight'];
$hemoglobin = $_POST['hemoglobin'];
$hbsag = $_POST['hbsag'];
$aids = $_POST['aids'];
$malariaSmear = $_POST['malariaSmear'];
$hematocrit = $_POST['hematocrit'];
require_once 'php/DBConnect.php';
$db = new DBConnect();
$flag = $db->addDonor($fname, $mname, $lname, $sex, $bType, $dob, $address, $city, $donationDate, $stats, $temp,
$pulse, $bp, $weight, $hemoglobin, $hbsag, $aids, $malariaSmear, $hematocrit, $mobile, $phone);
if($flag){
$success = "Successfully added to the database!";
} else {
$message = "There was some error saving the user to the database!";
}
}
$title = "Donor";
$setDonorActive = "active";
include 'layout/header.php';
include 'layout/navbar.php';
?>
<div style="padding-top:15px; padding-bottom:15px;" class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<form method="post" class="form-horizontal" role="form" action="donor.php">
<div class="panel panel-default">
<div class="panel-heading">
<h2 style="font-size:32px; text-align:center;">Donor Basic Info</h2>
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-3">Name</label>
<div class="form-group col-sm-8"> <input type="text" name="firstName" class="form-control" placeholder="First Name" required="true"> </div>
<div class="form-group col-sm-8"><input type="text" name="middleName" class="form-control" placeholder="Middle Name"></div>
<div class="form-group col-sm-8"><input type="text" name="lastName" class="form-control" placeholder="Last Name" required="true"></div>
</div>
<div class="form-group">
<label class="col-sm-4">Gender</label>
<div class="col-sm-4 radio-inline">
<input type="radio" value="male" name="sex" checked="true">Male
<input type="radio" value="female" name="sex">Female
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Blood Type:</label>
<div class="col-sm-8">
<select name="b_type" class="form-control">
<option value="O+">O+</option>
<option value="O-">O-</option>
<option value="A+">A+</option>
<option value="A-">A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">D.O.B</label>
<div class="col-sm-8">
<input type="date" name="dob" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Address</label>
<div class="col-sm-8">
<textarea rows="8" name="address" class="form-control" required="true"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">City</label>
<div class="col-sm-8">
<input type="text" name="city" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Mobile</label>
<div class="col-sm-8">
<input type="number" min="0" max="10000000000" name="mobile" class="form-control" required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Phone</label>
<div class="col-sm-8">
<input type="number" min="0" max="10000000000" name="phone" class="form-control">
</div>
</div>
</div>
<div class="panel-heading">
<h2 style="font-size:32px; text-align:center;">Donor Medical Info</h2>
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-4">Date of Donation</label>
<div class="col-sm-8">
<input type="date" name="don_date" value="" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Statistics</label>
<div class="col-sm-8">
<!-- <input type="text" name="stats" value="" required="true" class="form-control"/> -->
<select name="stats" class="form-control">
<option value="Normal">Normal</option>
<option value="Critical">Critical</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Temperature</label>
<div class="col-sm-8">
<input type="decimar" name="temp" placeholder="In Celsius" value="" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Pulse</label>
<div class="col-sm-8">
<input type="number" min="0" placeholder="60 to 100 beats per minute" max="300" name="pulse" value="" class="form-control" required="true"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Blood Pressure</label>
<div class="col-sm-8">
<!-- <input type="text" name="bp" value="" class="form-control" required="true"/> -->
<select name="bp" class="form-control">
<option value="High">High</option>
<option value="Low">Low</option>
<option value="Normal">Normal</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Weight</label>
<div class="col-sm-8">
<input type="decimal" placeholder="In k.g."name="weight" value="" required="true" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Hemoglobin</label>
<div class="col-sm-8">
<!-- <input type="text" name="hemoglobin" value="" required="true" class="form-control"/> -->
<select name="hemoglobin" class="form-control">
<option value="17 to 22 gm/dL">17 to 22 gm/dL</option>
<option value="15 to 20 gm/dL">15 to 20 gm/dL</option>
<option value="11 to 15 gm/dL">11 to 15 gm/dL</option>
<option value="11 to 13 gm/dL">11 to 13 gm/dL</option>
<option value="14 to 18 gm/dL">14 to 18 gm/dL</option>
<option value="12 to 16 gm/dL">12 to 16 gm/dL</option>
<option value="11.7 to 13.8 gm/dL">11.7 to 13.8 gm/dL</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">HBsAg </label>
<div class="col-sm-8">
<!-- <input type="text" name="hbsag" value="" required="true" class="form-control"/> -->
<select name="hbsag" class="form-control">
<option value="Negative">Negative</option>
<option value="Positive">Positive</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Aids </label>
<div class="col-sm-8">
<!-- <input type="text" name="aids" value="" required="true" class="form-control"/> -->
<select name="aids" class="form-control">
<option value="Negative">Negative</option>
<option value="Positive">Positive</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Malaria Smear </label>
<div class="col-sm-8">
<!-- <input type="text" name="malariaSmear" value="" required="true" class="form-control"/> -->
<select name="malariaSmear" class="form-control">
<option value="Negative">Negative</option>
<option value="Positive">Positive</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4">Hematocrit </label>
<div class="col-sm-8">
<!-- <input type="text" name="hematocrit" value="" required="true" class="form-control"/> -->
<select name="hematocrit" class="form-control">
<option value="Negatives">Negative</option>
<option value="Positive">Positive</option>
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-4"> </label>
<div class="col-sm-8">
<button class="btn btn-success" type="submit" name="submitBtn" >Add Donor</button>
</div>
</div> -->
</div>
</div>
<div class="form-group">
<label class="col-md-3"></label>
<button class="btn btn-success" type="submit" name="submitBtn" >Add Donor</button>
</div>
<?php if(isset($success)): ?>
<div class="alert-success fade-out-5"><?= $success; ?></div>
<?php endif; ?>
<?php if(isset($message)): ?>
<div class="alert-danger fade-out-5"><?= $message; ?></div>
<?php endif; ?>
</form>
</div>
<div class="col-md-3"></div>
</div>
</div>
<?php include 'layout/footer.php'; ?>