Files
SharedClassManager/frontend/admin/cadre_homework.php
canglan c6db68a9f4 feat: 多班级版班级管理系统 v2.0
技术栈:Go (Gin + GORM) + PHP + MySQL 5.7 + Redis

主要功能:
- 多班级完全隔离(class_id 贯穿全系统)
- 后端 Go Gin(端口 56789),Nginx 反代
- 超级管理员独立登录(env 配置,默认账密 admin/Admin123)
- bcrypt 密码加密(无 PASSWORD_SALT)
- 科任老师/课代表新角色
- 课代表作业管理页面
- 排行榜分项排行(操行分/考勤/作业)
- 角色加减分上下限由班主任配置
- 家长改密功能(可开关)
- 班级角色按需开关
- 宿舍号格式:南0-000
- 周度/月度重置功能
- MySQL 5.7 兼容
- 43 轮代码审查 + 全部修复

开发者: Canglan
版权归属: Sea Network Technology Studio
许可证: Apache License 2.0
2026-06-23 16:02:28 +08:00

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')">&times;</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')">&times;</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'; ?>