Files
ClassManager/frontend/admin/reports.php
T
canglan 4c1ca13a3f v4.5 考勤默认出勤/校历、作业按次登记与权限体系完善
1. 考勤默认出勤:按日期范围给缺失学生批量补"出勤"(跳过周末/法定节假日,调休补班与手动补课日照常,已有记录不覆盖)
2. 节假日/补课校历:法定节假日与调休补班来自在线接口(缓存+失败降级),支持手动添加放假/补课(存 system_settings,优先于接口)
3. 作业按次登记:一次登记覆盖多次作业,配置总提交次数,按每人缺交次数自动扣分(单次缺交扣分x次数),并写入作业提交数据供"数据报表-作业统计"使用
4. 权限体系:新增 homework_register/default_attendance/manage_calendar 权限项;数据报表/操作日志/系统设置拆分为 view_reports/view_logs/manage_settings,共20项功能权限可配置;预置组默认值与 init.sql 同步
5. 权限审计修复:学生端接口管理员越权修复(管理员查看需 view_all_records,学生仅本人);学生列表手机号仅向学生管理/导出名单权限下发;操行分管理页与导航补权限门控
6. v4.5.sql:为预置权限组补充新权限默认值(JSON_SET,幂等可重复执行)
2026-10-10 15:22:47 +08:00

105 lines
3.5 KiB
PHP

<?php
/**
* 班级操行分管理系统 - 管理端数据报表
*
* 开发者: Canglan
* 联系方式: admin@sea-studio.top
* 版权归属: Sea Network Technology Studio
* 许可证: MIT License
*
* 版权所有 © Sea Network Technology Studio
*/
require_once __DIR__ . '/../config.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
header('Location: /index.php');
exit();
}
$page_title = '数据报表';
$role = current_group_name();
require_perm('view_reports');
include __DIR__ . '/../includes/header.php';
?>
<?php include __DIR__ . '/../includes/nav.php'; ?>
<div class="container">
<div class="card">
<div class="filter-bar">
<div class="filter-group">
<label>开始日期</label>
<input type="date" id="reportStartDate">
</div>
<div class="filter-group">
<label>结束日期</label>
<input type="date" id="reportEndDate">
</div>
<div class="filter-group" style="flex: 0 0 auto;">
<button class="btn btn-primary" onclick="loadReports()">查询</button>
</div>
</div>
<p style="font-size: 12px; color: var(--color-text-secondary);" id="reportRangeHint">
默认统计当前学期范围;考勤按记录日期统计,作业按作业截止日期统计
</p>
</div>
<div class="card">
<div class="card-title" style="display:flex; justify-content:space-between; align-items:center;">
<span>考勤统计</span>
<button class="btn btn-sm btn-secondary" onclick="exportReport('attendance')">导出</button>
</div>
<div id="attendanceSummary" class="report-summary"></div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>序号</th>
<th>学号</th>
<th>姓名</th>
<th>出勤</th>
<th>缺勤</th>
<th>迟到</th>
<th>请假</th>
<th>记录数</th>
<th>出勤率</th>
</tr>
</thead>
<tbody id="attendanceReportList"></tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-title" style="display:flex; justify-content:space-between; align-items:center;">
<span>作业统计</span>
<button class="btn btn-sm btn-secondary" onclick="exportReport('homework')">导出</button>
</div>
<div id="homeworkSummary" class="report-summary"></div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>序号</th>
<th>学号</th>
<th>姓名</th>
<th>已交</th>
<th>未交</th>
<th>迟交</th>
<th>记录数</th>
<th>未交率</th>
</tr>
</thead>
<tbody id="homeworkReportList"></tbody>
</table>
</div>
</div>
</div>
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
<script src="/assets/js/reports.js"></script>
<?php include __DIR__ . '/../includes/footer.php'; ?>