-
Notifications
You must be signed in to change notification settings - Fork 8
/
fetch.php
131 lines (131 loc) · 5.96 KB
/
fetch.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
<!DOCTYPE html>
<html>
<head>
<title>Data Display Page</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
<h1>Registered Donors</h1>
<div class="table-responsive mt-4">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Blood Group</th>
<th>Gender</th>
<th>Birthdate</th>
<th>Weight</th>
<th>Show Mobile</th>
<th>State</th>
<th>SMS Alert</th>
<th>Zipcode</th>
<th>District</th>
<th>Area</th>
<th>Landmark</th>
</tr>
</thead>
<tbody>
<?php
$mysqli = new mysqli("localhost", "root", "", "authentication");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$sql = "SELECT * FROM credentials";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["id"] . "</td>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["email"] . "</td>";
echo "<td>" . $row["phone"] . "</td>";
echo "<td>" . $row["bloodgrp"] . "</td>";
echo "<td>" . $row["gender"] . "</td>";
echo "<td>" . $row["birthdate"] . "</td>";
echo "<td>" . $row["weight"] . "</td>";
echo "<td>" . $row["showmobile"] . "</td>";
echo "<td>" . $row["state"] . "</td>";
echo "<td>" . $row["smsalert"] . "</td>";
echo "<td>" . $row["zipcode"] . "</td>";
echo "<td>" . $row["district"] . "</td>";
echo "<td>" . $row["area"] . "</td>";
echo "<td>" . $row["landmark"] . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='15'>No data found</td></tr>";
}
$mysqli->close();
?>
</tbody>
</table>
</div>
</div>
<div class="container mt-5">
<h1>Recipients Registered blood for an upcoming day</h1>
<div class="table-responsive mt-4">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Blood Group</th>
<th>Gender</th>
<th>Birthdate</th>
<th>Weight</th>
<th>Show Mobile</th>
<th>State</th>
<th>SMS Alert</th>
<th>Zipcode</th>
<th>District</th>
<th>Area</th>
<th>Landmark</th>
<th>blood wanted date</th>
</tr>
</thead>
<tbody>
<?php
$mysqli = new mysqli("localhost", "root", "", "authentication");
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
$sql = "SELECT * FROM upcoming";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["id"] . "</td>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["email"] . "</td>";
echo "<td>" . $row["phone"] . "</td>";
echo "<td>" . $row["bloodgrp"] . "</td>";
echo "<td>" . $row["gender"] . "</td>";
echo "<td>" . $row["birthdate"] . "</td>";
echo "<td>" . $row["weight"] . "</td>";
echo "<td>" . $row["showmobile"] . "</td>";
echo "<td>" . $row["state"] . "</td>";
echo "<td>" . $row["smsalert"] . "</td>";
echo "<td>" . $row["zipcode"] . "</td>";
echo "<td>" . $row["district"] . "</td>";
echo "<td>" . $row["area"] . "</td>";
echo "<td>" . $row["landmark"] . "</td>";
echo "<td>" . $row["blood_date"] . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='15'>No data found</td></tr>";
}
$mysqli->close();
?>
</tbody>
</table>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper