-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
224 lines (199 loc) · 5.39 KB
/
index.php
File metadata and controls
224 lines (199 loc) · 5.39 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?php
require_once("requires.php");
if(Pages::GetCurrentPage() == "SMS")
{
include("pages/sms.php");
exit;
}
if(is_null($me))
{
Pages::SetPage("Login");
if(isset($_POST["login"]))
{
$username = CleanString($_POST["username"]);
$password = $_POST["password"];
if(empty($username) || empty($password))
{
$error = "Invalid username or password";
}
else
{
$staff = Staff::GetByUsername($username);
if($staff->IsValid() && $staff->IsActive())
{
if($staff->GetPassword() == EncryptPassword($password))
{
Session::Set("sid", $staff->GetID());
Session::Set("secret", $staff->GetPassword());
Pages::SetPage("Dashboard");
UpdateLoggedIn();
}
else
{
$error = "Invalid username or password";
}
}
else
{
$error = "Invalid username or password";
}
}
}
}
elseif(Pages::GetCurrentPage() == "Typeahead")
{
include("pages/typeahead.php");
exit;
}
elseif(Pages::GetCurrentPage() == "DT Clients")
{
include("pages/dt_clients.php");
exit;
}
elseif(Pages::GetCurrentPage() == "DT Tickets")
{
include("pages/dt_tickets.php");
exit;
}
elseif(Pages::GetCurrentPage() == "Admin" && $me->GetType() != TYPE_SUPERSTAFF)
{
Pages::SetPage("Dashboard");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $system_name." :: ".Pages::GetCurrentPage(); ?></title>
<meta name="description" content="<?php echo $system_name." Help Desk System"; ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="resources/bootstrap.min.css">
<link rel="stylesheet" href="resources/sb-admin.css">
<link rel="stylesheet" href="resources/font-awesome.min.css">
<link rel="stylesheet" href="resources/bootstrap-select.min.css">
<link rel="stylesheet" href="resources/jasny-bootstrap.min.css">
<link rel="stylesheet" href="resources/dataTables.bootstrap.css">
<link rel="stylesheet" href="resources/morris.css">
<link rel="stylesheet" href="resources/style.css">
<script src="resources/jquery.min.js"></script>
<script src="resources/bootstrap.min.js"></script>
<script src="resources/jquery.metisMenu.js"></script>
<script src="resources/bootstrap-select.min.js"></script>
<script src="resources/typeahead.bundle.js"></script>
<script src="resources/jasny-bootstrap.min.js"></script>
<script src="resources/jquery.dataTables.js"></script>
<script src="resources/dataTables.bootstrap.js"></script>
<script src="resources/raphael-min.js"></script>
<script src="resources/morris.min.js"></script>
<script src="resources/script.js"></script>
</header>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<?php
if(!is_null($me))
{
?>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php
}
?>
<a class="navbar-brand" href="index.php">
<img src="images/logo.png" width="42" alt="<?php echo $system_name; ?> Logo" />
<?php echo $system_name;?>
</a>
</div>
<?php
if(!is_null($me))
{
?>
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<?php echo $me->GetName(); ?> [<?php echo $me->GetPoints(); ?>] <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-messages">
<li>
<a href="index.php?p=profile"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li>
<a href="index.php?p=settings"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>
<li class="divider"></li>
<li>
<a href="index.php?p=logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
</li>
</ul>
<div class="navbar-default navbar-static-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li>
<a href="index.php?p=dashboard"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="index.php?p=new_ticket"><i class="fa fa-ticket fa-fw"></i> New Ticket</a>
</li>
<li>
<a href="index.php?p=tickets"><i class="fa fa-search fa-fw"></i> View Tickets</a>
</li>
<?php
if($me->GetType() == TYPE_SUPERSTAFF)
{
?>
<li>
<a href="index.php?p=admin"><i class="fa fa-lock fa-fw"></i> Administration Panel</a>
</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
}
?>
</nav>
<?php
if(!is_null($me))
{
?>
<div id="page-wrapper">
<?php
if(Pages::GetCurrentPage() !== "Ticket")
{
?>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header"><?php echo Pages::GetCurrentPage(); ?></h1>
</div>
</div>
<?php
}
}
include("pages/".Pages::CleanPage(Pages::GetCurrentPage()).".php");
?>
<div class="row global-footer">
<div class="col-lg-12">
<a href="https://github.com/Spacetech/Xion">Open Source on GitHub</a>
</div>
</div>
<?php
if(!is_null($me))
{
?>
</div>
<?php
}
?>
</div>
</body>
</html>