Parveen Public School

Parent Portal

Student Management System

'); printWindow.document.close(); printWindow.focus(); printWindow.print(); }); // Close all popups $('.popup-close, .popup-overlay').on('click', function(e) { if (e.target === this || $(e.target).hasClass('popup-close')) { $(this).closest('.popup-overlay').fadeOut(200); } }); // Close with Escape key $(document).on('keydown', function(e) { if (e.key === 'Escape') { $('.popup-overlay').fadeOut(200); } }); // Auto-submit student selector on change $('.student-select').on('change', function() { $(this).closest('form').submit(); }); // Attendance calendar navigation $(document).on('click', '.nav-btn', function() { var monthsOffset = parseInt($(this).data('offset')); var studentId = 0; loadAttendanceCalendar(monthsOffset, studentId); }); // Load attendance calendar function loadAttendanceCalendar(monthsOffset, studentId) { $('#calendar-content').html('
Loading calendar...
'); $.ajax({ url: 'https://demo.theschool.pk/wp-admin/admin-ajax.php', type: 'POST', data: { action: 'load_attendance_calendar', student_id: studentId, months_offset: monthsOffset }, success: function(response) { $('#calendar-content').html(response); }, error: function() { $('#calendar-content').html('
Error loading calendar. Please try again.
'); } }); } });