-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
130 lines (117 loc) · 4.63 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
require __DIR__ . '/vendor/autoload.php';
include "db/festival_db.php";
$r = getenv("WEB_ROOT");
if($r != "") {
$web_root = $r;
}
else {
$web_root = "/" . basename(__DIR__);
}
function create_header($style="") {
global $auth;
global $web_root;
$header = "<!-- Compiled and minified CSS -->
<header>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\"></script>
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\">
<!-- Compiled and minified JavaScript -->
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js\"></script>
<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">
<style>
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
.practices {
width: 40%;
margin: 0 auto;
margin-top: 5%;
margin-bottom: 5%;
}
#logo {
margin-left: 1%;
}
#home_logo {
padding: 5% 10%;
}
</style>";
$navbar = "<nav style='background:#355070;'>
<div class=\"nav-wrapper\">
<a href=\"" . $web_root . "/index.php\" style=\"white-space:nowrap\" class=\"brand-logo\" id=\"logo\">Asian Fest</a>
<a href=\"#\" data-target=\"mobile-demo\" class=\"sidenav-trigger\"><i class=\"material-icons\">menu</i></a>
<ul id=\"nav-mobile\" class=\"right hide-on-med-and-down\">
<li><a href=\"" . $web_root . "/calendar/index.php\">Calendar</a></li>";
if ($auth->isLoggedIn()) {
$navbar .= "<li><a href=\"" . $web_root . "/practices/index.php\">Dashboard</a></li>";
if($auth->hasRole(\Delight\Auth\Role::SUPER_ADMIN)) {
$navbar .= "<li><a href=\"" . $web_root . "/control_panel\">Control Panel</a></li>";
}
if($auth->hasRole(\Delight\Auth\Role::ADMIN)) {
$navbar .= "<li><a href=\"" . $web_root . "/confirm_admin_status\">Confirm Admins</a></li>";
}
$navbar.= "<li><a href=\"" . $web_root . "/logout/index.php\">Log Out</a></li></ul>
</div>
</nav>";
}
else {
$navbar .= "<li><a href=\"" . $web_root . "/signup/index.php\">Sign Up</a></li>
<li><a href=\"" . $web_root . "/signin/index.php\">Sign In</a></li>
</ul>
</div>
</nav>";
}
$navbar .= "<ul class=\"sidenav\" id=\"mobile-demo\">
<li><a href=\"" . $web_root . "/calendar/index.php\">Calendar</a></li>";
if ($auth->isLoggedIn()) {
$navbar .= "<li><a href=\"" . $web_root . "/practices/index.php\">Dashboard</a></li>";
if($auth->hasRole(\Delight\Auth\Role::ADMIN)) {
$navbar .= "<li><a href=\"" . $web_root . "/confirm_admin_status\">Confirm Admins</a></li>";
}
$navbar.= "<li><a href=\"" . $web_root . "/logout/index.php\">Log Out</a></li></ul>";
}
else {
$navbar .= "<li><a href=\"" . $web_root . "/signup/index.php\">Sign Up</a></li>
<li><a href=\"" . $web_root . "/signin/index.php\">Sign In</a></li></ul>";
}
$navbar .= "</header></meta><body><main>";
echo $header . $style . $navbar;
}
function create_footer() {
$footer = "
</main></body>
<footer style='background:#355070' class=\"page-footer\">
<div class=\"container\">
<div class=\"row\">
<div class=\"col l6 s12\">
<h5 class=\"white-text\">RHS Asian Festival 2020</h5>
<p class=\"grey-text text-lighten-4\">This website was designed to be used by performers in the RHS Asian Festival Program.</p>
</div>
<div class=\"col l4 offset-l2 s12\">
<h5 class=\"white-text\">Contact</h5>
<ul>
<li><a class=\"grey-text text-lighten-3\" href=\"https://www.instagram.com/rhs.asianfest/\">Instagram | @rhs.asianfest</a></li>
<li><a class=\"grey-text text-lighten-3\" href=\"#!\">Questions? | [email protected]</a></li>
</ul>
</div>
</div>
</div>
<div class=\"footer-copyright\">
<div class=\"container\">
© 2020 RHS Asian Fest
<a class=\"grey-text text-lighten-4 right\" href=\"#!\"></a>
</div>
</div>
</footer>";
$footer .= "<script>
$(document).ready(function(){
$('.sidenav').sidenav();
});
</script>";
echo $footer;
}