/
main.php
50 lines (43 loc) · 1.06 KB
/
main.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
<?php
function load_main() {
$objResponse = new xajaxResponse();
$text .= gen_main();
$objResponse->assign("site_wrapper", "innerHTML", $text);
return $objResponse;
}
function gen_main() {
$text = '';
$text .= '<div id="top_wrapper">';
$text .= '<nav id="top_nav" class="navbar navbar-inverse navbar-fixed-top animated fadeInDown">';
$text .= gen_nav();
$text .= '</nav>';
$text .= '</div>';
$text .= '<div id="middle_wrapper" class="animated fadeIn">';
switch ($_SESSION['curPage']) {
case '1':
$text .= gen_residents();
break;
case '2':
$text .= gen_guests();
break;
case '3':
if($_SESSION['user']['admin']) {
$text .= gen_users();
} else {
$_SESSION['curPage'] = 1;
$text .= gen_main();
}
break;
case '4':
$text .= gen_shifts();
break;
}
$text .= '</div>';
$text .= '<div id="bottom_wrapper">';
$text .= '<nav id="bottom_nav" class="navbar navbar-default navbar-fixed-bottom animated fadeInUp">';
$text .= gen_footer();
$text .= '</nav>';
$text .= '</div>';
return $text;
}
?>