forked from mentorchita/Blood-Bank-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sentrequest.php
84 lines (78 loc) · 2.06 KB
/
sentrequest.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
<?php
require 'file/connection.php';
session_start();
if(!isset($_SESSION['rid']))
{
header('location:login.php');
}
else {
$rid = $_SESSION['rid'];
$sql = "select bloodrequest.*, hospitals.* from bloodrequest, hospitals where rid='$rid' && bloodrequest.hid=hospitals.id";
$result = mysqli_query($conn, $sql);
?>
<!DOCTYPE html>
<html>
<?php $title="Bloodbank | Sent Requests"; ?>
<?php require 'head.php'; ?>
<style>
body{
background: url(image/p5.jpg) no-repeat center;
background-size: cover;
min-height: 0;
height: 650px;
}
.login-form{
width: calc(100% - 20px);
max-height: 650px;
max-width: 450px;
background-color: white;
}
</style>
<body>
<?php require 'header.php'; ?>
<div class="container cont">
<?php require 'message.php'; ?>
<table class="table table-responsive table-striped rounded mb-5">
<tr><th colspan="8" class="title">Sent requests</th></tr>
<tr>
<th>#</th>
<th>Name</th>
<th>Email</th>
<th>City</th>
<th>Phone</th>
<th>Blood Group</th>
<th>Status</th>
<th>Action</th>
</tr>
<div>
<?php
if ($result) {
$row =mysqli_num_rows( $result);
if ($row) { //echo "<b> Total ".$row." </b>";
}else echo '<b style="color:white;background-color:red;padding:7px;border-radius: 15px 50px;">You have not requested yet. </b>';
}
?>
</div>
<?php while($row = mysqli_fetch_array($result)) { ?>
<tr>
<td><?php echo ++$counter;?></td>
<td><?php echo $row['hname'];?></td>
<td><?php echo $row['hemail'];?></td>
<td><?php echo $row['hcity'];?></td>
<td><?php echo $row['hphone'];?></td>
<td><?php echo $row['bg'];?></td>
<td><?php echo $row['status'];?></td>
<td><?php if($row['status'] == 'Accepted'){ ?>
<?php }
else{ ?>
<a href="file/cancel.php?reqid=<?php echo $row['reqid'];?>" class="btn btn-danger">Cancel</a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
</div>
<?php require 'footer.php'; ?>
</body>
</html>
<?php } ?>