- 后端从 Python FastAPI 重写为 Go Gin(端口 56789) - 多班级完全隔离 - 超级管理员独立登录 - 课代表作业管理、排行榜分项排行 - 角色加减分上下限可配置 - 家长改密功能(可开关) - 周度/月度重置功能 - MySQL 5.7 兼容 - 43轮代码审查+全部修复 - Apache 2.0 许可证
126 lines
4.2 KiB
PHP
126 lines
4.2 KiB
PHP
<?php
|
|
/**
|
|
* 多班级版班级管理系统 - 课代表作业管理页
|
|
*
|
|
* 开发者: Canglan
|
|
* 联系方式: admin@sea-studio.top
|
|
* 版权归属: Sea Network Technology Studio
|
|
* 许可证: Apache License 2.0
|
|
*
|
|
* 版权所有 © Sea Network Technology Studio
|
|
*/
|
|
|
|
$page_title = '作业管理';
|
|
require_once __DIR__ . '/../config.php';
|
|
|
|
if (!isset($_SESSION['user_id']) || $_SESSION['user_type'] !== 'admin') {
|
|
header('Location: /index.php');
|
|
exit();
|
|
}
|
|
|
|
$role = $_SESSION['role'] ?? '';
|
|
if ($role !== '课代表') {
|
|
header('Location: /admin/dashboard.php');
|
|
exit();
|
|
}
|
|
|
|
require_once __DIR__ . '/../includes/header.php';
|
|
require_once __DIR__ . '/../includes/nav.php';
|
|
?>
|
|
|
|
<div class="container">
|
|
<div class="page-header">
|
|
<h2>作业管理</h2>
|
|
<p class="text-muted">课代表可管理所代表科目的作业缺交情况</p>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="action-bar">
|
|
<div class="action-buttons">
|
|
<button class="btn btn-primary" onclick="showPublishModal()">发布作业</button>
|
|
</div>
|
|
</div>
|
|
<div class="table-wrapper">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>作业标题</th>
|
|
<th>科目</th>
|
|
<th>截止日期</th>
|
|
<th>描述</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="homeworkList">
|
|
<tr><td colspan="5" style="text-align:center;">加载中...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="pagination" id="pagination" style="display:none;">
|
|
<button class="btn btn-sm" id="prevBtn" onclick="changePage(-1)">上一页</button>
|
|
<span id="pageInfo">1 / 1</span>
|
|
<button class="btn btn-sm" id="nextBtn" onclick="changePage(1)">下一页</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 发布作业模态框 -->
|
|
<div id="publishModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3>发布作业</h3>
|
|
<button class="modal-close" onclick="closeModal('publishModal')">×</button>
|
|
</div>
|
|
<form id="publishForm" onsubmit="event.preventDefault(); submitHomework()">
|
|
<div class="form-group">
|
|
<label>作业标题 <span style="color:red;">*</span></label>
|
|
<input type="text" id="hwTitle" required placeholder="例如:第三章练习">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>截止日期 <span style="color:red;">*</span></label>
|
|
<input type="date" id="hwDeadline" required value="<?php echo date('Y-m-d'); ?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>描述</label>
|
|
<textarea id="hwDescription" rows="3" placeholder="选填,作业详细说明"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="submit" class="btn btn-primary">发布</button>
|
|
<button type="button" class="btn" onclick="closeModal('publishModal')">取消</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 缺交登记模态框 -->
|
|
<div id="absentModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3>登记缺交学生</h3>
|
|
<button class="modal-close" onclick="closeModal('absentModal')">×</button>
|
|
</div>
|
|
<div id="absentStudentList"></div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-primary" onclick="submitAbsent()">提交缺交记录</button>
|
|
<button class="btn" onclick="closeModal('absentModal')">取消</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 15px;
|
|
margin-top: 15px;
|
|
padding: 10px 0;
|
|
}
|
|
.pagination .btn { padding: 6px 16px; font-size: 13px; }
|
|
.pagination span { color: #666; font-size: 14px; }
|
|
</style>
|
|
|
|
<script src="/assets/js/cadre-homework.js"></script>
|
|
|
|
<?php require_once __DIR__ . '/../includes/footer.php'; ?>
|