-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.php
executable file
·414 lines (401 loc) · 21.8 KB
/
dashboard.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
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<?php
require_once "start.php";
$request = new Request();
if ($request->logoutid) {
// print "1";
if (!session_id()) session_start();
session_unset();
session_destroy();
header("Location: login.php");
}
else {
//print "3";
if (!session_id()) session_start();
if (!empty($_SESSION["auth_login"]) && !empty($_SESSION["auth_password"])) {
$username = $_SESSION["auth_login"];
$password = $_SESSION["auth_password"];
$user = UserDB::authUser($request->username, $request->password);
$fields = MixedDB::getMixedObjects($user->getID());
$messages = MessageDB::getAllShow();
if ($request->msg) {
$msg = new MessageDB();
$msg->content = $request->msg;
$msg->user_id = $request->user_id;
$msg->save();
$messages = MessageDB::getAllShow();
}
}
else {
//print "4";
$newURL = "login.php?session=0";
header('Location: '.$newURL);
}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $header = new Header("Teachman"); ?>
<?=Header::getTitle()?>
<?=Header::getMeta("utf-8")?>
<?=Header::getMeta(null,"IE=edge","X-UA-Compatible")?>
<?=Header::getMeta("viewport","width=device-width, initial-scale=1",null)?>
<?=Header::getLink("styles/custom.css")?>
<!-- Bootstrap -->
<?=Header::getScript("scripts/jquery.min.js")?>
<?=Header::getLink("styles/bootstrap/css/bootstrap.min.css")?>
<?=Header::getLink("styles/bootstrap/css/bootstrap-select.css")?>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<?=Header::getScript("scripts/bootstrap.min.js")?>
<?=Header::getScript("scripts/bootstrap/jquery.js")?>
<!-- JQUERY SCRIPTS -->
<!-- CUSTOM SCRIPTS -->
<?=Header::getScript("scripts/custom.js")?>
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-collapse navbar-cls-top " role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<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>
</div>
<div style="color: white; padding: 15px 50px 5px 50px; float: right;
font-size: 16px;">
<a href="dashboard.php?logoutid=<?=$user->id?>" class="btn btn-danger square-btn-adjust">Logout</a>
</div>
</nav>
<!-- /. NAV TOP -->
<nav class="navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li class="text-center">
<img src="<?=$user->img?>" class="user-image img-responsive"/>
</li>
<li>
<a class="active-menu" href="dashboard.php"><i class="glyphicon glyphicon-dashboard"></i> Dashboard</a>
</li>
<?php foreach($fields as $field) { ?>
<li>
<a href="<?=$field->link?>"><i class="glyphicon glyphicon-<?=$field->img?>"></i><?=$field->name?></a>
</li>
<?php } ?>
</ul>
</div>
</nav>
<!-- /. NAV SIDE -->
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h2>Dashboard</h2>
<h5>Welcome <?=$user->firstname?> <?=$user->lastname?> , Love to see you back. </h5>
</div>
</div>
<!-- /. ROW -->
<hr />
<div class="row">
<?php foreach($fields as $field) { ?>
<div class="col-md-3 col-sm-6 col-xs-12" >
<div class="panel panel-back noti-box">
<span class="icon-box bg-color-<?=$field->color?> set-icon">
<i class="glyphicon glyphicon-<?=$field->img?>" aria-hidden="true"></i>
</span>
<div class="text-box">
<a href="<?=$field->link?>"> <p class="main-text"><?=$field->name?></p></a>
<span class="center-block text-muted"><?=$field->count?></span>
</div>
<?php if (!$user->isAdmin()) { ?>
<div class="text-right">
<i class="glyphicon glyphicon-plus-sign" aria-hidden="true"></i>
<span data-target="#modal<?=$field->name?>" data-toggle="modal" class="hov">Create New</span>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col-md-6 col-sm-12 col-xs-12">
<div class="chat-panel panel panel-default chat-border chat-panel-head" >
<div class="panel-heading">
<i class="fa fa-comments fa-fw"></i>
Chat Box
</div>
<div class="panel-body">
<ul class="chat-box">
<?php foreach ($messages as $message) { ?>
<?php if ($message->user->getID() == $user->getID()) { $icon="right"; $mes="left"; $text = "text-success"; } else {$icon="left"; $mes="right"; $text = "text-warning"; } ?>
<li class="<?=$icon?> clearfix">
<span class="chat-img pull-<?=$icon?>">
<img class="img-circle icon-box icon-bar" src="<?=$message->user->img?>" alt="User" style="height: auto;width: auto;max-width:50px;max-height:50px;" />
</span>
<div class="chat-body clearfix">
<h5><strong class="pull-<?=$icon?> <?=$text?>"><?=$message->user->firstname?> <?=$message->user->lastname?></strong></h5>
<small class="text-muted pull-<?=$mes?>">
<i class="fa fa-clock-o fa-fw"></i><?=$message->lastseen?>
</small>
</div>
<h4 class="text-muted">
<?=$message->content?>
</h4>
</li>
<?php } ?>
</ul>
</div>
<div class="panel-footer">
<form action="dashboard.php" method="POST">
<div class="input-group">
<input id="btn-input" type="text" name="msg" class="form-control input-sm" placeholder="Type your message to send..." />
<input type="hidden" name="user_id" value="<?=$user->getID()?>">
<span class="input-group-btn">
<button type="submit" class="btn btn-warning btn-sm" id="btn-chat">
Send
</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /. ROW -->
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<!--MODAL Category-->
<div id="modalCategories" class="modal fade" style="font-size:14px">
<div class="modal-dialog" role="document">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center">Create Category</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="submit.php">
<div class="form-group">
<label for="crsCFname" class="control-label col-sm-3">Course Category FullName:</label>
<div class="col-sm-9">
<input type="text" id="crsCFname" class="form-control" name="courseCategoryFullName" placeholder="Full Name of your Course Category">
</div>
</div>
<div class="form-group">
<label for="crsCSname" class="control-label col-sm-3">Course Category ShortName:</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="crsCSname" name="CourseShortName" placeholder="Short Name of your Course Category">
</div>
</div>
<div class="form-group">
<label for="crsCatDes" class="control-label col-sm-3">Course Category Description:</label>
<div class="col-sm-9">
<textarea id="crsCatDes" class="form-control" name="courseCategoryDescription"></textarea>
</div>
</div>
<input type="submit" class="btn btn-success" value="Submit">
</form>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--MODAL Course-->
<div id="modalCourses" class="modal fade">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center">Course</h4>
</div>
<div class="modal-body">
<form id="crsFrm" class="form-horizontal" method="post" action="submit.php">
<div class="form-group">
<label for="courseFname" class="control-label col-sm-3">Course FullName:</label>
<div class="col-sm-9">
<input type="text" id="courseFname" class="form-control" name="CourseForName" placeholder="Full Name of your Course">
</div>
</div>
<div class="form-group">
<label for="crsSname" class="control-label col-sm-3">Course ShortName:</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="crsSname" name="CourseShortName" placeholder="Short Name of your Course">
</div>
</div>
<div class="form-group">
<label for="selCrsCat" class="control-label col-sm-3">Select Course Category:</label>
<div class="col-sm-9">
<select id="selCrsCat" class="form-control" name="CourseCategory" >
<option value="Category1">Category 1</option>
<option value="Category2">Category 2</option>
<option value="Category3">Category 3</option>
</select>
</div>
</div>
<div class="form-group">
<label for="crsSdate" class="control-label col-sm-3">Course Start Date:</label>
<div class="col-sm-9">
<input type="date" class="form-control" id="crsSdate" name="courseStartDate">
</div>
</div>
<div class="form-group">
<label for="crsEdate" class="control-label col-sm-3">Course End Date:</label>
<div class="col-sm-9">
<input type="date" class="form-control" id="crsEdate" name="courseEndDate">
</div>
</div>
<input type="submit" class="btn btn-success" value="Submit">
</form>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- MODAL Quiz-->
<div id="modalQuizzes" class="modal fade" tabindex="-1" role="dialog" >
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center">Quiz</h4>
</div>
<div class="modal-body">
<form id="quizFrm" class="form-horizontal method = "post.php" action="sub.php"">
<div class="form-group">
<label for="titQuiz" class="col-sm-3 control-label">Title:</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="titQuiz" name="titleQuiz" placeholder="The Title of your Quiz...">
</div>
</div>
<div class="form-group">
<label for="lesSel" class="col-sm-3 control-label">Lesson Selection: </label>
<div class="col-sm-9">
<select id="lesSel" class="form-control" name="lessonSelect" multiple>
<option value="chrome">Google Chrome</option>
<option value="firefox">Firefox</option>
<option value="ie">IE</option>
<option value="safari">Safari</option>
<option value="opera">Opera</option>
<option value="other">Other</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="variant">Variant:</label>
<div class="col-sm-3">
<input id="variant" class="form-control" type="number" name="numberOfVariants" value="1" min="1">
</div>
</div>
<div class="form-group">
<label for="nmbrOfQuiz" class=" col-sm-3 control-label">Number of Quizzes:</label>
<div class="col-sm-3">
<input id="nmbrOfQuiz" class="form-control" type="number" name="numberOfQuizzes" value="1" min="1">
</div>
</div>
<div class="form-group">
<label class="radio-inline col-sm-3 control-label"><input type="radio" name="privacy" value="public">Public</label>
<div class="col-sm-3">
<label class="radio-inline control-label"><input type="radio" name="privacy" value="private">Private</label>
</div>
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- MODAL SYLLABUS -->
<div id="modalSyllabus" class="modal fade">
<div class="modal-dialog" role="document">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center">Create Syllabus</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="submit.php">
<div class="form-group">
<label for="sylCourse" class="control-label col-sm-3">Select Course:</label>
<div class="col-sm-9">
<select id="sylCourse" class="form-control" name="SylCourse" >
<option value="Category1">Discrete </option>
<option value="Category2">SystemProgramming</option>
<option value="Category3">English</option>
</select>
</div>
</div>
<div class="form-group">
<label for="courseObject" class="control-label col-sm-3">Course Objection:</label>
<div class="col-sm-9">
<input type="text" id="courseObject" class="form-control" name="Course_objection" placeholder="Full Name of your Course Objection">
</div>
</div>
<div class="form-group">
<label for="courseBooks" class="control-label col-sm-3">TextBooks:</label>
<div class="col-sm-9">
<input type="text" id="courseBooks" class="form-control" name="Text_books" placeholder="Textbooks">
</div>
</div>
<div class="form-group">
<label for="courseObject" class="control-label col-sm-3">Class methods:</label>
<div class="col-sm-9">
<input type="text" id="classMethod" class="form-control" name="Class_methods" placeholder="Full Name of your Course Objection">
</div>
</div>
<div class="form-group">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>No</th>
<th>Topic</th>
<th>Week</th>
<th>Content</th>
<th>Lesson</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>
<input type="text" id="topic" class="form-control" name="CourseForName" placeholder="Full Name of your Course">
</td>
<td>
<input type="text" id="week" class="form-control" name="CourseForName" placeholder="Full Name of your Course">
</td>
<td>
<input type="text" id="content" class="form-control" name="CourseForName" placeholder="Full Name of your Course">
</td>
<td>
<input type="text" id="lesson" class="form-control" name="CourseForName" placeholder="Full Name of your Course">
</td>
</tr>
</table>
<div class="text-left">
<button class="btn btn-info" type="button" name="button">Add new row</button>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-success text-right" value="Submit">
<button class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>