技术栈:Go (Gin + GORM) + PHP + MySQL 5.7 + Redis 主要功能: - 多班级完全隔离(class_id 贯穿全系统) - 后端从 Python FastAPI 重写为 Go Gin(端口 56789) - 超级管理员独立登录(env 配置路径,默认账密 admin/Admin123) - 科任老师/课代表新角色 - 课代表作业管理页面 - 排行榜分项排行(操行分/考勤/作业) - 角色加减分上下限由班主任配置 - 家长改密功能(可开关) - 班级角色按需开关 - 宿舍号格式:南0-000 - 周度/月度重置功能 - MySQL 5.7 兼容 - Nginx 反向代理部署 开发者: Canglan 版权归属: Sea Network Technology Studio 许可证: Apache License 2.0
154 lines
6.8 KiB
PHP
154 lines
6.8 KiB
PHP
<?php
|
||
/**
|
||
* 多班级版班级管理系统 - 管理端操行分管理
|
||
*
|
||
* 开发者: Canglan
|
||
* 联系方式: admin@sea-studio.top
|
||
* 版权归属: Sea Network Technology Studio
|
||
* 许可证: Apache License 2.0
|
||
*
|
||
* 版权所有 © 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 = $_SESSION['role'] ?? '';
|
||
|
||
if (!in_array($role, ['班主任', '班长', '学习委员', '考勤委员', '劳动委员', '志愿委员', '科任老师'])) {
|
||
header('Location: /admin/dashboard.php');
|
||
exit();
|
||
}
|
||
|
||
include __DIR__ . '/../includes/header.php';
|
||
?>
|
||
|
||
<?php include __DIR__ . '/../includes/nav.php'; ?>
|
||
|
||
<div class="container">
|
||
<div class="card">
|
||
<div class="action-bar">
|
||
<div class="action-buttons">
|
||
<button class="btn btn-primary" onclick="showBatchPointsModal()">批量加减分</button>
|
||
<button class="btn btn-secondary" onclick="showDormitoryPointsModal()">宿舍加分</button>
|
||
<?php if ($role === '班主任'): ?>
|
||
<button class="btn btn-secondary" onclick="exportMoralityRecords()">导出德育分记录</button>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="table-wrapper">
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<th><input type="checkbox" id="selectAll" onclick="toggleSelectAll()"></th>
|
||
<th>学号</th>
|
||
<th>姓名</th>
|
||
<th>当前操行分</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="studentList"></tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="/assets/js/modules/modal-utils.js"></script>
|
||
<script src="/assets/js/modules/utils.js"></script>
|
||
<script src="/assets/js/modules/points-mgmt.js"></script>
|
||
<script src="/assets/js/conduct.js"></script>
|
||
|
||
<!-- 批量加减分模态框 -->
|
||
<div id="batchPointsModal" class="modal">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3>批量加减分</h3>
|
||
<button class="modal-close" onclick="closeModal('batchPointsModal')">×</button>
|
||
</div>
|
||
<form onsubmit="event.preventDefault(); submitBatchPoints()">
|
||
<div class="form-group">
|
||
<label>选中学生</label>
|
||
<div id="selectedStudentsCount">0 人</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>扣分类型</label>
|
||
<div class="deduction-types" style="display: flex; flex-wrap: wrap; gap: 6px;">
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '卫生')">卫生</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '课堂')">课堂</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '纪律')">纪律</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '作业')">作业</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '考勤')">考勤</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '劳动')">劳动</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(null, '志愿')">志愿</button>
|
||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(0, '')">自定义</button>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>分数变动</label>
|
||
<input type="number" id="pointsChange" required placeholder="正数为加分,负数为扣分">
|
||
<small><?php
|
||
$hints = [
|
||
'班长' => '班长单次±5分以内',
|
||
'学习委员' => '学习委员单次±5分以内',
|
||
'考勤委员' => '考勤委员仅限扣分,单次最多扣8分',
|
||
'劳动委员' => '劳动委员单次±1分以内',
|
||
'志愿委员' => '志愿委员仅限加分,最多+5分',
|
||
];
|
||
echo $hints[$role] ?? '班主任无限制';
|
||
?></small>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>原因</label>
|
||
<textarea id="pointsReason" required rows="3" placeholder="请填写加减分原因"></textarea>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="submit" class="btn btn-primary">确认提交</button>
|
||
<button type="button" class="btn" onclick="closeModal('batchPointsModal')">取消</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 宿舍集体加分模态框 -->
|
||
<div id="dormitoryPointsModal" class="modal">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3>宿舍集体加分</h3>
|
||
<button class="modal-close" onclick="closeModal('dormitoryPointsModal')">×</button>
|
||
</div>
|
||
<form onsubmit="event.preventDefault(); submitDormitoryPoints()">
|
||
<div class="form-group">
|
||
<label>选择宿舍</label>
|
||
<select id="dormitorySelect" onchange="onDormitorySelected()" required>
|
||
<option value="">-- 请选择宿舍 --</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group" id="dormitoryStudentsGroup" style="display:none;">
|
||
<label>宿舍成员</label>
|
||
<div id="dormitoryStudentsList" style="max-height: 150px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 4px; padding: 8px;">
|
||
</div>
|
||
<small id="dormitoryStudentsCount"></small>
|
||
</div>
|
||
<div class="form-group">
|
||
<label>分数变动</label>
|
||
<input type="number" id="dormitoryPointsChange" required placeholder="正数为加分,负数为扣分">
|
||
</div>
|
||
<div class="form-group">
|
||
<label>原因</label>
|
||
<textarea id="dormitoryPointsReason" required rows="3" placeholder="请填写加减分原因"></textarea>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="submit" class="btn btn-primary">确认提交</button>
|
||
<button type="button" class="btn" onclick="closeModal('dormitoryPointsModal')">取消</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<?php include __DIR__ . '/../includes/footer.php'; ?>
|