-
Notifications
You must be signed in to change notification settings - Fork 18
/
receivingHistory.php
52 lines (45 loc) · 1.26 KB
/
receivingHistory.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
<?php
session_start();
$_SESSION["tab"] = "Receiving History";
if($_SESSION["login"] != 1)
echo '<h2>Authentication Error!!!</h2>';
else{
include_once('header.php');
$sdate = $_POST['sdate'];
$edate = $_POST['edate'];
$sql = "select r.r_date, r.r_time, r.r_hospital, r.r_quantity, p.p_id, p.p_name, p_phone, p.p_blood_group from Person p,Receive r where p.p_id = r.p_id and r.r_date >= '$sdate' and r.r_date <= '$edate'";
$result = mysqli_query($con, $sql);
###########contents of div goes here###########
echo "<h2>Receiving 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>
<th>Hospital</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["r_date"]. "</td>
<td>" . $row["r_time"]. "</td>
<td>" . $row["r_quantity"]. "</td>
<td>" . $row["r_hospital"]. "</td>
</tr>";
}
echo "</table> <br><br>";
}
else
echo "No record found in the specified intervel";
include_once('footer.php');
}
?>