v4.0 权限组重构与导出/个人查询优化
1. 权限重构:自定义权限组(14项功能权限+允许加分/加分上限/允许扣分/扣分上限),管理员账号绑定权限组,预置六组且班主任组锁定;全站前后端改为权限驱动,权限变更60秒内自动生效 2. 新增班主任导出学生名单(导出前自选字段) 3. 加减分/考勤上限改为按权限组动态校验,弹窗实时提示并限制输入 4. 导出按学期隔离(默认当前学期,可选历史/全部),历史导出不再受1000条限制 5. 新增管理端个人查询:基础分/加分/扣分/月度分/月度理由汇总及明细导出 6. 版本升级至4.0(sql/upgrades/v4.0.sql)
This commit is contained in:
1 parent
3067542e53
commit
3588b4c28c
55 files changed
+2846
-801
No files matched your search
+72
-22
@@ -17,11 +17,8 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
if ($role !== '班主任') {
|
||||
header('Location: /admin/dashboard.php');
|
||||
exit();
|
||||
}
|
||||
$role = current_group_name();
|
||||
require_perm('manage_admins');
|
||||
|
||||
$page_title = '管理员管理';
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
@@ -37,12 +34,26 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr><th>用户名</th><th>姓名</th><th>角色</th><th>状态</th><th>操作</th></tr>
|
||||
<tr><th>用户名</th><th>姓名</th><th>权限组</th><th>加减分上限</th><th>状态</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody id="adminList"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="action-bar">
|
||||
<button class="btn btn-primary" onclick="showAddGroupModal()">新建权限组</button>
|
||||
</div>
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr><th>权限组</th><th>权限项</th><th>加分</th><th>扣分</th><th>成员</th><th>说明</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody id="groupList"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加管理员模态框 -->
|
||||
@@ -67,14 +78,9 @@ include __DIR__ . '/../includes/header.php';
|
||||
<small>自动生成8位随机密码</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>角色</label>
|
||||
<select id="adminRole" required>
|
||||
<option value="">请选择角色</option>
|
||||
<option value='班长'>班长</option>
|
||||
<option value='学习委员'>学习委员</option>
|
||||
<option value='考勤委员'>考勤委员</option>
|
||||
<option value='劳动委员'>劳动委员</option>
|
||||
<option value='志愿委员'>志愿委员</option>
|
||||
<label>权限组</label>
|
||||
<select id="adminGroupId" required>
|
||||
<option value="">请选择权限组</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -103,14 +109,9 @@ include __DIR__ . '/../includes/header.php';
|
||||
<input type="text" id="editAdminRealName" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>角色</label>
|
||||
<select id="editAdminRole" required>
|
||||
<option value="">请选择角色</option>
|
||||
<option value='班长'>班长</option>
|
||||
<option value='学习委员'>学习委员</option>
|
||||
<option value='考勤委员'>考勤委员</option>
|
||||
<option value='劳动委员'>劳动委员</option>
|
||||
<option value='志愿委员'>志愿委员</option>
|
||||
<label>权限组</label>
|
||||
<select id="editAdminGroupId" required>
|
||||
<option value="">请选择权限组</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -121,6 +122,55 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 权限组模态框 -->
|
||||
<div id="groupModal" class="modal">
|
||||
<div class="modal-content" style="max-width: 640px;">
|
||||
<div class="modal-header">
|
||||
<h3 id="groupModalTitle">新建权限组</h3>
|
||||
<button class="modal-close" onclick="closeModal('groupModal')">×</button>
|
||||
</div>
|
||||
<form onsubmit="event.preventDefault(); submitGroupForm()">
|
||||
<input type="hidden" id="editGroupId">
|
||||
<div class="form-group">
|
||||
<label>权限组名称 <span style="color:red;">*</span></label>
|
||||
<input type="text" id="groupName" required maxlength="50" placeholder="如:纪律委员">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>说明</label>
|
||||
<input type="text" id="groupDescription" maxlength="255" placeholder="选填">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>权限项</label>
|
||||
<div id="groupPermissionList" style="display:grid; grid-template-columns: repeat(2, 1fr); gap:8px;"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>加减分上限</label>
|
||||
<div style="display:flex; flex-wrap:wrap; gap:16px; align-items:center;">
|
||||
<label style="display:flex; align-items:center; gap:6px;">
|
||||
<input type="checkbox" id="groupCanAdd" checked onchange="onGroupCapChange()"> 允许加分
|
||||
</label>
|
||||
<label style="display:flex; align-items:center; gap:6px;">
|
||||
单次加分上限
|
||||
<input type="number" id="groupMaxAdd" min="1" max="100" style="width:90px;" placeholder="留空=不限">
|
||||
</label>
|
||||
<label style="display:flex; align-items:center; gap:6px;">
|
||||
<input type="checkbox" id="groupCanSubtract" checked onchange="onGroupCapChange()"> 允许扣分
|
||||
</label>
|
||||
<label style="display:flex; align-items:center; gap:6px;">
|
||||
单次扣分上限
|
||||
<input type="number" id="groupMaxSubtract" min="1" max="100" style="width:90px;" placeholder="留空=不限">
|
||||
</label>
|
||||
</div>
|
||||
<small>上限必须在1-100之间,留空表示无限制</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
<button type="button" class="btn" onclick="closeModal('groupModal')">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 重置密码模态框 -->
|
||||
<div id="resetPasswordModal" class="modal">
|
||||
<div class="modal-content">
|
||||
|
||||
@@ -18,12 +18,8 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
}
|
||||
|
||||
$page_title = '考勤管理';
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
|
||||
if (!in_array($role, ['班主任', '考勤委员'])) {
|
||||
header('Location: /admin/dashboard.php');
|
||||
exit();
|
||||
}
|
||||
$role = current_group_name();
|
||||
require_perm('manage_attendance');
|
||||
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
|
||||
+26
-18
@@ -18,12 +18,7 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
}
|
||||
|
||||
$page_title = '操行分管理';
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
|
||||
if (!in_array($role, ['班主任', '班长', '学习委员', '考勤委员', '劳动委员', '志愿委员'])) {
|
||||
header('Location: /admin/dashboard.php');
|
||||
exit();
|
||||
}
|
||||
$role = current_group_name();
|
||||
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
@@ -34,10 +29,12 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="card">
|
||||
<div class="action-bar">
|
||||
<div class="action-buttons">
|
||||
<?php if (has_perm('manage_conduct')): ?>
|
||||
<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; ?>
|
||||
<?php if (has_perm('export_data')): ?>
|
||||
<button class="btn btn-secondary" onclick="showExportMoralityModal()">导出德育分记录</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,6 +56,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
|
||||
<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>
|
||||
@@ -92,16 +90,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<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>
|
||||
<small id="pointsLimitHint"></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>原因</label>
|
||||
@@ -115,6 +104,25 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 导出德育分记录模态框 -->
|
||||
<div id="exportMoralityModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>导出德育分记录</h3>
|
||||
<button class="modal-close" onclick="closeModal('exportMoralityModal')">×</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>学期范围</label>
|
||||
<select id="exportSemesterSelect"></select>
|
||||
<small>默认导出当前学期,避免混入以往学期的记录;可选择某个历史学期或全部学期。</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="exportMoralityRecords()">开始导出</button>
|
||||
<button type="button" class="btn" onclick="closeModal('exportMoralityModal')">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 宿舍集体加分模态框 -->
|
||||
<div id="dormitoryPointsModal" class="modal">
|
||||
<div class="modal-content">
|
||||
|
||||
@@ -52,7 +52,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<?php if (has_perm('manage_upgrade')): ?>
|
||||
<!-- 升级提示模态框 -->
|
||||
<div id="upgradeModal" class="modal" style="display:none;">
|
||||
<div class="modal-content" style="max-width:520px;">
|
||||
@@ -79,10 +79,10 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo $role; ?>' };</script>
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
|
||||
<script src="/assets/js/dashboard.js"></script>
|
||||
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<?php if (has_perm('manage_upgrade')): ?>
|
||||
<script>
|
||||
(function() {
|
||||
var upgradeSteps = [];
|
||||
|
||||
@@ -32,7 +32,13 @@ include __DIR__ . '/../includes/header.php';
|
||||
<label class="history-grouped-label">
|
||||
<input type="checkbox" id="historyGrouped" checked onchange="loadHistory(1)"> 批次合并
|
||||
</label>
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<label class="history-grouped-label" style="display:flex; align-items:center; gap:6px;">
|
||||
学期
|
||||
<select id="historySemesterFilter" onchange="loadHistory(1)" style="padding:4px 8px; border:1px solid var(--color-border); border-radius:4px;">
|
||||
<option value="">全部学期</option>
|
||||
</select>
|
||||
</label>
|
||||
<?php if (has_perm('export_data')): ?>
|
||||
<button class="btn btn-secondary" onclick="exportHistoryRecords()">导出</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -76,7 +82,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<option value="志愿">志愿</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php if ($role === '班主任' || $role === '班长'): ?>
|
||||
<?php if (has_perm('revoke_any') || has_perm('restore_records')): ?>
|
||||
<div class="filter-group">
|
||||
<label>状态</label>
|
||||
<select id="historyStatusFilter">
|
||||
@@ -99,7 +105,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<th>学生</th>
|
||||
<th style="white-space: nowrap; min-width: 80px;">操作人</th>
|
||||
<th>时间</th>
|
||||
<?php if ($role === '班主任' || $role === '班长' || $role === '考勤委员'): ?>
|
||||
<?php if (has_perm('revoke_any') || has_perm('revoke_own')): ?>
|
||||
<th>操作</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
|
||||
@@ -18,12 +18,8 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
}
|
||||
|
||||
$page_title = '作业扣分';
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
|
||||
if (!in_array($role, ['班主任', '学习委员'])) {
|
||||
header('Location: /admin/dashboard.php');
|
||||
exit();
|
||||
}
|
||||
$role = current_group_name();
|
||||
require_perm('manage_homework');
|
||||
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
@@ -31,6 +27,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<?php include __DIR__ . '/../includes/nav.php'; ?>
|
||||
|
||||
<div class="container">
|
||||
<?php if (has_perm('manage_subjects')): ?>
|
||||
<!-- 科目管理折叠面板 -->
|
||||
<div class="card collapsible-card" style="margin-bottom: 20px;">
|
||||
<div class="collapsible-header" id="subjectPanelHeader">
|
||||
@@ -44,6 +41,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div id="subjectList" class="subject-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="action-bar">
|
||||
@@ -79,14 +77,12 @@ include __DIR__ . '/../includes/header.php';
|
||||
<label>已选学生</label>
|
||||
<div id="selectedStudentsCount" class="selected-info">未选择学生</div>
|
||||
</div>
|
||||
<?php if (in_array($role, ['班主任', '学习委员'])): ?>
|
||||
<div class="form-group">
|
||||
<label>科目</label>
|
||||
<select id="hwSubjectSelect">
|
||||
<option value="">不选择科目</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group">
|
||||
<label>扣分类型</label>
|
||||
<div class="deduction-types" style="display: flex; flex-wrap: wrap; gap: 6px;">
|
||||
@@ -98,7 +94,6 @@ include __DIR__ . '/../includes/header.php';
|
||||
<button type="button" class="btn btn-sm" onclick="selectDeductionType(0, '')">自定义</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (in_array($role, ['班主任', '学习委员'])): ?>
|
||||
<div class="form-group">
|
||||
<label>具体作业</label>
|
||||
<input type="text" id="hwTitle" placeholder="选填,如:第三章练习">
|
||||
@@ -107,14 +102,10 @@ include __DIR__ . '/../includes/header.php';
|
||||
<label>缴交时间</label>
|
||||
<input type="date" id="hwDeadline" value="<?php echo date('Y-m-d'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group">
|
||||
<label>分数变动</label>
|
||||
<input type="number" id="pointsChange" required min="-5" max="5" step="1" placeholder="正数加分,负数扣分">
|
||||
<small><?php
|
||||
if ($role === '学习委员') echo '学习委员单次±5分以内';
|
||||
else echo '班主任无限制';
|
||||
?></small>
|
||||
<input type="number" id="pointsChange" required step="1" placeholder="正数加分,负数扣分">
|
||||
<small class="hw-max"></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>原因</label>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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_all_records');
|
||||
|
||||
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" style="min-width: 220px;">
|
||||
<label>学生</label>
|
||||
<select id="queryStudentId" onchange="onQueryStudentChange()">
|
||||
<option value="">-- 请选择学生 --</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group">
|
||||
<label>学期</label>
|
||||
<select id="querySemesterId" onchange="onQuerySemesterChange()"></select>
|
||||
</div>
|
||||
<div class="filter-group" style="flex: 0 0 auto;">
|
||||
<button class="btn btn-primary" onclick="queryStudentRecords(1)">查询</button>
|
||||
</div>
|
||||
<div class="filter-group" style="flex: 0 0 auto;">
|
||||
<button class="btn btn-secondary" onclick="exportStudentRecords()">导出个人记录</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="queryPlaceholder" style="text-align: center; color: var(--color-text-secondary); padding: 32px 0;">
|
||||
请选择学生后点击“查询”,查看基础分、加分、月度分及月度加减分理由汇总
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="queryResult" style="display: none;">
|
||||
<div class="card">
|
||||
<div class="card-title" id="queryStudentTitle">学生汇总</div>
|
||||
<div class="stats-grid" id="querySummaryCards"></div>
|
||||
<div id="querySummaryHint" style="font-size: 12px; color: var(--color-text-secondary);"></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">月度操行分</div>
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>月份</th>
|
||||
<th>月初分</th>
|
||||
<th>加分</th>
|
||||
<th>减分</th>
|
||||
<th>月末分</th>
|
||||
<th>记录数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="queryMonthlyList"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">月度加减分理由汇总</div>
|
||||
<div id="queryReasonSummary"></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">明细记录</div>
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>类型</th>
|
||||
<th>分值</th>
|
||||
<th>原因</th>
|
||||
<th>操作人</th>
|
||||
<th style="white-space: nowrap;">时间</th>
|
||||
<?php if (has_perm('revoke_any') || has_perm('revoke_own')): ?>
|
||||
<th>状态/操作</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="queryRecordList"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pagination" id="queryPagination"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>', userId: <?php echo intval($_SESSION['user_id']); ?> };</script>
|
||||
<script src="/assets/js/modules/modal-utils.js"></script>
|
||||
<script src="/assets/js/modules/utils.js"></script>
|
||||
<script src="/assets/js/record-query.js"></script>
|
||||
|
||||
<?php include __DIR__ . '/../includes/footer.php'; ?>
|
||||
@@ -17,11 +17,8 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
if ($role !== '班主任') {
|
||||
header('Location: /admin/dashboard.php');
|
||||
exit();
|
||||
}
|
||||
$role = current_group_name();
|
||||
require_perm('manage_semesters');
|
||||
|
||||
$page_title = '学期管理';
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
|
||||
+36
-14
@@ -18,7 +18,7 @@ if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
||||
}
|
||||
|
||||
$page_title = '学生管理';
|
||||
$role = $_SESSION['role'] ?? '';
|
||||
$role = current_group_name();
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
|
||||
@@ -28,10 +28,13 @@ include __DIR__ . '/../includes/header.php';
|
||||
<div class="card">
|
||||
<div class="action-bar">
|
||||
<div class="action-buttons">
|
||||
<?php if ($role === '班主任'): ?>
|
||||
<?php if (has_perm('manage_students')): ?>
|
||||
<button class="btn btn-primary" onclick="showImportModal()">导入学生</button>
|
||||
<button class="btn btn-primary" onclick="showAddStudentModal()">新增学生</button>
|
||||
<?php endif; ?>
|
||||
<?php if (has_perm('export_students')): ?>
|
||||
<button class="btn btn-secondary" onclick="showExportStudentsModal()">导出学生名单</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<input type="text" id="searchInput" placeholder="搜索姓名/学号">
|
||||
@@ -48,7 +51,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<th>姓名</th>
|
||||
<th>宿舍号</th>
|
||||
<th>操行分</th>
|
||||
<?php if ($role === '班主任'): ?><th>家长手机号</th><?php endif; ?>
|
||||
<?php if (has_perm('manage_students')): ?><th>家长手机号</th><?php endif; ?>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -170,13 +173,41 @@ include __DIR__ . '/../includes/header.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo $role; ?>' };</script>
|
||||
<script>window.PAGE_CONFIG = { role: '<?php echo htmlspecialchars($role, ENT_QUOTES, 'UTF-8'); ?>' };</script>
|
||||
<script src="/assets/js/modules/modal-utils.js"></script>
|
||||
<script src="/assets/js/modules/utils.js"></script>
|
||||
<script src="/assets/js/modules/student-mgmt.js"></script>
|
||||
<script src="/assets/js/modules/points-mgmt.js"></script>
|
||||
<script src="/assets/js/students-manage.js"></script>
|
||||
|
||||
<!-- 导出学生名单模态框 -->
|
||||
<div id="exportStudentsModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>导出学生名单</h3>
|
||||
<button class="modal-close" onclick="closeModal('exportStudentsModal')">×</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>导出字段</label>
|
||||
<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:8px;">
|
||||
<label><input type="checkbox" class="export-student-col" value="student_no" checked disabled> 学号</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="name" checked disabled> 姓名</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="dormitory_number" checked> 宿舍号</label>
|
||||
<label><input type="checkbox" class="export-student-col" value="total_points" checked> 当前操行分</label>
|
||||
<?php if (has_perm('manage_students')): ?>
|
||||
<label><input type="checkbox" class="export-student-col" value="parent_phone"> 家长手机号</label>
|
||||
<?php endif; ?>
|
||||
<label><input type="checkbox" class="export-student-col" value="status" checked> 状态</label>
|
||||
</div>
|
||||
<small>导出全班学生名单(CSV,可用Excel打开)</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="exportStudents()">开始导出</button>
|
||||
<button type="button" class="btn" onclick="closeModal('exportStudentsModal')">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 批量加减分模态框(共用) -->
|
||||
<div id="batchPointsModal" class="modal">
|
||||
<div class="modal-content">
|
||||
@@ -192,16 +223,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
<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>
|
||||
<small id="pointsLimitHint"></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>原因</label>
|
||||
|
||||
Reference in new issue
Block a user