-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdonationHistory.php
47 lines (43 loc) · 1.39 KB
/
donationHistory.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
<?php
session_start();
$_SESSION["tab"] = "Donation History";
if($_SESSION["login"] != 1)
echo '<h2>Authentication Error!!!</h2>';
else{
include_once('header.php');
$sdate = $_POST['sdate'];
$edate = $_POST['edate'];
$sql = "select d.d_date, d.d_time, d.d_quantity, p.p_id, p.p_name, p_phone, p.p_blood_group from Person p,Donation d where p.p_id = d.p_id and d.d_date >= '$sdate' and d.d_date <= '$edate'";
$result = mysqli_query($con, $sql);
###########contents of div goes here###########
echo "<h2>Donation History</h2><br>";
if ($result->num_rows > 0) {
echo "<table>
<tr>
<th>Personal ID</th>
<th>Name</th>
<th>Phone</th>
<th>Blood Group</th>
<th>Date</th>
<th>Time</th>
<th>Units of Blood</th>
</tr>";
while($row = $result->fetch_assoc()) {
echo "
<tr>
<td>" . $row["p_id"]. "</td>
<td>" . $row["p_name"]."</td>
<td>" .$row["p_phone"] ."</td>
<td>" . $row["p_blood_group"]. "</td>
<td>" . $row["d_date"]. "</td>
<td>" . $row["d_time"]. "</td>
<td>" . $row["d_quantity"]. "</td>
</tr>";
}
echo "</table> <br><br>";
}
else
echo "No record found in the specified intervel";
include_once('footer.php');
}
?>