-
Notifications
You must be signed in to change notification settings - Fork 138
/
dashboard.php
547 lines (467 loc) · 19.2 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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<?php
require 'classControllers/init.php';
// check if session is set
if(!isset($_SESSION["role"])) {
header('Location:login.php');
}
$adminId = $_SESSION["admin_id"];
$admin = new Admins();
$display = $admin->getAdmin($adminId);
if($display["hasPic"] == 0) {
// admin has NO picture, show default
$_SESSION["hasPic"] = "no";
} else {
// admin has picture
$_SESSION["hasPic"] = "yes";
}
$mentors = new Mentor;
$displaymActive = $mentors->allMentors();
$displaymPending = $mentors->pendingMentors();
$displaymDeclined = $mentors->declinedMentors();
$interns = new Intern;
$displayiActive = $interns->allInterns();
$displayiPending = $interns->pendingInterns();
$displayiDeclined = $interns->declinedInterns();
$interns = new Intern;
$displayi = $interns->allInterns();
$lockForm = new LockRegForm();
$status = $lockForm->checkStatus();
$noOfInterns = $lockForm->getNoOfInterns();
$noOfMentors = $lockForm->getNoOfMentors();
$noOfAdmins = $lockForm->getNoOfAdmins();
$sponsorsObj = new sponsors;
$noOfSponsors = $sponsorsObj->countSponsor();
if($status == 1) {
// echo "<p>The form is Open for Registration</p>";
} else {
// echo "<p>Registration is closed</p>";
}
if(isset($_POST["lockopenform"])) {
$status = $_POST['status'];
if($status == "open") {
$sval = 1;
} else {
$sval = 0;
}
$lockForm->setStatus($sval);
}
// get pending interns
$pendingInterns = $interns->getPendingInterns();
// get pending mentors
$pendingMentors = $mentors->getPendingMentors();
$totalNotification = $pendingInterns + $pendingMentors;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Dashboard</title>
<link rel="icon" type="img/png" href="images/hng-favicon.png">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<!--This contains the styling for the side bar -->
<link href="css/dashboard.css?v=<?php echo time(); ?>" rel="stylesheet" type="text/css" />
<link href="css/dashboard2910.css?v=<?php echo time(); ?>" rel="stylesheet" type="text/css" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<style type="text/css">
.card {
height: 150px;
background: #f3f3f3;
margin: 15px;
padding: 20px;
border-radius: 8px;
text-align: center;
font-size: 20px;
box-shadow: 1px 0 4px rgba(0,0,0,0.3);
}
.card p{
font-weight: bolder;
font-size: 35px;
}
</style>
</head>
<body>
<main>
<section id="contents">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Admin Dashboard</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<i class="fa fa-align-right"></i>
</button>
</div>
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">My profile <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="adminProfile"><i class="fas fa-user-circle fw"></i> My account</a></li>
<li><a href="compose_message"><i class="fas fa-paper-plane fw"></i> Compose</a></li>
<li><a href="admin_inbox"><i class="fas fa-inbox fw"></i> Inbox</a></li>
<li><a href="admin_outbox"><i class="far fa-envelope fw"></i> Outbox</a></li>
<!-- <li><a href="#"><i class="fas fa-question-circle fw"></i> Help</a></li> -->
<li role="separator" class="divider"></li>
<li><a href="./logout"><i class="fa fa-sign-out"></i> Log out</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-bell"></i><span><?php echo $totalNotification; ?></span> </a>
<ul class="dropdown-menu">
<?php
if($totalNotification > 0) {
?>
<li><a href="pending_interns"> New Interns <?php echo $pendingInterns; ?></a></li>
<li><a href="pending_mentors"> New Mentors <?php echo $pendingMentors; ?></a></li>
<?php
}
?>
</ul>
</li>
<!-- <li><a href="#"><i class="fa fa-comments"></i><span>10</span></a></li> -->
<!-- <li><a href="#"><i class="fas fa-bell"></i><span>18</span></a></li> -->
<!-- <li><a href="#"><i data-show="show-side-navigation1" class="fa fa-bars show-side-btn"></i></a></li> -->
</ul>
</div>
</div>
</nav>
<div class="welcome">
<div class="container-fluid">
<div class="row">
<div class="col-md-9">
<div class="content">
<h2>Welcome, <?php echo $_SESSION["fullname"]; ?> !</h2>
<?php
// format last login
if($_SESSION["lastLogin"] == NULL) {
$fLastLogin = "This is your first login";
} else {
$date=date_create($_SESSION["lastLogin"]);
$fLastLogin = date_format($date, "l, jS F, Y - g:i:A");
}
?>
<p style="text-align: center;"><small>Last Login : <?php echo $fLastLogin; ?></small></p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- <section id="overview-section">
<div class="row" id="welcome">
<div class="col-md-3">
<form method="post">
<input type="hidden" name="status" value="close" />
<button style="background: #b31329;" type="submit" name="lockopenform" id="export">Registration is Open, Lock Now</button>
</form>
</div>
</div>
</section>
-->
<section id="overview-section">
<!-- <h1>Dashboard</h1> -->
<div class="row" id="welcome">
<!-- <div class="col-md-9"><h2>Welcome, <?php echo $_SESSION["fullname"]; ?> !</h2></div> -->
<div class="col-md-3">
<form method="post">
<?php
if($status == 1) {
// form is open
?>
<input type="hidden" name="status" value="close" />
<button style="background: #b31329;" type="submit" name="lockopenform" id="export">Registration is Open, Lock Now</button>
<?php
} else if($status == 0) {
// form is closed
?>
<input type="hidden" name="status" value="open" />
<button style="background: #5cb85c;" type="submit" name="lockopenform" id="export">Registration Locked, Open Now</button>
<?php
}
?>
</form>
</div>
</div>
</section>
<section class='statis text-center'>
<div class="container-fluid">
<div class="row first">
<div class="col-md-3">
<a href="registered_interns">
<div class="box">
<i class="fas fa-user-graduate"></i>
<h3><?php echo $noOfInterns; ?></h3>
<p class="lead">Registered Interns</p>
</div>
</a>
</div>
<div class="col-md-3">
<a href="registered_mentors">
<div class="box">
<i class="fas fa-hands-helping"></i>
<h3><?php echo $noOfMentors; ?></h3>
<p class="lead">Registered Mentors</p>
</div>
</a>
</div>
<div class="col-md-3">
<a href="admins">
<div class="box">
<i class="fas fa-user-shield"></i>
<h3><?php echo $noOfAdmins; ?></h3>
<p class="lead">Registered Admins</p>
</div>
</a>
</div>
<div class="col-md-3">
<a href="registered_sponsors">
<div class="box">
<i class="fas fa-hand-holding-usd"></i>
<h3><?php echo $noOfSponsors; ?></h3>
<p class="lead">Registered Sponsors</p>
</div>
</a>
</div>
</div>
</div>
</section>
</section>
<section id="statistics">
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<div class="charts">
<canvas id="intern-breakdown-bar" class="active">
</canvas>
<canvas id="intern-breakdown-pie" >
</canvas>
<div class="options">
<label for="intern-breakdown-pie-input">
<input type="radio" name="intern-breakdown" id="intern-breakdown-pie-input" value="Pie" checked/> Pie
</label>
<label for="intern-breakdown-bar-input">
<input type="radio" name="intern-breakdown" id="intern-breakdown-bar-input" value="Bar" /> Bar
</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="charts">
<canvas id="mentor-breakdown-bar" class="active">
</canvas>
<canvas id="mentor-breakdown-pie">
</canvas>
<div class="options">
<label for="mentor-breakdown-pie-input">
<input type="radio" name="mentor-breakdown" id="mentor-breakdown-pie-input" value="Pie" checked/> Pie
</label>
<label for="mentor-breakdown-bar-input">
<input type="radio" name="mentor-breakdown" id="mentor-breakdown-bar-input" value="Bar" /> Bar
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="charts">
<canvas id="count_by_state" class="active">
</canvas>
<canvas id="count_by_state2" >
</canvas>
<div class="options">
<label for="internLocation">
<input type="radio" name="byLocation" id="internLocation" value="internLocation" /> Interns
</label>
<label for="mentorLocation">
<input type="radio" name="byLocation" id="mentorLocation" value="mentorLocation" checked/> Mentors
</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="charts">
<canvas id="count_by_track" class="active">
</canvas>
<canvas id="count_by_track2">
</canvas>
<div class="options">
<label for="internTrack">
<input type="radio" name="byTrack" id="internTrack" value="internTrack" /> Interns
</label>
<label for="mentorTrack">
<input type="radio" name="byTrack" id="mentorTrack" value="mentorTrack" checked/> Mentors
</label>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- <div class="container-fluid">
<div class="row">
<div class="col-md-3"> -->
<input type="checkbox" id="mobile-bars-check" />
<label for="mobile-bars-check" id="mobile-bars">
<div class="stix" id="stik1"></div>
<div class="stix" id="stik2"></div>
<div class="stix" id="stik3"></div>
</label>
<?php include('fragments/sidebar.php'); ?>
<!-- <select>
<option selected="selected" disabled="disabled">Overview</option>
<option value="0">Mentors</option>
<option value="1">Users</option>
</select>
<a href="#">Advanced</a> -->
<table class="mentor-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="expertise">Area Of Expertise</th>
<th data-heading="photo">Photo</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone</th>
<th data-heading="cv">Link To Cv</th>
<th data-heading="Interest">Why Interested</th>
<th data-heading="state">Current State</th>
<th data-heading="employment-status">Employment Status</th>
<th data-heading="timeStamp">Timestamp</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displaymActive;
?>
</tbody>
</table>
<table class="mentor-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="expertise">Area Of Expertise</th>
<th data-heading="photo">Photo</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone</th>
<th data-heading="cv">Link To Cv</th>
<th data-heading="Interest">Why Interested</th>
<th data-heading="state">Current State</th>
<th data-heading="employment-status">Employment Status</th>
<th data-heading="timeStamp">Timestamp</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displaymPending;
?>
</tbody>
</table>
<table class="mentor-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="expertise">Area Of Expertise</th>
<th data-heading="photo">Photo</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone</th>
<th data-heading="cv">Link To Cv</th>
<th data-heading="Interest">Why Interested</th>
<th data-heading="state">Current State</th>
<th data-heading="employment-status">Employment Status</th>
<th data-heading="timeStamp">Timestamp</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displaymDeclined;
?>
</tbody>
</table>
<table class="intern-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone No</th>
<th data-heading="cv">CV</th>
<th data-heading="experience">Experience</th>
<th data-heading="interest">Interest</th>
<th data-heading="location">Location</th>
<th data-heading="employmentStatus">Employment Status</th>
<th data-heading="about">About</th>
<th data-heading="timeStamp">Registration Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displayiActive;
?>
</tbody>
</table>
<table class="intern-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone No</th>
<th data-heading="cv">CV</th>
<th data-heading="experience">Experience</th>
<th data-heading="interest">Interest</th>
<th data-heading="location">Location</th>
<th data-heading="employmentStatus">Employment Status</th>
<th data-heading="about">About</th>
<th data-heading="timeStamp">Registration Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displayiPending;
?>
</tbody>
</table>
<table class="intern-table">
<thead>
<tr>
<th data-heading="sn">SN</th>
<th data-heading="name">Name</th>
<th data-heading="email">Email</th>
<th data-heading="phone">Phone No</th>
<th data-heading="cv">CV</th>
<th data-heading="experience">Experience</th>
<th data-heading="interest">Interest</th>
<th data-heading="location">Location</th>
<th data-heading="employmentStatus">Employment Status</th>
<th data-heading="about">About</th>
<th data-heading="timeStamp">Registration Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
echo $displayiDeclined;
?>
</tbody>
</table>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/dashboard2910.js"></script>