-
Notifications
You must be signed in to change notification settings - Fork 1
/
blood_donor.php
456 lines (409 loc) · 17.4 KB
/
blood_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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<?php
session_start();
include('./db_conn.php');
$id=$_SESSION['user_id'];
if(isset($_POST['submit-btn']))
{
$blood_grp=$_POST['blood_group'];
$type=$_POST['type'];
$location=$_POST['location'];
if($_POST['lat']!="0")
{
$lat=$_POST['lat'];
$lon=$_POST['lon'];
$sql = "INSERT INTO `blood_donors` (`donor_id`,`blood_grp`,`location`,`lat`,`lon`) VALUES ('$id','$blood_grp','$location','$lat','$lon');";
}
else
{
echo "<script>console.log('$blood_grp,$location,$id');</script>";
$sql = "INSERT INTO blood_donors (`donor_id`,`blood_grp`,`location`) VALUES ('$id','$blood_grp','$location')";
}
$conn->query($sql);
header("Location: donors.php");
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CDN -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Icons CDN -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;700;800;900&display=swap"
rel="stylesheet">
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet" />
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<!-- This CSS file consists of all the CSS styles for the website in common. -->
<link rel="stylesheet" href="./assets/styles/style.css">
<link rel="stylesheet" href="./assets/styles/blood_request_styles.css">
<title>Life Line | Blood Donor Form</title>
</head>
<body>
<div class="container">
<nav class="navbar navbar-expand-lg navbar-dark fixed-top pl-5">
<a class="navbar-brand ml-4" href="#">
<h3 class="brand-name">Life Line</h3>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<div class="toggle-btn"></div>
<div class="toggle-btn"></div>
<div class="toggle-btn"></div>
</button>
<div class="collapse navbar-collapse mr-5" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item mt-1">
<a class="nav-link" href="./index.php">Home</a>
</li>
<li class="nav-item mt-1">
<a class="nav-link" href="./requests.php">Requests</a>
</li>
<li class="nav-item mt-1">
<a class="nav-link" href="./donors.php">Donors</a>
</li>
<li class="nav-item dropdown active mt-1">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Pages
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<?php
if(isset($_SESSION['user_id'])){
?>
<a class="dropdown-item" href="./blood_donor.php">Donate Blood</a>
<?php
}
else{
?>
<a class="dropdown-item" href="./sign_in.php">Donate Blood</a>
<?php
}?>
<?php
if(isset($_SESSION['user_id'])){
?>
<a class="dropdown-item" href="./blood_request.php">Request Blood</a>
<?php
}
else{
?>
<a class="dropdown-item" href="./sign_in.php">Request Blood</a>
<?php
}?>
<div class="dropdown-divider"></div>
<?php
if(isset($_SESSION['user_id'])){
?>
<a class="dropdown-item" href="./organ_donate.php">Donate Organs</a>
<?php
}
else{
?>
<a class="dropdown-item" href="./sign_in.php">Donate Organs</a>
<?php
}?>
<?php
if(isset($_SESSION['user_id'])){
?>
<a class="dropdown-item" href="./organ_request_form.php">Request Organs</a>
<?php
}
else{
?>
<a class="dropdown-item" href="./sign_in.php">Request Organs</a>
<?php
}?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="./aboutus.php">About Us</a>
<a class="dropdown-item" href="./contactus.php">Contact Us</a>
<a class="dropdown-item" href="./faq.php">FAQ</a>
</div>
</li>
<?php
if(isset($_SESSION['user_id'])){
?>
<a href="./dashboard.php" class="btn sign-up mt-1 ml-2">Dashboard</a>
<a href="./logout.php" class="btn sign-up mt-1 ml-2">Logout</a>
<?php
}
else{
?>
<a href="register.php" class="btn sign-up mt-1 ml-2">Sign Up</a>
<a href="sign_in.php" class="btn sign-in mt-1 ml-2">Sign In</a>
<?php
}
?>
</ul>
</div>
</nav>
</div>
<br>
<br>
<br>
<!--img-->
<div class="container text-center">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-5 mt-5">
<img src="./assets/images/blood_donor.jpg" class="img-fluid">
</div>
</div>
</div>
<br>
<br>
<!--Title-->
<div class="text-center title">
<h1 class="display-4" style="color:var(--red)">Blood Donor form</h1>
</div>
<hr class="line">
<br>
<!--form starts-->
<<<<<<< HEAD
<form class="ml-3 mr-3" method="post" action="blood_donor.php" novalidate >
=======
<form class="ml-3 mr-3" method="post" action="blood_donor.php" >
>>>>>>> 8e949e4799548b66e3dc1bfc62c1d5fe791641d7
<div class="form-row">
<div class="col-md-8 m-auto">
<label for="validationCustom04" class="form-label"><b>Type<span style="color: red; font-size: 1.rem;">*</span></b></label>
<select class="form-control" id="validationCustom04" required name="type" id="type">
<option selected disabled value="">Choose...</option>
<option value="blood">Blood</option>
<option value="plasma" >Plasma</option>
<option value="platelets">Platelets</option>
</select>
<div class="invalid-feedback">
Please fill this field.
</div>
</div>
</div>
<br>
<div class="form-row">
<div class="col-md-8 m-auto">
<label for="validationCustom04" class="form-label"><b>Blood Group<span style="color: red; font-size: 1.rem;">*</span></b></label>
<select class="form-control" id="validationCustom04" required name="blood_group" id="blood_group">
<option selected disabled value="">Choose donor's Blood Group</option>
<option value="A+">A+</option>
<option value="A-" >A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="O+">O+</option>
<option value="O-">O-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option>
</select>
<div class="invalid-feedback">
Please fill this field.
</div>
</div>
</div>
<br>
<div class="form-row">
<div class="col-md-8 m-auto">
<label for="validationCustom03"><b>Location<span style="color: red; font-size: 1.rem;">*</span></b></label>
<input type="text" class="form-control" id="validationCustom03" placeholder="Eg: Hyderabad,Telangana" required name="location" id="location">
<div class="invalid-feedback">
Please fill this field.
</div>
</div>
</div>
<br>
<div class="form-row">
<div class="col-md-8 m-auto">
<label class="form-check-label">
<input class="form-check-input" onclick="getlocation()" type="checkbox" name="getpresentLocation" id="coordinates"> <b>Use My Current Coordinates</b>
</label>
</div>
<input type="hidden" value="0" name="lat" id="lat">
<input type="hidden" value="0" name="lon" id="lon">
</div>
<br>
<div class="form-row">
<div class="col-md-8 m-auto">
<label class="form-check-label pl-10">
<input class="form-check-input" type="checkbox" name="remember" required> I agree on <a href=""> terms and conditions.</a>
<div class="valid-feedback">Valid.</div>
<div class="invalid-feedback">Check this checkbox to continue.</div>
</label>
</div>
</div>
<div class="text-center">
<button name="submit-btn" type="submit" class="btn mb-4 btn-lg " name="submit" id="submit" style="background-color: crimson; color: white;" >Submit </button>
</div>
</form>
<<<<<<< HEAD
=======
>>>>>>> 8e949e4799548b66e3dc1bfc62c1d5fe791641d7
<!-- Footer -->
<footer class="text-center text-lg-start bg-light text-muted">
<section class="d-flex justify-content-center justify-content-lg-between p-4 border-bottom">
<div class="me-5 d-none d-lg-block">
<span>Get connected with us on social networks:</span>
</div>
<div>
<a href="" class="me-4 text-reset p-3">
<i class="fab fa-facebook-f"></i>
</a>
<a href="" class="me-4 text-reset p-3">
<i class="fab fa-twitter"></i>
</a>
<a href="" class="me-4 text-reset p-3">
<i class="fab fa-instagram"></i>
</a>
<a href="" class="me-4 text-reset p-3">
<i class="fab fa-linkedin"></i>
</a>
<a href="" class="me-4 text-reset p-3">
<i class="fab fa-github"></i>
</a>
</div>
</section>
<section class="">
<div class="container text-center text-md-start mt-5">
<div class="row mt-3">
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<h5 class="text-uppercase fw-bold mb-4" style="color:var(--red);font-weight:bold">
LIFE LINE
</h5>
<p>
Life-Line is non profit organization committed to help
people who are in need of
blood or organs.
</p>
</div>
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
<h6 class="text-uppercase fw-bold mb-4">
<b>QUICK LINKS</b>
</h6>
<p>
<a href="./index.php" class="text-reset">Home</a>
</p>
<p>
<a href="./aboutus.php" class="text-reset">About Us</a>
</p>
<p>
<a href="./contactus.php" class="text-reset">Contact Us</a>
</p>
</div>
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
<h6 class="text-uppercase fw-bold mb-4">
<b>Useful links</b>
</h6>
<?php
if(isset($_SESSION['user_id'])){
?>
<p>
<a href="./blood_donor.php" class="text-reset">Donate Blood</a>
</p>
<?php
}
else{
?>
<p>
<a href="./sign_in.php" class="text-reset">Donate Blood</a>
</p>
<?php
}?>
<?php
if(isset($_SESSION['user_id'])){
?>
<p>
<a href="./blood_request.php" class="text-reset">Request Blood</a>
</p>
<?php
}
else{
?>
<p>
<a href="./sign_in.php" class="text-reset">Request Blood</a>
</p>
<?php
}?>
<?php
if(isset($_SESSION['user_id'])){
?>
<p>
<a href="./organ_donate.php" class="text-reset">Donate Organs</a>
</p>
<?php
}
else{
?>
<p>
<a href="./sign_in.php" class="text-reset">Donate Organs</a>
</p>
<?php
}?>
<?php
if(isset($_SESSION['user_id'])){
?>
<p>
<a href="./organ_request_form.php" class="text-reset">Request Organs</a>
</p>
<?php
}
else{
?>
<p>
<a href="./sign_in.php" class="text-reset">Request Organs</a>
</p>
<?php
}?>
</div>
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<h6 class="text-uppercase fw-bold mb-4">
<b>Contact</b>
</h6>
<p><i class="fas fa-home me-3"></i> IIIT Kottayam</p>
<p>
<i class="fas fa-envelope me-3"></i>
lifelinesupport@gmail.com
</p>
<p><i class="fas fa-phone me-3"></i>+91 9347619384</p>
</div>
</div>
</div>
</section>
<div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.05);">
© 2021 Copyright:Life Line
</div>
</footer>
</div>
</body>
<script>
function getlocation()
{
var checkbox = document.getElementById('coordinates');
if (checkbox.checked != false)
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
}
else
{
alert("Geolocation is not supported by this browser.");
}
}
else
{
document.getElementById('lat').value = 0;
document.getElementById('lon').value = 0;
}
}
function showPosition(position) {
var x,y;
x=position.coords.latitude ;
y=position.coords.longitude;
document.getElementById("lat").value=x;
document.getElementById("lon").value=y;
}
</script>
</html>