-
Notifications
You must be signed in to change notification settings - Fork 0
/
room_unavailable.php
executable file
·37 lines (25 loc) · 1.1 KB
/
room_unavailable.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
<?php
$id = "new_room.php";
$connect = true;
include "main.php";
//filter for top residential admin only
//Store the residence details in an associative array in the order {'residence_id'=>'residence_title/name'}
$reslist = $connection->query("SELECT * FROM residence",true);
$listed = $_SESSION['query'];
$resarr = array();
while($pa = mysqli_fetch_assoc($listed)){
$resarr[$pa['id']] = $pa['name'];
}
//Getting all admin data save for the first 3 defaults
$qry = "SELECT * FROM rooms WHERE available='0'";
$connection->num_rows($qry,true);
if($_SESSION['num_rows']){
header("Content-Type:application/json ");
die( json_encode( array("rooms" => $connection->printQueryResults( $qry, true), "residences" => $resarr ) ));
}else{
die ('<div class="alert alert-info alert-bold-border fade in alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>NOTE: </strong><br> There are currently no specially reserved rooms!<br> <a class="alert-link" onclick="roomAvail()">Click to specially reserve a room</a>.
</div>');
}
?>