-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdash
More file actions
814 lines (716 loc) · 39.4 KB
/
dash
File metadata and controls
814 lines (716 loc) · 39.4 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
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
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CertiTrust — Login</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet">
<style>
:root {
--brand: #FF5800;
--bg: #f5f7fa;
--card: #ffffff;
--muted: #6b7280;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
/* Login Page Styles */
.login-container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
overflow: hidden;
width: 100%;
max-width: 1200px;
min-height: 700px;
display: flex;
}
.login-left {
flex: 1;
background: linear-gradient(135deg, var(--brand) 0%, #ff8a4c 100%);
padding: 60px 40px;
color: white;
display: flex;
flex-direction: column;
justify-content: center;
}
.login-right {
flex: 1.2;
padding: 60px 40px;
display: flex;
flex-direction: column;
justify-content: center;
}
.brand-logo {
display: flex;
align-items: center;
gap: 15px;
margin-bottom: 30px;
}
.logo-circle {
width: 70px;
height: 70px;
background: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: var(--brand);
font-weight: 900;
font-size: 28px;
}
.brand-text h1 {
font-size: 32px;
margin: 0;
font-weight: 800;
}
.brand-text .tagline {
font-size: 14px;
opacity: 0.9;
margin-top: 5px;
}
.login-left h2 {
font-size: 28px;
margin: 30px 0 15px;
font-weight: 700;
}
.login-left p {
font-size: 16px;
line-height: 1.6;
opacity: 0.9;
}
.login-right h2 {
color: #333;
margin-bottom: 10px;
font-weight: 600;
}
.login-right > p {
color: var(--muted);
margin-bottom: 30px;
}
.form-group {
margin-bottom: 25px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #555;
font-weight: 500;
font-size: 14px;
}
.form-control {
width: 100%;
padding: 14px 16px;
border: 2px solid #e1e5eb;
border-radius: 10px;
font-size: 16px;
transition: all 0.3s;
background: #f8f9fa;
}
.form-control:focus {
outline: none;
border-color: var(--brand);
background: white;
box-shadow: 0 0 0 3px rgba(255, 88, 0, 0.1);
}
select.form-control {
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
background-size: 16px;
padding-right: 40px;
}
.btn-login {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, var(--brand) 0%, #ff8a4c 100%);
color: white;
border: none;
border-radius: 10px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
margin-top: 10px;
}
.btn-login:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(255, 88, 0, 0.2);
}
.btn-login:active {
transform: translateY(0);
}
.login-footer {
margin-top: 30px;
text-align: center;
padding-top: 20px;
border-top: 1px solid #eee;
}
.login-footer p {
color: var(--muted);
font-size: 14px;
margin: 5px 0;
}
.login-footer a {
color: var(--brand);
text-decoration: none;
font-weight: 500;
}
.login-footer a:hover {
text-decoration: underline;
}
.error-message {
color: #dc3545;
font-size: 14px;
margin-top: 5px;
display: none;
}
/* Admin Panel (initially hidden) */
.admin-panel {
display: none;
width: 100%;
min-height: 100vh;
background: var(--bg);
}
/* Responsive */
@media (max-width: 992px) {
.login-container {
flex-direction: column;
max-width: 500px;
}
.login-left, .login-right {
padding: 40px 30px;
}
}
@media (max-width: 576px) {
body {
padding: 10px;
}
.login-left, .login-right {
padding: 30px 20px;
}
.brand-text h1 {
font-size: 24px;
}
}
</style>
</head>
<body>
<!-- Login Page -->
<div class="login-container" id="loginPage">
<div class="login-left">
<div class="brand-logo">
<div class="logo-circle">CT</div>
<div class="brand-text">
<h1>CertiTrust</h1>
<div class="tagline">Secure. Verify. Trust.</div>
</div>
</div>
<h2>Authorized Institutes Only</h2>
<p>Access the admin panel to manage certificates, verify authenticity, and maintain secure records for your institution.</p>
<div style="margin-top: 40px;">
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 15px;">
<i class="bi bi-shield-check" style="font-size: 20px;"></i>
<span>Secure Certificate Management</span>
</div>
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 15px;">
<i class="bi bi-file-check" style="font-size: 20px;"></i>
<span>Instant Verification System</span>
</div>
<div style="display: flex; align-items: center; gap: 10px;">
<i class="bi bi-graph-up" style="font-size: 20px;"></i>
<span>Analytics & Insights</span>
</div>
</div>
</div>
<div class="login-right">
<h2>Login to Admin Panel</h2>
<p>Enter your credentials to access the certificate management system</p>
<form id="loginForm">
<div class="form-group">
<label for="institution">Institution Name</label>
<select class="form-control" id="institution" required>
<option value="" disabled selected>Select your institution</option>
<option value="Ranchi University">Ranchi University - State University (Public)</option>
<option value="Sido Kanhu Murmu University">Sido Kanhu Murmu University - State University (Public)</option>
<option value="BIT Mesra">BIT Mesra - Deemed University (Private)</option>
<option value="IIT Dhanbad">Indian Institute of Technology Dhanbad - IIT (Public)</option>
<option value="NIT Jamshedpur">National Institute of Technology Jamshedpur - NIT (Public)</option>
<option value="St. Xavier's College Ranchi">St. Xavier's College Ranchi - Autonomous College (Private)</option>
<option value="Marwari College Ranchi">Marwari College Ranchi - Affiliated College (Private)</option>
<option value="Gossner College Ranchi">Gossner College Ranchi - Affiliated College (Private)</option>
<option value="DAV College Jamshedpur">DAV College Jamshedpur - Affiliated College (Private)</option>
<option value="Vinoba Bhave University">Vinoba Bhave University - State University (Public)</option>
<option value="Kolhan University">Kolhan University - State University (Public)</option>
<option value="Nilamber-Pitamber University">Nilamber-Pitamber University - State University (Public)</option>
<option value="Jamshedpur Cooperative College">Jamshedpur Cooperative College - Affiliated College (Private)</option>
<option value="Karim City College">Karim City College Jamshedpur - Affiliated College (Private)</option>
<option value="Dumka Medical College">Dumka Medical College - Government Medical College (Public)</option>
<option value="Rajendra Institute of Medical Sciences">Rajendra Institute of Medical Sciences - Government Medical College (Public)</option>
<option value="BIT Patna">Birla Institute of Technology Patna - Deemed University (Private)</option>
<option value="Patna University">Patna University - State University (Public)</option>
<option value="Magadh University">Magadh University - State University (Public)</option>
</select>
<div class="error-message" id="institutionError">Please select your institution</div>
</div>
<div class="form-group">
<label for="email">Official Email</label>
<input type="email" class="form-control" id="email" placeholder="admin@institution.edu.in" required>
<div class="error-message" id="emailError">Please enter a valid email address</div>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" placeholder="Enter your password" required>
<div class="error-message" id="passwordError">Please enter your password</div>
</div>
<button type="submit" class="btn-login">Login</button>
<div class="login-footer">
<p>Don't have an account? <a href="#" id="partnerLink">Partner with CertiTrust</a></p>
<p>© 2025 CertiTrust — Built for Smart India Hackathon</p>
</div>
</form>
</div>
</div>
<!-- Admin Panel -->
<div class="admin-panel" id="adminPanel">
<!-- Admin panel HTML will be loaded here -->
</div>
<script>
// Simple and clean JavaScript without conflicts
document.addEventListener('DOMContentLoaded', function() {
// Get DOM elements
const loginPage = document.getElementById('loginPage');
const adminPanel = document.getElementById('adminPanel');
const loginForm = document.getElementById('loginForm');
const partnerLink = document.getElementById('partnerLink');
// Error elements
const institutionError = document.getElementById('institutionError');
const emailError = document.getElementById('emailError');
const passwordError = document.getElementById('passwordError');
// Form inputs
const institutionSelect = document.getElementById('institution');
const emailInput = document.getElementById('email');
const passwordInput = document.getElementById('password');
// Hide all error messages initially
function hideAllErrors() {
institutionError.style.display = 'none';
emailError.style.display = 'none';
passwordError.style.display = 'none';
}
// Validate email format
function isValidEmail(email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}
// Handle form submission
loginForm.addEventListener('submit', function(e) {
e.preventDefault();
// Reset errors
hideAllErrors();
let isValid = true;
// Validate institution
if (!institutionSelect.value) {
institutionError.style.display = 'block';
isValid = false;
}
// Validate email
if (!emailInput.value.trim()) {
emailError.textContent = 'Please enter your email address';
emailError.style.display = 'block';
isValid = false;
} else if (!isValidEmail(emailInput.value.trim())) {
emailError.textContent = 'Please enter a valid email address';
emailError.style.display = 'block';
isValid = false;
}
// Validate password
if (!passwordInput.value.trim()) {
passwordError.textContent = 'Please enter your password';
passwordError.style.display = 'block';
isValid = false;
} else if (passwordInput.value.trim().length < 6) {
passwordError.textContent = 'Password must be at least 6 characters';
passwordError.style.display = 'block';
isValid = false;
}
if (isValid) {
// For demo purposes, accept any valid login
// In a real application, this would validate against a backend
loginUser();
}
});
// Handle partner link click
partnerLink.addEventListener('click', function(e) {
e.preventDefault();
alert('To partner with CertiTrust, please contact:\n\nEmail: partnerships@certitrust.edu.in\nPhone: +91-XXX-XXXXXXX\n\nWe will get back to you within 24 hours.');
});
// Login function
function loginUser() {
const userData = {
institution: institutionSelect.value,
email: emailInput.value.trim(),
password: passwordInput.value.trim(),
loginTime: new Date().toLocaleString()
};
// Store user data in sessionStorage
sessionStorage.setItem('certitrust_user', JSON.stringify(userData));
// Show loading state
const submitBtn = loginForm.querySelector('.btn-login');
const originalText = submitBtn.textContent;
submitBtn.textContent = 'Logging in...';
submitBtn.disabled = true;
// Simulate API call delay
setTimeout(() => {
// Hide login page, show admin panel
loginPage.style.display = 'none';
// Load admin panel
loadAdminPanel(userData);
// Reset button
submitBtn.textContent = originalText;
submitBtn.disabled = false;
}, 1000);
}
// Load admin panel
function loadAdminPanel(userData) {
// Create admin panel structure
adminPanel.innerHTML = `
<div class="app">
<aside class="sidebar">
<div class="brand">
<div class="logo-panel">CT</div>
<div>
<h3 style="margin:0">CertiTrust</h3>
<div class="small-muted">${userData.institution}</div>
</div>
</div>
<nav class="nav">
<a href="#" class="nav-link active" data-target="dashboardPage"><i class="bi bi-speedometer2"></i> Dashboard</a>
<a href="#" class="nav-link" data-target="uploadPage"><i class="bi bi-upload"></i> Upload</a>
<a href="#" class="nav-link" data-target="studentDataPage"><i class="bi bi-folder2-open"></i> Records</a>
<a href="#" class="nav-link" data-target="insightsPage"><i class="bi bi-bar-chart-line"></i> Insights</a>
<a href="#" class="nav-link" data-target="bulkUploadPage"><i class="bi bi-cloud-upload"></i> Bulk Upload</a>
</nav>
<div style="margin-top:16px">
<button id="logoutBtn" class="btn btn-outline-danger w-100"><i class="bi bi-box-arrow-right"></i> Logout</button>
</div>
<div class="alerts" style="margin-top:20px;">
<h6>Recent Alerts</h6>
<div id="alertsList">
<div class="alert-item">
<i class="bi bi-exclamation-circle"></i>
<div>Welcome to CertiTrust Admin Panel</div>
</div>
</div>
</div>
<div class="footer small-muted" style="margin-top:20px">
© 2025 CertiTrust<br>Built for SIH
</div>
</aside>
<main class="main">
<div class="header">
<div>
<h1 style="margin:0;font-size:20px">Admin Dashboard</h1>
<div class="small-muted">Welcome — manage uploads & verification</div>
</div>
<div class="controls">
<div class="card" style="padding:8px 12px;border-radius:999px;display:flex;align-items:center;gap:10px">
<img src="https://ui-avatars.com/api/?name=${encodeURIComponent(userData.email)}&background=FF5800&color=fff" alt="avatar" style="width:34px;height:34px;border-radius:8px;object-fit:cover"/>
<div style="font-size:13px">${userData.email.split('@')[0]}</div>
</div>
</div>
</div>
<section id="dashboardPage" class="page card">
<div style="display:flex;gap:18px;flex-wrap:wrap;margin-bottom:20px">
<div style="flex:1;min-width:220px" class="card">
<div class="small-muted">Total Certificates</div>
<div style="font-size:28px;font-weight:700;margin-top:8px" id="statTotal">0</div>
<div class="small-muted" style="margin-top:6px">All uploaded certificates</div>
</div>
<div style="flex:1;min-width:220px" class="card">
<div class="small-muted">Unique Students</div>
<div style="font-size:28px;font-weight:700;margin-top:8px" id="statUnique">0</div>
<div class="small-muted" style="margin-top:6px">Unique roll numbers</div>
</div>
<div style="flex:1;min-width:220px" class="card">
<div class="small-muted">Most Uploaded Type</div>
<div style="font-size:28px;font-weight:700;margin-top:8px" id="statMost">-</div>
<div class="small-muted" style="margin-top:6px">Certificate type count</div>
</div>
</div>
<div class="card">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:15px">
<div>
<h3 style="margin:0">Quick Actions</h3>
<div class="small-muted">Manage certificates quickly</div>
</div>
</div>
<div style="display:flex;gap:10px;flex-wrap:wrap">
<button class="btn btn-brand" onclick="showPage('uploadPage')">
<i class="bi bi-upload"></i> Upload Certificates
</button>
<button class="btn btn-outline-secondary" onclick="showPage('studentDataPage')">
<i class="bi bi-eye"></i> View Records
</button>
<button class="btn btn-outline-secondary" onclick="showPage('insightsPage')">
<i class="bi bi-graph-up"></i> View Insights
</button>
<button class="btn btn-outline-secondary" onclick="showPage('bulkUploadPage')">
<i class="bi bi-cloud-upload"></i> Bulk Upload
</button>
</div>
</div>
</section>
<section id="uploadPage" class="page card" style="display:none">
<h3>Upload Certificates</h3>
<div class="small-muted mb-3">Select certificate files to upload</div>
<div class="upload-area card mb-3">
<div style="text-align:center;padding:40px 20px">
<i class="bi bi-cloud-upload" style="font-size:60px;color:#FF5800;margin-bottom:15px"></i>
<div class="small-muted">Drag & drop files here or click to browse</div>
<input type="file" id="fileInput" multiple style="display:none">
<button class="btn btn-outline-secondary mt-3" onclick="document.getElementById('fileInput').click()">
<i class="bi bi-folder2-open"></i> Browse Files
</button>
<div class="small-muted mt-2" style="font-size:12px">Supported formats: PDF, JPG, PNG, DOCX</div>
</div>
</div>
<div class="card">
<h5>Upload Instructions</h5>
<ul class="small-muted">
<li>Ensure files are named properly (Name_Roll_Type)</li>
<li>Maximum file size: 10MB per file</li>
<li>You can upload multiple files at once</li>
<li>System will generate unique SHA-256 hash for each certificate</li>
</ul>
</div>
</section>
<section id="studentDataPage" class="page card" style="display:none">
<h3>Student Records</h3>
<div class="small-muted mb-3">View and manage uploaded certificates</div>
<div class="card">
<div style="overflow-x:auto">
<table style="width:100%;border-collapse:collapse">
<thead style="background:#f8f9fa">
<tr>
<th style="padding:12px;text-align:left;border-bottom:1px solid #dee2e6">Student Name</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #dee2e6">Roll No</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #dee2e6">Certificate Type</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #dee2e6">Upload Date</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #dee2e6">Actions</th>
</tr>
</thead>
<tbody id="recordsTable">
<tr>
<td colspan="5" style="padding:40px;text-align:center;color:#6c757d">
No records yet. Upload certificates to see them here.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="insightsPage" class="page card" style="display:none">
<h3>Insights & Analytics</h3>
<div class="small-muted mb-3">Certificate statistics and analytics</div>
<div class="card mb-3">
<h5>Certificate Distribution</h5>
<div style="height:200px;display:flex;align-items:flex-end;gap:10px;padding:20px 0">
<div style="flex:1;text-align:center">
<div style="height:150px;background:linear-gradient(to top, #FF5800, #ff8a4c);border-radius:5px 5px 0 0"></div>
<div class="small-muted mt-2">Marksheets</div>
</div>
<div style="flex:1;text-align:center">
<div style="height:100px;background:linear-gradient(to top, #36B37E, #00D4AA);border-radius:5px 5px 0 0"></div>
<div class="small-muted mt-2">Degree Certificates</div>
</div>
<div style="flex:1;text-align:center">
<div style="height:80px;background:linear-gradient(to top, #0066FF, #00B8D9);border-radius:5px 5px 0 0"></div>
<div class="small-muted mt-2">Transfer Certificates</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<div class="card h-100">
<h5>Recent Activity</h5>
<div class="small-muted">
<div style="padding:8px 0;border-bottom:1px solid #f1f5f9">
<i class="bi bi-upload" style="color:#FF5800"></i> User logged in
</div>
<div style="padding:8px 0">
<i class="bi bi-check-circle" style="color:#36B37E"></i> System initialized
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="card h-100">
<h5>System Status</h5>
<div class="small-muted">
<div style="display:flex;justify-content:space-between;padding:8px 0">
<span>Certificates Stored:</span>
<strong>0</strong>
</div>
<div style="display:flex;justify-content:space-between;padding:8px 0">
<span>Storage Used:</span>
<strong>0 MB</strong>
</div>
<div style="display:flex;justify-content:space-between;padding:8px 0">
<span>Last Backup:</span>
<strong>Never</strong>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="bulkUploadPage" class="page card" style="display:none">
<h3>Bulk Upload</h3>
<div class="small-muted mb-3">Upload multiple certificates at once</div>
<div class="card mb-3">
<h5>Bulk Upload Instructions</h5>
<ol class="small-muted">
<li>Prepare your certificate files</li>
<li>Ensure proper naming convention: StudentName_RollNumber_CertificateType.pdf</li>
<li>Select all files you want to upload</li>
<li>Click "Process Files" to generate hashes</li>
<li>Review and confirm the upload</li>
</ol>
</div>
<div class="upload-area card">
<div style="text-align:center;padding:40px 20px">
<i class="bi bi-folder2" style="font-size:60px;color:#0066FF;margin-bottom:15px"></i>
<div class="small-muted">Select multiple files for bulk upload</div>
<input type="file" id="bulkFileInput" multiple style="display:none">
<button class="btn btn-outline-primary mt-3" onclick="document.getElementById('bulkFileInput').click()">
<i class="bi bi-folder2-open"></i> Select Multiple Files
</button>
<div class="small-muted mt-2" style="font-size:12px">You can select multiple files using Ctrl+Click or Shift+Click</div>
</div>
</div>
</section>
</main>
</div>
`;
// Show admin panel
adminPanel.style.display = 'block';
// Initialize admin panel functionality
initializeAdminPanel();
}
// Initialize admin panel
function initializeAdminPanel() {
// Navigation functionality
const navLinks = document.querySelectorAll('.nav-link');
navLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const target = this.getAttribute('data-target');
// Remove active class from all links
navLinks.forEach(l => l.classList.remove('active'));
// Add active class to clicked link
this.classList.add('active');
// Show the target page
showPage(target);
});
});
// Logout functionality
const logoutBtn = document.getElementById('logoutBtn');
if (logoutBtn) {
logoutBtn.addEventListener('click', function() {
if (confirm('Are you sure you want to logout?')) {
// Clear session data
sessionStorage.removeItem('certitrust_user');
// Show login page, hide admin panel
adminPanel.style.display = 'none';
loginPage.style.display = 'flex';
// Reset form
loginForm.reset();
hideAllErrors();
}
});
}
// File input functionality
const fileInput = document.getElementById('fileInput');
if (fileInput) {
fileInput.addEventListener('change', function(e) {
const files = e.target.files;
if (files.length > 0) {
alert(`Selected ${files.length} file(s) for upload.`);
// In a real app, you would process these files here
}
});
}
const bulkFileInput = document.getElementById('bulkFileInput');
if (bulkFileInput) {
bulkFileInput.addEventListener('change', function(e) {
const files = e.target.files;
if (files.length > 0) {
alert(`Selected ${files.length} file(s) for bulk upload.`);
// In a real app, you would process these files here
}
});
}
}
// Global function to show pages
window.showPage = function(pageId) {
// Hide all pages
const pages = document.querySelectorAll('.page');
pages.forEach(page => {
page.style.display = 'none';
});
// Show the selected page
const targetPage = document.getElementById(pageId);
if (targetPage) {
targetPage.style.display = 'block';
}
};
// Check if user is already logged in
const savedUser = sessionStorage.getItem('certitrust_user');
if (savedUser) {
const userData = JSON.parse(savedUser);
loginPage.style.display = 'none';
loadAdminPanel(userData);
}
});
// Add admin panel CSS
const adminStyles = `
<style>
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: white; border-right: 1px solid #e6e9ee; padding: 20px; }
.logo-panel { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #FF5800, #e04f00); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; }
.nav { margin-top: 20px; }
.nav-link { color: #374151; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; text-decoration: none; }
.nav-link:hover { background: #fff5f0; color: #FF5800; }
.nav-link.active { background: linear-gradient(90deg, #fff4ee, #fffaf6); border: 1px solid rgba(255, 88, 0, 0.08); color: #FF5800; }
.main { flex: 1; padding: 28px; margin-left: 250px; }
.card { background: white; border-radius: 12px; padding: 18px; box-shadow: 0 6px 18px rgba(15,23,42,0.04); border: 1px solid #eef2f6; margin-bottom: 20px; }
.upload-area { border: 2px dashed #e6e9ee; border-radius: 12px; padding: 18px; text-align: center; }
.small-muted { color: #6b7280; font-size: 13px; }
.btn-brand { background: #FF5800; color: white; border: none; }
.btn-brand:hover { background: #e04f00; }
@media (max-width: 900px) {
.sidebar { position: relative; width: 100%; margin-left: 0; }
.main { margin-left: 0; padding: 16px; }
}
</style>
`;
// Add the styles to the document
document.head.insertAdjacentHTML('beforeend', adminStyles);
</script>
</body>
</html>