-
Notifications
You must be signed in to change notification settings - Fork 1
/
view-room.php
60 lines (56 loc) · 1.56 KB
/
view-room.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
<?php
session_start();
include_once("helpers/db.php");
if(!isset($_SESSION['username'])){
header("Location: login.php");
}
$page_title = "View all staff";
include("inc/header.php");
?>
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body class="text-center">
<?php include("inc/menu.php"); ?>
<div class="container">
<br><br>
<table class="table">
<tr>
<th>Room number</th>
<th>Type</th>
<th>Rent</th>
<th>Status</th>
</tr>
<?php
$query = "SELECT * FROM room";
$query_run=mysqli_query($con,$query);
while($data = mysqli_fetch_array($query_run)){
$type_code = $data['type'];
$status_code = $data['status'];
if($type_code==1){
$type = "General Ward";
}elseif($type_code==2){
$type = "ICU";
}elseif($type_code==3){
$type = "Emergency";
}
if($status_code == 1){
$status = "<span class='text-success'><b>Vacant</b></span>";
} else{
$status = "<span class='text-danger'><b>Allocated</b></span>";
}
?>
<tr>
<td><?php echo $data['number']?></td>
<td><?php echo $type ?></td>
<td><?php echo $data['rent'] ?></td>
<td><?php echo $status ?></td>
</tr>
<?php
}
?>
</table>
</div>
<?php
include_once("inc/bootstrap.php");
include_once("inc/footer.php");
?>