-
Notifications
You must be signed in to change notification settings - Fork 0
/
home_updater.php
43 lines (35 loc) · 878 Bytes
/
home_updater.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
<?
include_once("global.php");
$roomsAr = array();
$roomsStatusAr = array();
$bookingQueueAr = array();
//booked rooms
$query = "select * from lib_room order by id asc";
$result = $con->query($query);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
array_push($roomsAr,$row['room']);
array_push($roomsStatusAr,$row['status']);
}
}
//waiting queue
$query_bookingQue = "select
*
from lib_bookingQueue where status='waiting' order by id asc
";
$result_bookingQue = $con->query($query_bookingQue);
if ($result_bookingQue->num_rows > 0)
{
while($row = $result_bookingQue->fetch_assoc())
{
array_push($bookingQueueAr,$row['studentId']);
}
}
//$myObj->roomsAr = $roomsAr;
$myObj->roomsStatusAr = $roomsStatusAr;
$myObj->bookingQueueAr = $bookingQueueAr;
$myJSON = json_encode($myObj);
echo $myJSON;
?>