-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin_dashboard.php
732 lines (689 loc) · 37.9 KB
/
admin_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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
<?php
session_start();
ob_start();
$location = '';
$pageTitle = 'Admin Dashboard';
global $db_location;
global $cnxn;
global $viewingID;
// Log user out if idle time or logged in time is past max
include 'php/roles/timeout_check.php';
// Logout and return to login.php if ?logout=true
include 'php/roles/logout_check.php';
// Ensure a user is logged in
include 'php/roles/user_check.php';
// Ensure an admin is logged in
include 'php/roles/admin_check.php';
include 'header.php';
include 'php/nav_bar.php';
include 'db_picker.php';
include $db_location;
$appWasDeleted = false;
$userWasDeleted = false;
$userWasUnDeleted = false;
$announceWasDeleted = false;
$defaultUserPass = "pass3051";
$defaultAdminPass = "dfly3051";
// soft deletes a database entry
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if($_POST["submit-from"] == 1) {
$id = $_POST["id"];
$sqlDeleteApp = "UPDATE applications SET is_deleted = 1 WHERE application_id = $id";
$appWasDeleted = true;
$deleteAppResult = @mysqli_query($cnxn, $sqlDeleteApp);
} elseif ($_POST["submit-from"] == 2) {
// Ensure a user is logged in
include 'php/roles/user_check.php';
// Ensure an admin is logged in
include 'php/roles/admin_check.php';
$id = $_POST["id"];
$operation = $_POST["operation"] === '1' ? 1 : 0; // 1 for delete, 0 for undo-delete
$sqlDeleteUser = "UPDATE users SET is_deleted = $operation WHERE user_id = $id";
$userWasDeleted = $operation === 1;
$userWasUnDeleted = $operation === 0;
$deleteUserResult = @mysqli_query($cnxn, $sqlDeleteUser);
}else if($_POST["submit-from"] == 3) {
// Ensure a user is logged in
include 'php/roles/user_check.php';
// Ensure an admin is logged in
include 'php/roles/admin_check.php';
$id = $_POST["id"];
$perm = $_POST["perm"];
$sqlMakeUserAdmin = "UPDATE users SET permission = $perm WHERE user_id = $id";
$makeAdminResult = @mysqli_query($cnxn, $sqlMakeUserAdmin);
}else if($_POST["submit-from"] == 4) {
// Ensure a user is logged in
include 'php/roles/user_check.php';
// Ensure an admin is logged in
include 'php/roles/admin_check.php';
$announceID = $_POST["announcement-id"];
$sqlDeleteAnnouncement = "UPDATE announcements SET is_deleted = 1 WHERE announcement_id = $announceID";
$deletedAnnouncementResult = @mysqli_query($cnxn, $sqlDeleteAnnouncement);
$announceWasDeleted = true;
}
}
$role = 1;
// fetches specific data from database tables
// $sqlApps = "SELECT * FROM applications WHERE is_deleted = 0 ORDER BY application_id DESC";
$sqlApps = "SELECT * FROM `applications` JOIN `users` WHERE `applications`.`user_id` = `users`.`user_id` AND
`applications`.is_deleted = 0 AND `users`.is_deleted = 0";
$sqlAnnounce = "SELECT * FROM announcements WHERE is_deleted = 0 ORDER BY date_created DESC"; // 5 most recent announcements
$sqlUsers = "SELECT * FROM users"; // 5 users (deleted users get filtered out in dash-users.js so admin can see deleted too)
$appsResult = @mysqli_query($cnxn, $sqlApps);
$announceResult = @mysqli_query($cnxn, $sqlAnnounce);
$usersResult = @mysqli_query($cnxn, $sqlUsers);
// Fill in apps array
$myApps[] = [];
$allUsers[] = [];
$allAnnouncements[] = [];
$appCount = 0;
while ($row = mysqli_fetch_assoc($appsResult)) {
$myApps[$appCount] = $row;
$appCount++;
}
$userCount = 0;
while ($row = mysqli_fetch_assoc($usersResult)) {
$allUsers[$userCount] = $row;
$userCount++;
}
$announceCount = 0;
while ($row = mysqli_fetch_assoc($announceResult)){
$allAnnouncements[$announceCount] = $row;
$announceCount++;
}
?>
<main>
<div class="container p-3 position-relative" id="main-container">
<div id="toastContainer" class="position-absolute start-50 top-0 translate-middle-x mt-3 alert-hide">
<p class="pt-2 px-5" id="toastText"></p>
</div>
<div class="row dashboard-top">
<div class="app-list-admin">
<h3>Recent Applications</h3>
<div class="row">
<div class="col-sm-6 pt-2">
<div class="input-group input-group-sm">
<span class="input-group-text">Start Date</span>
<input type="date" class="form-control date-input" id="app-start-date" name="search-start-date">
</div>
</div>
<div class="col-sm-6 pt-2">
<div class="input-group input-group-sm">
<span class="input-group-text">End Date</span>
<input type="date" class="form-control date-input" id="app-end-date" name="search-end-date">
</div>
</div>
</div>
<div class="row">
<div class="col py-2">
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1">
<i class="fa-solid fa-magnifying-glass"></i>
</span>
<input id="app-search-bar" type="text" class="form-control" placeholder="Search" aria-label="Search" aria-describedby="basic-addon1">
</div>
</div>
</div>
<!-- start of app table -->
<table class="dash-table admin-app">
<thead class="table-head">
<tr>
<th scope="col" class="app-date-col">
<div class="row clickable" id="date-order-btn">
<div class="col-auto pe-0 my-auto">
Date
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<i class="fa-solid fa-sort" id="date-field-icon"></i>
</div>
</div>
</div>
</th>
<th scope="col" class="app-job-col">
<div class="row clickable" id="job-order-btn">
<div class="col-auto pe-0 my-auto">
Job Title
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="job-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="app-employer-col">
<div class="row clickable" id="employer-order-btn">
<div class="col-auto pe-0 my-auto">
Employer
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="employer-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="app-url-col">
<div class="row">
<div class="col-auto pe-0 my-auto">
URL
</div>
</div>
</th>
</tr>
</thead>
<tbody class="table-body" id="dash-apps-list">
<!-- List gets populated with applications from the database here with dash-apps.js -->
</tbody>
</table>
<div class="col text-center pt-2 pb-2 hidden" id="more-apps">
<button type='button' class='btn-more-apps py-2 my-3' onclick='loadMoreApps()'>
<i class='fa-solid fa-plus pe-2'></i><a>Load More</a>
</button>
</div>
</div>
</div>
<div class="row dashboard-top">
<div class="announcements-list pt-4">
<h3>Announcements</h3>
<div class="row">
<div class="col-md-4 col-sm-6 pt-2">
<div class="input-group input-group-sm">
<span class="input-group-text">Start Date</span>
<input type="date" class="form-control date-input" id="announce-start-date" name="announce-search-start-date">
</div>
</div>
<div class="col-md-4 col-sm-6 pt-2">
<div class="input-group input-group-sm">
<span class="input-group-text">End Date</span>
<input type="date" class="form-control date-input" id="announce-end-date" name="announce-search-end-date">
</div>
</div>
<div class="col-md-4 text-end pt-2">
<div class="input-group input-group-sm">
<span class="input-group-text">Job Type</span>
<select class="form-select job-type-select" id="announce-job-type-select">
<option selected value="both">Both</option>
<option value="job">Job</option>
<option value="internship">Internship</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col py-2">
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1">
<i class="fa-solid fa-magnifying-glass"></i>
</span>
<input id="announce-search-bar" type="text" class="form-control" placeholder="Search" aria-label="Search" aria-describedby="basic-addon1">
</div>
</div>
</div>
<table class="dash-table admin-announcement">
<thead class="table-head">
<tr>
<th scope="col" class="announce-date-col">
<div class="row clickable" id="announce-date-order-btn">
<div class="col-auto pe-0 my-auto">
Date
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="announce-date-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="announce-position-col">
<div class="row clickable" id="announce-title-order-btn">
<div class="col-auto pe-0 my-auto">
Position
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="announce-title-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="announce-employer-col">
<div class="row clickable" id="announce-employer-order-btn">
<div class="col-auto pe-0 my-auto">
Employer
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="announce-employer-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="announce-job-type-col">
<div class="row clickable" id="announce-job-type-order-btn">
<div class="col-auto pe-0 my-auto">
Job Type
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="announce-job-type-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="announce-url-col">URL</th>
<th scope="col" class="w-btn"></th>
</tr>
</thead>
<tbody id="dash-announcements-list">
<!-- List gets populated with announcements from the database here with dash-announcements.js -->
</tbody>
</table>
</div>
</div>
<div class="row dashboard-top">
<div class="user-list pt-4">
<div class="row">
<div class="col">
<h3>Users</h3>
</div>
</div>
<div class="row">
<div class="col-md-5 py-2">
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1">
<i class="fa-solid fa-magnifying-glass"></i>
</span>
<input id="users-search-bar" type="text" class="form-control" placeholder="Search" aria-label="Search" aria-describedby="User Search Bar">
</div>
</div>
<div class="col-md-7 py-2">
<div class="row">
<div class="col-8 ">
<div class="input-group">
<span class="input-group-text">Status</span>
<select class="form-select" id="user-status-select">
<option selected value="any">Any</option>
<option value="Seeking Job">Seeking Job</option>
<option value="Seeking Internship">Seeking Internship</option>
<option value="Not Actively Searching">Not Actively Searching</option>
</select>
</div>
</div>
<div class="col-4">
<div class="form-check form-check-reverse pt-1">
<input class="form-check-input pt-1" type="checkbox" value="" id="user-deleted-check">
<label class="form-check-label pe-1" for="user-deleted-check" id="user-deleted-label">
Include Deleted Users?
</label>
</div>
</div>
</div>
</div>
</div>
<table class="dash-table admin-user">
<thead class="table-head">
<tr>
<th scope="col" class="user-role-col">
<div class="row clickable" id="user-role-order-btn">
<div class="col-auto pe-0 my-auto">
Role
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="user-role-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="user-name-col">
<div class="row clickable" id="user-name-order-btn">
<div class="col-auto pe-0 my-auto">
Name
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="user-name-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="user-email-col">
<div class="row clickable" id="user-email-order-btn">
<div class="col-auto pe-0 my-auto">
Email
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="user-email-field-icon"></i>
</div>
</div>
</div>
</div>
</th><th scope="col" class="user-status-col">
<div class="row clickable" id="user-status-order-btn">
<div class="col-auto pe-0 my-auto">
Status
</div>
<div class="col-auto ps-2 my-auto">
<div class="order-icons">
<div class="order-icons">
<i class="fa-solid fa-sort" id="user-status-field-icon"></i>
</div>
</div>
</div>
</div>
</th>
<th scope="col" class="user-buttons-col"></th>
</tr>
</thead>
<tbody id="dash-users-list">
<!-- List gets populated with users from the database here with dash-users.js -->
</tbody>
</table>
<!-- <p class="title mx-auto" style="display: block; width:100px; color: green">More</p>-->
</div>
</div>
<div class="row welcome-info">
<hr>
<p>Welcome to the Green River College Software Development Application Tracking Tool (ATT). The purpose of this tool is to provide a centralized place to track your job/internship applications that can be helpful in your application journey! </p>
<hr>
</div>
<div class="row text-wrap">
<div class="software-dev-img col-3">
<img src="images/it-software-dev.jpg" alt="5" class="img-fluid col-3" style="width: 500px">
</div>
<div class="about-program col-9">
<h5>About Our Program</h5>
<p>Prepare for an exciting career in tech with a Bachelor of Applied Science in Software Development. Affordable tuition, instructors who care, access to tech industry mentors, and project-based learning make our applied bachelor’s program a popular destination for computing majors throughout the Seattle-Tacoma region. This degree prepares graduates for high-demand jobs such as software developer, web developer, software developer in test, and quality assurance (QA) analyst. Learn more at <a class="link" href="https://www.greenriver.edu/students/academics/degrees-programs/bachelor-of-applied-science/bachelors-in-software-development/">GreenRiver.edu</a></p>
</div>
</div>
<!--------------------------------------- MODALS -------------------------------------------------->
<!-- Edit App Modal -->
<div class='modal fade' id='edit-modal' tabIndex='-1' role='dialog' aria-labelledby='job-title' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h3 class='modal-title' id='job-title'>Application Details</h3>
<button type='button' class='modal-close-primary close' data-bs-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>×</span>
</div>
<div class='modal-body'>
<ul class='list-group-item'>
<li class='list-group-item pb-1'>
<span class='form-label'>User: </span>
<span id="edit-modal-user"></span>
</li>
<li class='list-group-item pb-3'>
<span class='form-label'>Email: </span>
<span id="edit-modal-email"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Job Name: </span>
<span id="edit-modal-jname"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Employer Name: </span>
<span id="edit-modal-ename"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>URL:</span>
<a id="edit-modal-url" href="" target="_blank" rel="noopener noreferrer">Application Link</a>
</li>
<li class='list-group-item'>
<span class='form-label'>Job Description: </span>
<p id="edit-modal-description" style="margin: 0"></p>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Application date: </span>
<span id="edit-modal-adate"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Status: </span>
<span id="edit-modal-astatus-icon" class="status">
<i class='fa-solid fa-circle'></i>
</span>
<span id="edit-modal-astatus" style="text-transform: capitalize"></span>
</li>
<li class='list-group-item'>
<span class='form-label'>Followup date: </span>
<span id="edit-modal-fdate"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Followup updates: </span>
<p id="edit-modal-updates" style="margin: 0"></p>
</li>
</ul>
</div>
<div class='modal-footer'>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Close</button>
<form method="post" action="application_edit.php" target="_blank">
<input id="edit-modal-appid" type="hidden" name="application-id" value="">
<button type="submit" class="modal-edit">Edit</button>
</form>
</div>
</div>
</div>
</div>
<!-- Edit User Modal -->
<div class='modal fade' id='user-edit-modal' tabIndex='-1' role='dialog' aria-labelledby='job-title' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h3 class='modal-title' id='job-title'>User Details</h3>
<button type='button' class='modal-close-primary close' data-bs-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>×</span>
</div>
<div class='modal-body'>
<ul class='list-group-item'>
<li class='list-group-item pb-1'>
<span class='form-label'>Permission: </span>
<span id="user-edit-modal-permission"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Deleted: </span>
<span id="user-edit-modal-deleted"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>First Name: </span>
<span id="user-edit-modal-fname"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Last Name: </span>
<span id="user-edit-modal-lname"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Email: </span>
<span id="user-edit-modal-email"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Password: </span>
<span id="user-edit-modal-password"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Cohort Number: </span>
<span id="user-edit-modal-cohort"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Job Status: </span>
<span id="user-edit-modal-job-status"></span>
</li>
<li class='list-group-item'>
<span class='form-label'>Desired Roles: </span>
<p id="user-edit-modal-roles" style="margin: 0"></p>
</li>
</ul>
</div>
<div class='modal-footer'>
<button type='button' id="user-edit-modal-admin" class="btn btn-make-admin" data-bs-dismiss='modal'></button>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Close</button>
<form method="post" action="user_edit.php" target="_blank">
<input id="edit-modal-user-id" type="hidden" name="user_id" value="">
<button type="submit" class="modal-edit">Edit</button>
</form>
</div>
</div>
</div>
</div>
<!-- User Delete Modal -->
<div class='modal fade' id='user-delete-modal' tabindex='-1' role='dialog' aria-labelledby='delete-app-message' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='delete-warning'>Delete User?</h4>
</div>
<div class='modal-body'>
<p>Are you sure you want to delete <span id="user-delete-modal-name"></span>? Deleted users can be recovered later.</p>
</div>
<div class='modal-footer'>
<form method='POST' action='#'>
<input type='hidden' value='2' name='submit-from'>
<input type='hidden' id="delete-user-id" value='' name='id'>
<input type='hidden' value='1' name='operation'>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Cancel</button>
<button type='submit' class='modal-delete'>Delete User</button>
</form>
</div>
</div>
</div>
</div>
<!-- User Undo Delete Modal -->
<div class='modal fade' id='user-undo-delete-modal' tabindex='-1' role='dialog' aria-labelledby='delete-app-message' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='undo-delete-warning'>Undo Delete??</h4>
</div>
<div class='modal-body'>
<p>Are you sure you want to bring back <span id="user-undo-delete-modal-name"></span>?</p>
</div>
<div class='modal-footer'>
<form method='POST' action='#'>
<input type='hidden' value='2' name='submit-from'>
<input type='hidden' id="undo-delete-user-id" value='' name='id'>
<input type='hidden' value='0' name='operation'>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Cancel</button>
<button type='submit' class='modal-undo-delete'>Undo Delete</button>
</form>
</div>
</div>
</div>
</div>
<!-- Toggle User Admin Modal -->
<div class='modal fade' id='toggle-admin-modal' tabindex='-1' role='dialog' aria-labelledby='make-admin-message' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='toggle-admin-title'>Make Admin?</h4>
</div>
<div class='modal-body'>
<p><span id="toggle-admin-modal-name"></span></p>
</div>
<div class='modal-footer'>
<form method='POST' action='#'>
<input type='hidden' value='3' name='submit-from'>
<input type='hidden' id="toggle-admin-user-id" value='' name='id'>
<input type='hidden' id="toggle-admin-user-perm" value='' name='perm'>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Cancel</button>
<button type='submit' class='modal-delete' id='toggle-admin-btn'>Make Admin</button>
</form>
</div>
</div>
</div>
</div>
<!-- View Announcement Modal -->
<div class='modal fade' id='view-announcement-modal' tabindex='-1' role='dialog' aria-labelledby='view-announcement' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h5 class='modal-title' id='view-announce-title'>$title</h5>
<button type='button' class='modal-close-primary close' data-bs-dismiss='modal' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
</div>
<div class='modal-body'>
<ul class='list-group-item'>
<li class='list-group-item pb-1'>
<span class='form-label'>Company: </span><span id="view-announce-employer"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>Address: </span><span id="view-announce-address"></span>
</li>
<li class='list-group-item pb-1'>
<span class='form-label'>URL: </span>
<a id="view-announce-jurl" href='' target='_blank'>Apply Here</a>
</li>
<li class='list-group-item'>
<span class='form-label'>More Information: </span><span id="view-announce-info"></span>
</li>
</ul>
</div>
<div class='modal-footer'>
<button type='button' class='modal-delete' data-bs-dismiss='modal'>Close</button>
</div>
</div>
</div>
</div>
<!-- Announcement Delete Modal -->
<div class='modal fade' id='delete-announcement-modal' tabindex='-1' role='dialog' aria-labelledby='delete-announce' aria-hidden='true'>
<div class='modal-dialog modal-dialog-centered' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title' id='delete-warning'>Delete Announcement?</h4>
</div>
<div class='modal-body'>
<p>Are you sure you want to delete announcement for <span id="delete-announce-title"></span>?</p>
</div>
<div class='modal-footer'>
<form method='POST' action='#'>
<input type='hidden' value='4' name='submit-from'>
<input type='hidden' id='delete-announcement-id' value='' name='announcement-id'>
<button type='button' class='modal-close-secondary' data-bs-dismiss='modal'>Cancel</button>
<button type='submit' class='modal-delete'>Delete</button>
</form>
</div>
</div>
</div>
</div>
</main>
<?php include 'php/footer.php' ?>
<script>
const results = {
myApps : <?php echo json_encode($myApps) ?>,
myAnnouncements : [],
myAppReminders : [],
allAnnouncements : [<?php echo json_encode($allAnnouncements) ?>],
role : <?php echo $role ?>,
allUsers : <?php echo json_encode($allUsers) ?>,
userID : <?php echo $viewingID ?>,
appWasDeleted : <?php echo json_encode($appWasDeleted) ?>,
userWasDeleted : <?php echo json_encode($userWasDeleted) ?>,
userWasUnDeleted : <?php echo json_encode($userWasUnDeleted) ?>,
announceWasDeleted : <?php echo json_encode($announceWasDeleted) ?>
}
</script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="js/dash-functions.js"></script>
<script src="js/dash-apps.js"></script>
<script src="js/dash-users.js"></script>
<script src="js/dash-announcements.js"></script>
</body>
</html>