-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashboard_ex.php
100 lines (89 loc) · 2.54 KB
/
dashboard_ex.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
90
91
92
93
94
95
96
97
98
99
100
<table >
<tr>
<td>
<table cellpadding="12" cellspacing="20">
<?php
$conn=mysqli_connect("localhost","root","");
$db=mysqli_select_db($conn,"hotel_db");
$type=$_GET['type'];
if($type==-1)
{
$clause="";
}
else
{
$clause=" and status=$type";
}
if($_GET['state']==0)
{
$query="select distinct floor_no from floor_info order by floor_no";
$result=mysqli_query($conn,$query);
}
else
{
$query="select * from room_type";
$result=mysqli_query($conn,$query);
}
while($filter=mysqli_fetch_assoc($result))
{
if($_GET['state']==0)
{
$query2="select * from room_info where floor_no=$filter[floor_no]".$clause." order by c_room_no";
$result2=mysqli_query($conn,$query2);
}
else
{
$query2="select * from room_info where type=$filter[type_id]".$clause." order by c_room_no";
$result2=mysqli_query($conn,$query2);
}
?>
<tr><td colspan="4"><p class="floor"><?php
if($_GET['state']==0)
echo "Floor $filter[floor_no]";
else
echo "$filter[type_name]";
?></p></td></tr><tr>
<?php
$count=0;
while($room=mysqli_fetch_assoc($result2))
{
if($room['status']==0)
{
$color="#f44336";
$query20="select * from booking_detail,booking_master where room_id='$room[room_id]' and checkout_status='0' and checkin_status='1' and booking_master.booking_id=booking_detail.booking_id";
$result20=mysqli_query($conn,$query20);
$acc_name=mysqli_fetch_assoc($result20);
$ac_n=$acc_name['accompany_name'];
}else if($room['status']==1)
{
$color="#53b567";
$ac_n="Available";
}
else
{
$color="#ff9800";
$ac_n="Unavailable";
}
?>
<td align="center" bgcolor='<?php echo $color;?>' class="room"><p class="room_no"><?php echo $room['c_room_no'];?></p><div class="name"><?php echo $ac_n;?></div></td>
<?php
$count++;
if($count%5==0)
{
?>
</tr><tr>
<?php
}
}
if($count==0)
{
echo "<td><p class='n_r'>No rooms found</p></td>";
}
?>
</tr>
<?php
}
?>
</table>
</td>
<td></td></tr></table>