-
Notifications
You must be signed in to change notification settings - Fork 1
/
organ_request_form.php
442 lines (404 loc) · 15.9 KB
/
organ_request_form.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
<?php
session_start();
include('./db_conn.php');
$id=$_SESSION['user_id'];
if(isset($_POST["submitBtn"])){
$organ = $_POST['organ'];
$blood = $_POST['blood'];
$location = $_POST['location'];
$purpose = $_POST['purpose'];
if($_POST['lat']!="0"){
$lat = $_POST['lat'];
$lon=$_POST['lon'];
$sql = "INSERT INTO organ_requesters (requester_id,organs, blood_grp, location ,msg, lat, lon) VALUES ('$id','$organ',
'$blood','$location','$purpose','$lat','$lon')";
$conn->query($sql);
}
else{
$sql = "INSERT INTO organ_requesters (requester_id,organs, blood_grp, location ,msg) VALUES ('$id','$organ',
'$blood','$location','$purpose')";
$conn->query($sql);
}
header("location:dashboard.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">
<title>Life Line | Organ Request Form </title>
<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>
<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>
<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 rel="stylesheet" href="./assets/styles/style.css">
<!-- js -->
<link rel="stylesheet" href="./assets/styles/index_styles.css">
<script src="./assets/js/index.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<style>
*{
margin: 0;
padding: 0;
}
.btn{
background-color: rgb(230,84,127);
outline: none;
color: white;
}
.btn:hover{
color:white;
}
</style>
</head>
<body>
<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>
<script>
$('.navbar-collapse a').click(function () {
$(".navbar-collapse").collapse('hide');
});
</script>
<div class="container mt-5 ">
<div class="row justify-content-center">
<div class="col-sm">
</div>
<div class="col-md-6 mt-5">
<img src="./assets/images/helping hand.jpeg " class="image-responsive" height="100%" width="100%"
alt="">
</div>
<div class="col-sm">
</div>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post" >
<div class="form-group">
<h1 style="color:rgb(230, 81, 81);" class="text-center"> Organ Request Form </h1>
</div>
<div class="form-group">
<label for="organ"><b>Organ Required:</b></label>
<input type="text" class="form-control" id="organ" placeholder="Enter organ needed" name="organ" required>
<div class="valid-feedback">Valid.</div>
<div class="invalid-feedback">Please fill out this field.</div>
</div>
<div class="form-group">
<label for="validationCustom04" class="form-label"><b>Blood Group:</b></label>
<select class="form-control" id="validationCustom04" name="blood" required>
<option selected disabled value="">Choose...</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>
<div class="loc" >
<div class="form-group">
<label for="location"> <b> Location </b></label>
<input type="text" class="form-control" id="loc" placeholder="Eg: Kottayam, Kerala" name="location" required>
<div class="valid-feedback">Valid.</div>
<div class="invalid-feedback">Please fill out this field.</div>
</div>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" onclick="getlocation()" type="checkbox" name="presentLocation" id="coordinates"> <b>Use My Coordinates</b>
</label>
</div>
<input type="hidden" value="0" name="lat" id="lat">
<input type="hidden" value="0" name="lon" id="lon">
<div class="form-group">
<label for="purpose"><b> Purpose</b></label>
<input type="text" class="form-control" id="purpose" placeholder="Enter purpose" name="purpose" required>
<div class="valid-feedback">Valid.</div>
<div class="invalid-feedback">Please fill out this field.</div>
</div>
<div class="form-group form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="remember" required> I agree on <a href="terms.php"> terms and conditions.</a>
<div class="valid-feedback">Valid.</div>
<div class="invalid-feedback">Check this checkbox to continue.</div>
</label>
</div>
<div class="text-center">
<button type="submit" class="btn mb-4 btn-lg "name="submitBtn" >Submit </button>
</div>
</form>
</div>
<!-- jquery -->
<script>
function myFunction() {
$(document).ready(function(){
$(".present-location").click(function(){
$(".loc").toggle();
});
});
}
</script>
<!-- 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>
</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;
console.log(x,y);
document.getElementById("lat").value=x;
document.getElementById("lon").value=y;
}
</script>
</html>