forked from Chandana047/Blood-Bank-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 14
/
bloodrequest.php
89 lines (82 loc) · 2.38 KB
/
bloodrequest.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
<?php
require 'file/connection.php';
session_start();
if(!isset($_SESSION['hid']))
{
header('location:login.php');
}
else {
$hid = $_SESSION['hid'];
$sql = "select bloodrequest.*, receivers.* from bloodrequest, receivers where hid='$hid' && bloodrequest.rid=receivers.id";
$result = mysqli_query($conn, $sql);
?>
<!DOCTYPE html>
<html>
<?php $title="Bloodbank | Blood Requests"; ?>
<?php require 'head.php'; ?>
<style>
body{
background: url(image/p2.png) 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="9" class="title">Blood 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 colspan="2">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;">No one has requested yet. </b>';
}
?>
</div>
<?php while($row = mysqli_fetch_array($result)) { ?>
<tr>
<td><?php echo ++$counter;?></td>
<td><?php echo $row['rname'];?></td>
<td><?php echo $row['remail'];?></td>
<td><?php echo $row['rcity'];?></td>
<td><?php echo $row['rphone'];?></td>
<td><?php echo $row['bg'];?></td>
<td><?php echo 'You have '.$row['status'];?></td>
<td><?php if($row['status'] == 'Accepted'){ ?> <a href="" class="btn btn-success disabled">Accepted</a> <?php }
else{ ?>
<a href="file/accept.php?reqid=<?php echo $row['reqid'];?>" class="btn btn-success">Accept</a>
<?php } ?>
</td>
<td><?php if($row['status'] == 'Rejected'){ ?> <a href="" class="btn btn-danger disabled">Rejected</a> <?php }
else{ ?>
<a href="file/reject.php?reqid=<?php echo $row['reqid'];?>" class="btn btn-danger">Reject</a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
</div>
<?php require 'footer.php'; ?>
</body>
</html>
<?php } ?>