-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
60 lines (40 loc) · 1.33 KB
/
index.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
include 'view/header.php';
require('model/database.php');
require('model/data_db.php');
?>
<div class="topNav">
<a href="index.php"><img src="img/UniSQlogo.svg" width="150" height="60.53" alt="UniSQ"></a>
<div class="ref">
<a href="modes/admin.php">Admin</a>
<a href="index.php">Home</a>
<a target="_blank" href="https://usq.saasitau.com/">UniSQ HUB</a>
</div>
</div>
<?php
$action = filter_input(INPUT_POST, 'action');
if ($action === NULL){
$action = filter_input(INPUT_GET, 'action');
if($action === NULL){
$action = "list_rooms";
}
}
if($action == "list_rooms" || $action == 'Clear'){
$rooms = get_rooms();
//var_dump($rooms);
include('modes/general.php');
}
else if($action == "Search"){
$roomType = filter_input(INPUT_POST, 'room');
$campus = filter_input(INPUT_POST, 'Campus');
$size = filter_input(INPUT_POST, 'Size');
$rooms = search_rooms($campus, $size, $roomType);
include('modes/general.php');
}else if($action == "Read full description"){
$roomName = filter_input(INPUT_POST, 'roomName');
$campus = filter_input(INPUT_POST, 'campus');
$room = get_room($roomName, $campus);
include('modes/description.php');
}
?>
<?php include 'view/footer.php'; ?>