-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_dashboard.php
More file actions
480 lines (434 loc) · 14.9 KB
/
admin_dashboard.php
File metadata and controls
480 lines (434 loc) · 14.9 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
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
<?php
session_start();
if (!isset($_SESSION['admin_id'])) {
header("Location: admin_login.php");
exit;
}
if (isset($_SESSION['admin_expire']) && time() > $_SESSION['admin_expire']) {
session_unset();
session_destroy();
header("Location: admin_login.php?msg=session_expired");
exit;
} else {
$_SESSION['admin_expire'] = time() + 3600;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - PMS</title>
<link rel="icon" type="image/png" href="assets/favicon.png">
<!-- Using Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap" rel="stylesheet">
<!-- FontAwesome for icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
/* Distinct Admin Theme matching admin_login pattern */
--bg-body: #2F3640;
--bg-white: #FFFFFF;
--header-blue: #273C75;
--btn-blue: #00A8FF;
--btn-green: #44BD32;
--btn-red: #E84118;
--text-dark: #333333;
--text-gray: #666666;
--border-light: #E0E0E0;
--font-main: 'Inter', sans-serif;
--font-serif: 'Merriweather', serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: var(--bg-body);
font-family: var(--font-main);
color: var(--text-dark);
min-height: 100vh;
display: flex;
padding: 20px;
gap: 20px;
}
/* LEFT SIDEBAR */
.sidebar {
width: 120px;
display: flex;
flex-direction: column;
gap: 15px;
flex-shrink: 0;
}
.profile-card {
background: var(--bg-white);
border-radius: 12px;
padding: 15px 10px;
display: flex;
flex-direction: column;
align-items: center;
box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.logo-flower {
color: var(--header-blue);
font-size: 32px;
margin-bottom: 10px;
}
.uni-badge {
background-color: var(--header-blue);
color: white;
font-size: 11px;
font-weight: 700;
padding: 6px 10px;
border-radius: 4px;
width: 100%;
text-align: center;
margin-bottom: 15px;
}
.avatar-container {
width: 80px;
height: 80px;
border-radius: 50%;
overflow: hidden;
border: 3px solid #e0e0e0;
margin-bottom: 15px;
}
.avatar-container img {
width: 100%;
height: 100%;
object-fit: cover;
}
.id-badge {
background-color: var(--text-dark);
color: white;
font-size: 11px;
font-weight: 700;
padding: 6px 10px;
border-radius: 4px;
width: 100%;
text-align: center;
}
.status-badge {
margin-top: 10px;
font-size: 10px;
font-weight: 700;
padding: 4px 8px;
border-radius: 12px;
background-color: #d1d8e0;
color: #2f3640;
text-align: center;
width: 100%;
text-transform: uppercase;
}
.menu-card {
background: var(--bg-white);
border-radius: 12px;
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.25);
margin-top: auto;
}
.menu-btn {
background-color: var(--btn-blue);
color: white;
border: none;
border-radius: 8px;
width: 100%;
padding: 15px 0;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
font-weight: 700;
font-size: 12px;
transition: background-color 0.2s;
}
.menu-btn i { font-size: 24px; }
.menu-btn:hover { background-color: #0097e6; }
.icon-row {
display: flex;
gap: 10px;
width: 100%;
justify-content: center;
}
.icon-btn {
color: var(--header-blue);
background: none;
border: none;
font-size: 18px;
cursor: pointer;
}
.logout-btn {
background-color: var(--btn-red);
color: white;
border: none;
border-radius: 6px;
width: 100%;
padding: 8px;
cursor: pointer;
font-weight: 600;
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
transition: background-color 0.2s;
}
.logout-btn:hover { background-color: #c23616; }
/* MAIN CONTENT AREA */
.main-content {
flex: 1;
background-color: var(--bg-white);
border-radius: 12px;
display: flex;
flex-direction: column;
box-shadow: 0 4px 25px rgba(0,0,0,0.3);
overflow: hidden;
position: relative;
}
/* Top Header */
.top-header {
text-align: center;
padding: 15px;
border-bottom: 2px solid var(--border-light);
margin: 0 20px;
}
.top-header h1 {
font-family: var(--font-serif);
font-size: 20px;
color: var(--header-blue);
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
/* Top Bar Actions */
.top-actions {
background-color: #F8F9FA;
margin: 20px;
padding: 15px;
border-radius: 8px;
border: 1px solid #EAEAEA;
display: flex;
justify-content: center;
gap: 15px;
}
.action-btn {
padding: 8px 24px;
border: none;
border-radius: 4px;
color: white;
font-weight: 600;
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: opacity 0.2s, transform 0.1s;
}
.action-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-blue { background-color: var(--header-blue); }
.btn-green { background-color: var(--btn-green); }
/* Dashboard Grid Layout */
.dashboard-container {
background-color: #f5f6fa;
margin: 0 20px 20px 20px;
padding: 20px;
border-radius: 8px;
border: 1px solid #dcdde1;
flex: 1;
overflow-y: auto;
}
.grid-layout {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 20px;
align-items: start;
}
/* Module Sections */
.module-section {
background: white;
border: 1px solid var(--border-light);
border-radius: 4px;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.module-header {
background-color: var(--header-blue);
color: white;
padding: 10px 15px;
font-size: 14px;
font-weight: 600;
display: flex;
justify-content: space-between;
align-items: center;
}
.module-list {
list-style: none;
}
.module-list li {
border-bottom: 1px solid var(--border-light);
transition: background-color 0.2s;
}
.module-list li:last-child {
border-bottom: none;
}
.module-list a {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 15px;
color: #555;
text-decoration: none;
font-size: 13px;
font-weight: 500;
}
.module-list a:hover {
background-color: #f5f6fa;
color: var(--btn-blue);
padding-left: 18px; /* slight indent animation */
transition: all 0.2s ease;
}
.status-pill {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
background: #e1e7f0;
color: #273c75;
font-weight: bold;
}
.status-pill.warning { background: #ffeaa7; color: #d35400; }
.status-pill.danger { background: #ff7675; color: white; }
/* Footer */
.footer {
margin-top: auto;
text-align: center;
padding: 15px;
font-size: 12px;
color: #777;
border-top: 1px solid #eee;
background: white;
}
@media (max-width: 768px) {
body {
flex-direction: column;
}
.sidebar {
width: 100%;
flex-direction: row;
justify-content: center;
}
.profile-card, .menu-card {
flex: 1;
margin-top: 0;
}
}
</style>
</head>
<body>
<!-- LEFT SIDEBAR -->
<div class="sidebar">
<!-- Profile Card -->
<div class="profile-card">
<img src="assets/favicon.png" alt="Logo" class="logo-flower" style="width: 48px; height: 48px; object-fit: contain;">
<div class="uni-badge">XIM - ADMIN</div>
<div class="avatar-container">
<img src="assets/admin.jpg" alt="Admin Avatar">
</div>
<div class="id-badge"><?= htmlspecialchars($_SESSION['admin_id']) ?></div>
<div class="status-badge"><?= htmlspecialchars($_SESSION['admin_role']) ?></div>
</div>
<!-- Menu Actions Card -->
<div class="menu-card">
<button class="menu-btn" onclick="location.href='admin_dashboard.php'">
<i class="fa-solid fa-chart-line"></i>
DASHBOARD
</button>
<button class="logout-btn" onclick="location.href='logout_admin.php'">
<i class="fa-solid fa-arrow-right-from-bracket"></i> Logout
</button>
</div>
</div>
<!-- MAIN CONTENT -->
<div class="main-content">
<div class="top-header">
<h1>Placement Administrator Portal <i class="fa-solid fa-shield-halved"></i></h1>
</div>
<div class="top-actions">
<!-- Representing Quick Actions -->
<button class="action-btn btn-blue" onclick="alert('Quick action: Sync Student DB')">
<i class="fa-solid fa-users-arrows-right-left"></i> Sync Users
</button>
<button class="action-btn btn-green" onclick="alert('Quick action: View Realtime Analytics')">
<i class="fa-solid fa-magnifying-glass-chart"></i> Placement Analytics
</button>
</div>
<div class="dashboard-container">
<div class="grid-layout">
<!-- Entity Management -->
<div class="module-section">
<div class="module-header">
Student Entities
<i class="fa-solid fa-user-graduate"></i>
</div>
<ul class="module-list">
<li><a href="admin_students.php">1. Manage Students & CGPA <span class="status-pill warning">W/ Alerts</span></a></li>
</ul>
<div class="module-header" style="margin-top: 15px;">
Company Entities
<i class="fa-solid fa-briefcase"></i>
</div>
<ul class="module-list">
<li><a href="admin_companies.php">2. Manage Companies (Active/Blacklist)</a></li>
</ul>
</div>
<!-- Openings & Applications -->
<div class="module-section">
<div class="module-header">
Jobs & Drives (Openings)
<i class="fa-solid fa-clipboard-list"></i>
</div>
<ul class="module-list">
<li><a href="admin_jobs.php">3. Manage Job State (Create/Close/Cancel) <span class="status-pill warning">Cascade</span></a></li>
</ul>
<div class="module-header" style="margin-top: 15px;">
Application Processing
<i class="fa-solid fa-file-signature"></i>
</div>
<ul class="module-list">
<li><a href="admin_applications.php">4. Process Pool (Select/Reject)</a></li>
</ul>
</div>
<!-- Placements & Audit -->
<div class="module-section">
<div class="module-header">
Placement Finalization
<i class="fa-solid fa-award"></i>
</div>
<ul class="module-list">
<li><a href="admin_placements.php">5. Create from Selection / Revoke <span class="status-pill">Req: Selected</span></a></li>
</ul>
<div class="module-header" style="margin-top: 15px;">
System Logs & Audit
<i class="fa-solid fa-server"></i>
</div>
<ul class="module-list">
<li><a href="admin_audit.php">6. Global Audit Logs (Immutable)</a></li>
</ul>
</div>
</div>
</div>
<div class="footer">
Admin Portal Connected • <?= htmlspecialchars($_SESSION['admin_name']) ?> • Time: <?= date('H:i:s', $_SESSION['admin_login_time']) ?> • Immutable Tables Locked
</div>
</div>
</body>
</html>