-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
2735 lines (2485 loc) · 103 KB
/
Copy pathscript.js
File metadata and controls
2735 lines (2485 loc) · 103 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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
document.addEventListener('DOMContentLoaded', function() {
// Login Form Handler
const loginForm = document.getElementById('loginForm');
const loginContainer = document.getElementById('loginContainer');
const mainContainer = document.getElementById('mainContainer');
const userDisplay = document.getElementById('userDisplay');
const logoutBtn = document.getElementById('logoutBtn');
// Demo users list - parsed from a standardized Last, First MiddleInitial format
const NAMES_RAW = [
'ADAN, JOHN-JOHN B.',
'ARELLANO, MICKHEIL CKIANNE S.',
'AVILES, KRISTINA DIANE C.',
'BACCAY, AIRE ZHYRELL S.',
'BANIEL, RUBEN RAPHAEL S.',
'BARNUEVO, JAY-R M.',
'CABIAL, ANTONIA JANE G.',
'CARDENOZA, JUSTIN EMIREE R.',
'CERDA, GABRIELLE V.',
'CHIN, KIM JACKSON C.',
'DABALOS, MERVIN LLANDRO T.',
'DANGCALAN, ANGEL JERICK L.',
'DAVIS, SEAN PARIS GABRIEL L.',
'DESPI, ADRIAN LEE G.',
'DUMPA, IAN LESTER DC.',
'ENGCO, NATHANIEL P.',
'ENRIQUEZ, JENRIX S.',
'ESPIÑA, JAMAICA JEAN M.',
'GAMBOA, ROGELIO B.',
'GARCIA, GILSON SOFIO EMIL S.',
'GARCIA, JOY ANTONETTE C.',
'GAYO, MICHAEL G.',
'GONZALO III, FRANCISCO S.',
'GUZMAN, HERJAN A',
'IMPERIAL, HAYDEN PAUL S.',
'JACOB, NARDO JR I.',
'LABORES, STEPHANIE MAE V.',
'LINCHOCO, ROMEO T',
'MABUTIN, FRANCINE JOY D.',
'MACALAM, IRVEN C.',
'MACASAET, LOVELY RAYNE G.',
'MENDOZA, LARIZ ANNE R.',
'MIOLE, ANGEL HEARTH R.',
'PEREZ, DANE MACNEL V.',
'PICZON, RUGILZON B.',
'RAMURAN, KURT ANDREI T.',
'REYES, JEUSH DANREY B.',
'RODRIGUEZ, SHAIRA JANE P.',
'SALAN, JEEKEE B.',
'SAN BUENAVENTURA, NIÑA MAY P.',
'SANTOS, JARED ARVIN L.',
'SINDO, JUNNEL ANTHONY C.',
'TAN, ELIANA JANE R.',
'TANAGON, KYLE ROWAN D.',
'TATARO, ADRIAN RADAM.',
'TOBIAS, ANDREI JOHN S.',
'TORREFIEL, TRISHIA DOLL.',
'TRAQUEÑA, MIGUEL S.',
'VALLEJOS, MARKUS QRIANE O.',
'VILLANUEVA, KIEL ANTHONY C.'
];
// Gender alignment for each name in NAMES_RAW (lowercase to match form values)
const GENDERS = [
'male','male','female','male','male','male','female','male','female','male',
'male','male','male','male','male','male','male','female','male','male',
'female','male','male','male','male','male','female','male','female','male',
'female','female','female','male','male','male','male','female','male','female',
'male','male','female','male','male','male','female','male','male','male'
];
const USERS = NAMES_RAW.map((line, idx) => {
const parts = line.split(',');
const last = (parts[0] || '').trim();
const rest = (parts[1] || '').trim();
// split rest into tokens; last token is the middle initial, preceding tokens are the full first name
const tokens = rest.split(/\s+/).filter(Boolean);
let firstName = '';
let middleInitial = '';
if (tokens.length === 0) {
firstName = '';
} else if (tokens.length === 1) {
firstName = tokens[0];
} else {
firstName = tokens.slice(0, -1).join(' ');
middleInitial = tokens[tokens.length - 1].replace(/\./g, '').trim();
}
// username: lowercase first token of firstName only (strip non-alphanumeric except hyphen)
const firstToken = (firstName.split(/\s+/)[0] || '').toLowerCase();
let username = firstToken.replace(/[^a-z0-9\-ñÑ]/gi, '');
if (!username) username = firstToken;
// displayName: FirstName MiddleInitial Last
const displayName = [firstName, middleInitial, last].filter(Boolean).join(' ');
// profile with requested program and year; set gender from GENDERS array
const profile = {
firstName: firstName,
middleName: middleInitial,
lastName: last,
birthdate: '',
gender: (GENDERS[idx] || '').toLowerCase(),
nationality: 'Filipino',
address: '',
email: '',
phone: '',
emergencyContact: '',
program: 'DIPLOMAT IN INFORMATION TECHNOLOGY',
yearLevel: '1st Year',
studentId: ''
};
return { username, password: '123', displayName, profile };
});
// Modal Elements
const modal = document.getElementById('modal');
const closeModal = document.getElementById('closeModal');
const cancelModal = document.getElementById('cancelModal');
const confirmModal = document.getElementById('confirmModal');
const modalTitle = document.getElementById('modalTitle');
const modalContent = document.getElementById('modalContent');
const modalIcon = document.getElementById('modalIcon');
// Profile Avatar Elements
const profileAvatar = document.getElementById('profileAvatar');
const avatarModal = document.getElementById('avatarModal');
const closeAvatarModal = document.getElementById('closeAvatarModal');
const cancelAvatarModal = document.getElementById('cancelAvatarModal');
const saveAvatar = document.getElementById('saveAvatar');
const avatarOptions = document.querySelectorAll('.avatar-option');
// Theme Toggle
const themeSwitch = document.getElementById('themeSwitch');
// Navigation Tree
const carets = document.querySelectorAll('.caret');
const menuItems = document.querySelectorAll('.menu-item');
const contentTitle = document.getElementById('contentTitle');
const contentContainer = document.getElementById('contentContainer');
// Handle Login
if (loginForm) {
loginForm.addEventListener('submit', function(e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
// Find matching user from USERS list (case-insensitive username)
const uname = username.trim().toLowerCase();
const user = USERS.find(u => (u.username || '').toLowerCase() === uname && u.password === password);
if (user) {
loginContainer.classList.add('hidden');
mainContainer.classList.remove('hidden');
userDisplay.textContent = `Welcome, ${user.displayName}`;
// set current user for other parts of the app
CURRENT_USER = user;
// Show chatbot after login
const chatbotContainer = document.querySelector('.chatbot-container');
if (chatbotContainer) {
chatbotContainer.style.display = 'block';
}
// Generate dashboard content on login
updateContent('Dashboard', 'dashboard');
} else {
alert('Invalid credentials. Please use a valid username and password.');
}
});
}
// Modal Close Handlers
function closeModalFunction() {
modal.classList.add('hidden');
}
if (closeModal) {
closeModal.addEventListener('click', closeModalFunction);
}
if (cancelModal) {
cancelModal.addEventListener('click', closeModalFunction);
}
if (confirmModal) {
confirmModal.addEventListener('click', closeModalFunction);
}
// Handle Log Out
if (logoutBtn) {
logoutBtn.addEventListener('click', function() {
loginContainer.classList.remove('hidden');
mainContainer.classList.add('hidden');
document.getElementById('username').value = '';
document.getElementById('password').value = '';
// clear current user on logout
CURRENT_USER = null;
// clear profile fields if present
['profileFirstName','profileMiddleName','profileLastName','profileBirthdate','profileGender','profileNationality','profileAddress','profileEmail','profilePhone','profileEmergencyContact'].forEach(id => {
const el = document.getElementById(id);
if (el) el.value = '';
});
});
}
// Update Content Function
function updateContent(title, contentId) {
if (contentTitle) {
// Set appropriate icon for the content title
const iconClass = getIconForContentId(contentId);
contentTitle.innerHTML = `<i class="${iconClass}"></i> ${title}`;
}
if (contentContainer) {
// Clear current active menu item
document.querySelectorAll('.active-item').forEach(item => {
if (!item.classList.contains('caret')) {
item.classList.remove('active-item');
}
});
// Set new active menu item
const newActiveItem = document.querySelector(`[data-content-id="${contentId}"]`);
if (newActiveItem) {
newActiveItem.classList.add('active-item');
}
// Generate content based on contentId
contentContainer.innerHTML = generateContent(contentId);
// Initialize dashboard widget behaviors (e.g., See more toggles)
setupDashboardWidgets();
// Populate profile settings if that view was loaded
if (contentId === 'profile-settings') {
populateProfileSettings();
}
}
}
// Fill profile settings fields from CURRENT_USER.profile (if available)
function populateProfileSettings() {
if (!CURRENT_USER) return;
// If profile missing, derive one from displayName (split into first/middle/last)
if (!CURRENT_USER.profile) {
const full = (CURRENT_USER.displayName || '').trim();
const parts = full.split(/\s+/).filter(Boolean);
let first = '';
let middle = '';
let last = '';
if (parts.length === 1) {
first = parts[0];
} else if (parts.length === 2) {
first = parts[0];
last = parts[1];
} else if (parts.length > 2) {
first = parts[0];
last = parts[parts.length - 1];
middle = parts.slice(1, parts.length - 1).join(' ');
}
CURRENT_USER.profile = {
firstName: first,
middleName: middle,
lastName: last,
birthdate: '',
gender: '',
nationality: '',
address: '',
email: '',
phone: '',
emergencyContact: '',
program: 'DIPLOMAT IN INFORMATION TECHNOLOGY',
yearLevel: '1st Year',
studentId: ''
};
}
const p = CURRENT_USER.profile;
const map = {
profileFirstName: p.firstName || '',
profileMiddleName: p.middleName || '',
profileLastName: p.lastName || '',
profileBirthdate: p.birthdate || '',
profileGender: p.gender || '',
profileNationality: p.nationality || '',
profileAddress: p.address || '',
profileEmail: p.email || '',
profilePhone: p.phone || '',
profileEmergencyContact: p.emergencyContact || '',
profileProgram: p.program || 'DIPLOMAT IN INFORMATION TECHNOLOGY',
profileYearLevel: p.yearLevel || '1st Year',
profileStudentId: p.studentId || ''
};
Object.keys(map).forEach(id => {
const el = document.getElementById(id);
if (el) el.value = map[id];
});
}
// Setup dashboard-specific widget behaviors (called after content injection)
function setupDashboardWidgets() {
// See more / See less for upcoming widget
document.querySelectorAll('.see-more-btn').forEach(btn => {
// avoid attaching multiple listeners
if (btn._hasListener) return;
btn._hasListener = true;
const textNode = btn.querySelector('.see-more-text');
const icon = btn.querySelector('.see-more-icon');
btn.addEventListener('click', function() {
const widget = btn.closest('.widget');
if (!widget) return;
const more = widget.querySelector('.more-items');
if (!more) return;
const expanded = more.classList.contains('hidden');
if (expanded) {
more.classList.remove('hidden');
if (textNode) textNode.textContent = 'See less';
if (icon) icon.classList.add('rotated');
btn.setAttribute('aria-expanded', 'true');
} else {
more.classList.add('hidden');
if (textNode) textNode.textContent = 'See more';
if (icon) icon.classList.remove('rotated');
btn.setAttribute('aria-expanded', 'false');
}
});
});
}
// Handle Modal Opening
function openModal(title, contentId) {
modalTitle.innerHTML = `<i id="modalIcon" class="${getModalIconClass(contentId)}"></i> ${title}`;
modalContent.innerHTML = generateModalContent(contentId);
// Set the confirm button text based on the modal type
confirmModal.textContent = getModalAction(contentId);
modal.classList.remove('hidden');
}
// Get Icon Class for Modal Title
function getModalIconClass(contentId) {
const iconMap = {
'payment-center': 'fas fa-credit-card',
'grade-completion': 'fas fa-tasks',
'change-password': 'fas fa-key',
'student-maintenance': 'fas fa-user-edit',
'default': 'fas fa-info-circle'
};
return iconMap[contentId] || iconMap['default'];
}
// Get Action Text for Modal Confirm Button
function getModalAction(contentId) {
const actionMap = {
'payment-center': 'Process Payment',
'grade-completion': 'Submit Request',
'change-password': 'Update Password',
'student-maintenance': 'Save Changes',
'default': 'Confirm'
};
return actionMap[contentId] || actionMap['default'];
}
// Generate Content Based on Content ID
function generateContent(contentId) {
if (contentId === 'dashboard') {
return generateDashboardContent();
} else if (contentId === 'grade-display') {
return generateHSGSGradeDisplay();
} else if (contentId === 'online-enrollment') {
return generateOnlineEnrollment();
} else if (contentId === 'schedule-inquiry') {
return generateScheduleInquiry();
} else if (contentId === 'current-enrollment') {
return generateCurrentEnrollment();
} else if (contentId === 'grades-display') {
return generateCollegeGradesDisplay();
} else if (contentId === 'grade-completion') {
return generateGradeCompletionRequest();
} else if (contentId === 'change-password') {
return generateChangePassword();
} else if (contentId === 'profile-settings') {
return generateProfileSettings();
}
// For other sections, return placeholder content
return `
<div class="content-placeholder">
<div class="info-box">
<i class="fas fa-info-circle"></i>
<div>
<p>This is a demonstration of the <strong>${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}</strong> section.</p>
<p>In a complete implementation, this would contain actual data and functionality.</p>
</div>
</div>
<p>You selected the <strong>${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}</strong> option. This is where the content for this section would be displayed.</p>
<button class="widget-config-btn" onclick="openModal('${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}', '${contentId}')">
<i class="${getIconForContentId(contentId)}"></i> Open ${contentId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}
</button>
</div>
`;
}
// Generate HS/GS Latest Grade Display
function generateHSGSGradeDisplay() {
return `
<div class="content-section">
<div class="info-box">
<i class="fas fa-info-circle"></i>
<div>
<p>Below are your latest grades for the current semester (2025 Spring).</p>
</div>
</div>
<h3 class="content-subtitle">GRADES</h3>
<table class="modal-table">
<thead>
<tr>
<th>Subject</th>
<th>MIDTERM</th>
<th>FINALS</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td>Introduction to Computing</td>
<td>94</td>
<td>92</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Computer Programming</td>
<td>89</td>
<td>91</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Mathematics in the Modern World</td>
<td>95</td>
<td>94</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Purposive Communication</td>
<td>92</td>
<td>90</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Keyboaring and Documents Processing with Laboratory</td>
<td>88</td>
<td>90</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Basic Computer Hardware Servicing</td>
<td>95</td>
<td>96</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Civic Welfare Training Service 1</td>
<td>94</td>
<td>95</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
<tr>
<td>Physical Activity Towards Health and Fitness 1</td>
<td>96</td>
<td>95</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">General Weighted Average</td>
<td>93.34</td>
<td><span class="status-pill status-paid">Passed</span></td>
</tr>
</tfoot>
</table>
<div style="margin-top: 20px;">
<button onclick="window.print()" style="padding: 10px 20px; background-color: #2c3e50; color: white; border: none; cursor: pointer;">
<i class="fas fa-print"></i> Download / Print Statement
</button>
<div class="update-msg" style="margin-top: 10px;">Last updated: May 5, 2025</div>
</div>
`;
}
// Generate Online Enrollment
function generateOnlineEnrollment() {
return `
<div class="content-section">
<div class="info-box">
<i class="fas fa-info-circle"></i>
<div>
<p>Welcome to the Online Enrollment System. Please follow the steps below to complete your enrollment for the upcoming semester.</p>
</div>
</div>
<div class="enrollment-progress">
<div class="progress-step active">
<div class="step-number">1</div>
<div class="step-label">Student Information</div>
</div>
<div class="progress-connector"></div>
<div class="progress-step">
<div class="step-number">2</div>
<div class="step-label">Subject Selection</div>
</div>
<div class="progress-connector"></div>
<div class="progress-step">
<div class="step-number">3</div>
<div class="step-label">Assessment</div>
</div>
<div class="progress-connector"></div>
<div class="progress-step">
<div class="step-number">4</div>
<div class="step-label">Payment</div>
</div>
<div class="progress-connector"></div>
<div class="progress-step">
<div class="step-number">5</div>
<div class="step-label">Confirmation</div>
</div>
</div>
<div class="enrollment-form" style="margin-top: 30px;">
<h3 class="form-title">Step 1: Student Information</h3>
<div class="form-section">
<div class="form-row">
<div class="form-group">
<label for="studentId">Student ID</label>
<input type="text" id="studentId" value="2023-12345" disabled>
</div>
<div class="form-group">
<label for="enrollmentType">Enrollment Type</label>
<select id="enrollmentType">
<option value="regular">Regular</option>
<option value="irregular">Irregular</option>
<option value="transferee">Transferee</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="firstName">First Name</label>
<input type="text" id="firstName" value="John">
</div>
<div class="form-group">
<label for="middleName">Middle Name</label>
<input type="text" id="middleName" value="Michael">
</div>
<div class="form-group">
<label for="lastName">Last Name</label>
<input type="text" id="lastName" value="Smith">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="birthdate">Birthdate</label>
<input type="date" id="birthdate" value="2000-05-15">
</div>
<div class="form-group">
<label for="gender">Gender</label>
<select id="gender">
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group full-width">
<label for="address">Complete Address</label>
<input type="text" id="address" value="123 Main Street, Anytown, CA 12345">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="emailAddress">Email Address</label>
<input type="email" id="emailAddress" value="john.smith@example.com">
</div>
<div class="form-group">
<label for="contactNumber">Contact Number</label>
<input type="tel" id="contactNumber" value="(555) 123-4567">
</div>
</div>
</div>
<div class="buttons-container">
<button class="widget-config-btn">
<i class="fas fa-arrow-right"></i> Next: Subject Selection
</button>
</div>
</div>
</div>
`;
}
// Generate Subject Schedule Inquiry
function generateScheduleInquiry() {
return `
<div class="content-section">
<div class="info-box">
<i class="fas fa-info-circle"></i>
<div>
<p>You can view your class schedule for the current semester (2025 Spring) below.</p>
</div>
</div>
<div class="schedule-filters" style="margin-bottom: 20px;">
<div class="form-row">
<div class="form-group">
<label for="scheduleDay">Filter by Day</label>
<select id="scheduleDay">
<option value="all">All Days</option>
<option value="monday">Monday</option>
<option value="tuesday">Tuesday</option>
<option value="wednesday">Wednesday</option>
<option value="thursday">Thursday</option>
<option value="friday">Friday</option>
<option value="saturday">Saturday</option>
<option value="sunday">Sunday</option>
</select>
</div>
<div class="form-group">
<label for="scheduleSubject">Filter by Subject</label>
<select id="scheduleSubject">
<option value="all">All Subjects</option>
<option value="COMP 001">Introduction to Computing</option>
<option value="COMP 002">Computer Programming</option>
<option value="GEED 004">Mathematics in the Modern World</option>
<option value="GEED 005">Purposive Communication</option>
<option value="ITECH 101">Keyboaring and Documents Processing with Laboratory</option>
<option value="ITECH 102">Basic Computer Hardware Servicing</option>
<option value="CWTS 001">Civic Welfare Training Service 1</option>
option value="PATHFIT 1">Physical Activity Towards Health and Fitness 1</option>
</select>
</div>
</div>
</div>
<table class="modal-table">
<thead>
<tr>
<th>Subject Code</th>
<th>Description</th>
<th>Section</th>
<th>Units</th>
<th>Schedule</th>
<th>Room</th>
<th>Instructor</th>
</tr>
</thead>
<tbody>
<tr>
<td>COMP 001</td>
<td>Introduction to Computing</td>
<td>A</td>
<td>3</td>
<td>TH 10:30 am - 03:30 pm</td>
<td>Room 301</td>
<td>Prof. Crasco, Melania Melanie</td>
</tr>
<tr>
<td>COMP 002</td>
<td>Computer Programming</td>
<td>B</td>
<td>4</td>
<td>WS 07:30 am - 10:00 am</td>
<td>Room 405</td>
<td>Prof. Malubay, Roel</td>
</tr>
<tr>
<td>GEED 004</td>
<td>Mathematics in the Modern World</td>
<td>A</td>
<td>3</td>
<td>W 10:30 am - 01:30 pm</td>
<td>Room 204</td>
<td>Prof. Sevilla, Dennis Henry</td>
</tr>
<tr>
<td>GEED 005</td>
<td>Purposive Communication</td>
<td>C</td>
<td>4</td>
<td>W 01:30 pm - 04:30 pm</td>
<td>ITECH</td>
<td>Prof. </td>
</tr>
<tr>
<td>ITECH 101</td>
<td>Keyboaring and Documents Processing with Laboratory</td>
<td>B</td>
<td>3</td>
<td>S 03:00 pm - 08:00 pm</td>
<td>ITECH</td>
<td>Prof. Solano, Ma. Corazon</td>
</tr>
<tr>
<td>ITECH 102</td>
<td>Basic Computer Hardware Servicing</td>
<td>B</td>
<td>3</td>
<td>TH 04:00 pm - 09:00 pm</td>
<td>ITECH</td>
<td>Prof. Dela Isla, Jonard John</td>
</tr>
<tr>
<td>CWTS 001</td>
<td>Civic Welfare Training Service 1</td>
<td>B</td>
<td>3</td>
<td>Sun 08:00 am - 06:00 pm</td>
<td>PUP MAIN</td>
<td>Prof. Asis, Rechelle</td>
</tr>
<tr>
<td>PATHFIT 1</td>
<td>Physical Activity Towards Health and Fitness 1</td>
<td>B</td>
<td>3</td>
<td>S 12:30 pm - 02:30 pm</td>
<td>Gymnasium</td>
<td>Guiriba, Ronald Alejo/td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">Total Units</td>
<td>16</td>
<td colspan="3"></td>
</tr>
</tfoot>
</table>
<div class="weekly-schedule" style="margin-top: 30px;">
<h3 class="content-subtitle">Weekly Schedule View</h3>
<div class="weekly-table-container">
<table class="schedule-table">
<thead>
<tr>
<th>Time</th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<tbody>
<tr>
<td>8:00 - 9:00</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>9:00 - 10:30</td>
<td></td>
<td class="scheduled-class math-class">Computer Programming<br>Room 301</td>
<td></td>
</tr>
<tr>
<td>10:30 - 11:00</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>11:00 - 12:30</td>
<td></td>
<td class="scheduled-class physics-class">PHYS201<br>Room 405</td>
<td></td>
<td class="scheduled-class physics-class">PHYS201<br>Room 405</td>
<td></td>
</tr>
<tr>
<td>12:30 - 1:00</td>
<td colspan="5" class="break-time">LUNCH BREAK</td>
</tr>
<tr>
<td>1:00 - 2:30</td>
<td class="scheduled-class english-class">ENGL150<br>Room 204</td>
<td></td>
<td class="scheduled-class english-class">ENGL150<br>Room 204</td>
<td></td>
<td class="scheduled-class english-class">ENGL150<br>Room 204</td>
</tr>
<tr>
<td>2:30 - 3:00</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>3:00 - 4:30</td>
<td></td>
<td class="scheduled-class cs-class">COMP220<br>Lab 101</td>
<td></td>
<td class="scheduled-class cs-class">COMP220<br>Lab 101</td>
<td class="scheduled-class pe-class" rowspan="2">PE100<br>Gymnasium</td>
</tr>
<tr>
<td>4:30 - 5:00</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="margin-top: 20px;">
<button onclick="window.print()" style="padding: 10px 20px; background-color: #2c3e50; color: white; border: none; cursor: pointer;">
<i class="fas fa-print"></i> Download / Print Statement
</button>
<style>
@media print {
body {
font-family: Arial, sans-serif;
margin: 20px;
}
.content-section {
width: 100%;
max-width: 900px;
margin: 0 auto;
}
.form-row, .form-group, .info-box {
display: none;
}
.modal-table {
width: 100%;
border-collapse: collapse;
}
.modal-table th, .modal-table td {
border: 1px solid #ddd;
padding: 8px;
}
.modal-table th {
background-color: #f4f4f4;
}
button {
display: none;
}
}
</style>
`;
}
// Generate Current Enrollment: list all students (names)
function generateCurrentEnrollment() {
const students = Array.isArray(USERS) ? USERS : [];
const rows = students.map((u, i) => {
const p = u.profile || {};
const name = u.displayName || [p.firstName, p.middleName, p.lastName].filter(Boolean).join(' ');
const gender = (p.gender || '').toString();
const nat = p.nationality || '';
const program = p.program || '';
const year = p.yearLevel || '';
const sid = p.studentId || '';
return `
<tr>
<td>${i+1}</td>
<td>${name}</td>
<td>${u.username}</td>
<td>${gender ? gender.charAt(0).toUpperCase() + gender.slice(1) : ''}</td>
<td>${nat}</td>
<td>${program}</td>
<td>${year}</td>
<td>${sid}</td>
</tr>`;
}).join('');
return `
<div class="content-section">
<div class="info-box">
<i class="fas fa-users"></i>
<div>
<p>Current enrollment roster — list of all students.</p>
</div>
</div>
<h3 class="content-subtitle" style="margin-top: 10px;">Student Roster</h3>
<table class="modal-table">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Username</th>
<th>Gender</th>
<th>Nationality</th>
<th>Program</th>
<th>Year</th>
<th>Student ID</th>
</tr>
</thead>
<tbody>
${rows}
</tbody>
<tfoot>
<tr>
<td colspan="8">Total students: ${students.length}</td>
</tr>
</tfoot>
</table>
</div>`;
}
// Generate College Grades Display
function generateCollegeGradesDisplay() {
return `
<div class="content-section">
<div class="info-box">
<i class="fas fa-info-circle"></i>
<div>
<p>Below are your grades for the current semester (2025 Spring).</p>
</div>
</div>
<div class="form-row" style="margin-bottom: 20px;">
<div class="form-group">
<label for="semesterSelect">Select Semester</label>
<select id="semesterSelect">
<option value="2025-2">Spring 2025 (Current)</option>
<option value="2025-1">Fall 2024</option>
<option value="2024-2">Spring 2024</option>
<option value="2024-1">Fall 2023</option>
</select>
</div>
</div>
<table class="modal-table" style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
<thead>
<tr>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Subject Code</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Description</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Units</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Midterm</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Final</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Grade</th>
<th style="border: 1px solid #ddd; padding: 8px; background-color: #f4f4f4;">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid #ddd; padding: 8px;">COMP 001</td>
<td style="border: 1px solid #ddd; padding: 8px;">Introduction to Computing</td>
<td style="border: 1px solid #ddd; padding: 8px;">3</td>