forked from thesid01/Fill_Red
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
227 lines (213 loc) · 6.75 KB
/
index.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
<?php
session_start();
include "./DB/DbConnection.php";
?>
<!doctype html>
<html lang="en">
<head>
<title>Welcome To Fill</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- MAIN CSS -->
<link rel="stylesheet" href="./css/index.css">
<!-- GOOGLE FONTS -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
<!--Font FontAwesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<!-- icon-->
<link rel="icon" type="image/png" sizes="96x96" href="./logo.png">
</head>
<body>
<div class="container">
<div class="row text-center">
<h1 class="heading">Welcome To Fill Red Organisation</h1>
</div>
<div class="row text-center">
<center><img class="head-img" src="blood-bank.png"></center>
</div>
<div class="row">
<div class="card">
<div class="card-header">
<ul>
<li>
<a href="placeRequest.html">Request Blood</a>
</li>
<li>
<a href="checkRequests.php">Check Your Requests</a>
</li>
<li>
<a href="insertPatient.html">Register Patient</a>
</li>
<li>
<a>Contact Us</a>
</li>
</ul>
</div>
</div>
</div>
<div class="row red border">
<div class="content">
<h2>Search Blood Donors</h2>
<div class="main-form">
<form action="search.php" method="POST"><div class="col"><span class="float-right" style="font-size: 20px;">Blood Group :</span></div>
<div class="col">
<select class="input" name="DBloodGroup" required id="DBloodGroup" required>
<option></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>
<option value="O+">O+</option>
<option value="O-">O-</option>
</select>
</div>
<div class="col margin-4"><input class="input" type="submit" value="Submit"></div>
</form>
<div class="margin-60">
<h4>*T&C apply</h4>
</div>
</div>
</div>
<hr class="hr">
<div class="text-left content align-row">
<div class="col">
<h2>Want to become a Volunteer?</h2>
</div>
<div class="col margin-4">
<a href="registerVolunteer.html"><button class="red-button" onclick="">Register Now</button></a>
</div>
</div>
</div>
<div class="row text-center padding">
<div class="card center margin align-row">
<div class="center align-row">
<div class="margin">
<i class="fas fa-thumbs-up fa-3x"></i><h4>Blood Donors</h4>
<span class="highlight">
<?php
$query='SELECT count(donor.dId) as number_of_donors FROM donor';
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0){
while ($row = mysqli_fetch_array($result)) {
echo $row['number_of_donors']." ";
}
}
else{
echo"0 ";
}
?></span>
</div>
<div class="margin">
<i class="fas fa-hand-holding-heart fa-3x"></i><h4>Blood Requests</h4>
<span class="highlight">
<?php
$query='SELECT count(*) as number_of_request FROM request';
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0){
while ($row = mysqli_fetch_array($result)) {
echo $row['number_of_request']." ";
}
}
else{
echo"No Blood Requests at the moment.";
}
?>
</span>
</div>
<div class="margin">
<i class="fas fa-hand-holding-heart fa-3x"></i><h4>Active Donors</h4>
<span class="highlight">
<?php
$query='SELECT count(*) as number_of_active_donors FROM volunteer';
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0){
while ($row = mysqli_fetch_array($result)) {
echo $row['number_of_active_donors']." ";
}
}
else{
echo"No Active Donors at the moment.";
}
?>
</span>
</div>
</div>
</div>
<div class="align-row">
<div class="card margin"> <h3>Blood Donate Tips</h3><hr>
<ol ">
<li class="margin-4">
Eat and drink wisely
</li><br>
<li class="margin-4">
Face your fears if you're scared of needles
</li><br>
<li class="margin-4">
Come prepared
</li><br>
<li class="margin-4">
Dress for success
</li><br>
<li class="margin-4">
Take your time
</li>
</ol>
</div>
<div class="card margin">
<h3><a href="Requests.php">Blood Requests</a></h3><hr>
<div class="padding margin">
<?php
$query='SELECT request.rid,pFName,pLName,pSex,pBloodGroup
FROM request,patient
WHERE request.pId=patient.pId
AND unitsRecieved<units';
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0){
$i=0;
while ((($row = mysqli_fetch_array($result))) && ($i<5)) {
echo '<div class="align-row row-3">
<div class="float-left col">'.$row['pFName'].' '.$row['pLName'].'</div>';
echo '<div class="float-center col">'.$row['pSex'].'</div>';
echo '<div class="float-right col"><span class="red-text">'.$row['pBloodGroup'].' </span><a href="./requestInfo.php?pass='.$row['rid'].'"><i class="fas fa-info-circle margin"></i></a></div></div>';
echo "<br>";
$i=$i+1;
}
}
else{
echo"No Requests at the moment.";
}
?>
</div>
</div>
<div class="card margin"> <h3>Available Blood</h3>
<hr><br>
<?php
$query='SELECT D.DBloodGroup , count(*) as count
FROM availability A, donor D, blood B
WHERE A.bId = B.bId
AND B.dId = D.dId
GROUP BY D.DBloodGroup';
$result = mysqli_query($connection,$query);
if(mysqli_num_rows($result)>0){
$i=0;
while ((($row = mysqli_fetch_array($result))) && ($i<8)) {
echo '<div class="align-row row-3">
<div class="float-left col">'.$row['DBloodGroup'].'</div><div></div>';
echo '<div class="float-right col"><span class="red-text">'.$row['count'].' </span></div></div>';
echo "<br>";
$i=$i+1;
}
}
else{
echo"No Requests at the moment.";
}
?>
</div>
</div>
</div>
</div>
</body>
</html>