fix teacher pages and adopt the school year
Tests / PHPUnit (push) Successful in 1m14s

This commit is contained in:
root
2026-07-17 00:38:59 -04:00
parent 539d0eb220
commit 0d0a771dd1
7 changed files with 97 additions and 26 deletions
+35 -10
View File
@@ -1,5 +1,10 @@
<?= $this->extend('layout/main_layout') ?>
<?= $this->section('styles') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.10/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.10/css/dataTables.bootstrap5.min.css">
<?= $this->endSection() ?>
<?= $this->section('content') ?>
<div class="container-xxl py-5">
<div class="container">
@@ -282,6 +287,8 @@
<?= $this->endSection() ?>
<?= $this->section('scripts') ?>
<script src="https://cdn.datatables.net/1.13.10/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.10/js/dataTables.bootstrap5.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded",()=>{
const form=document.getElementById("attendanceForm");
@@ -316,16 +323,34 @@ document.addEventListener("DOMContentLoaded",()=>{
<script>
$(function(){
$('#teachersTable').DataTable({
pageLength:100,
order:[],
columnDefs:[{targets:[0,3,4,5,6],className:'text-center'}]
});
$('#studentsTable').DataTable({
pageLength:100,
order:[],
columnDefs:[{targets:[0,4,5,6,7],className:'text-center'}]
});
if (!(window.jQuery && jQuery.fn && jQuery.fn.DataTable)) {
return;
}
function hasValidRows($table) {
const expectedColumns = $table.find('thead th').length;
return !$table.find('tbody tr').toArray().some(function(row) {
return $(row).children('td, th').length !== expectedColumns;
});
}
const $teachersTable = $('#teachersTable');
if ($teachersTable.length && hasValidRows($teachersTable)) {
$teachersTable.DataTable({
pageLength:100,
order:[],
columnDefs:[{targets:[0,3,4,5,6],className:'text-center'}]
});
}
const $studentsTable = $('#studentsTable');
if ($studentsTable.length && hasValidRows($studentsTable)) {
$studentsTable.DataTable({
pageLength:100,
order:[],
columnDefs:[{targets:[0,4,5,6,7],className:'text-center'}]
});
}
});
</script>
<?= $this->endSection() ?>