66 lines
2.0 KiB
PHP
66 lines
2.0 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'] !== 'parent') {
|
|
header('Location: /index.php');
|
|
exit();
|
|
}
|
|
|
|
$page_title = '作业情况';
|
|
include __DIR__ . '/../includes/header.php';
|
|
?>
|
|
|
|
<div class="nav">
|
|
<a href="/parent/dashboard.php" class="nav-item">首页</a>
|
|
<a href="/parent/homework.php" class="nav-item active">作业情况</a>
|
|
<a href="/parent/attendance.php" class="nav-item">考勤记录</a>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<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></tr></thead>
|
|
<tbody id="homeworkList"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
async function loadHomework() {
|
|
const res = await apiGet('/api/parent/child/homework');
|
|
if (res && res.success) {
|
|
let html = '';
|
|
res.data.homework.forEach(hw => {
|
|
html += `<tr>
|
|
<td>${escapeHtml(hw.subject)}</td>
|
|
<td>${escapeHtml(hw.title)}</td>
|
|
<td>${hw.deadline}</td>
|
|
<td>${getStatusBadge(hw.status, 'homework')}</td>
|
|
<td>${escapeHtml(hw.comments || '-')}</td>
|
|
</tr>`;
|
|
});
|
|
if (res.data.homework.length === 0) {
|
|
html = '<tr><td colspan="5" style="text-align:center;">暂无作业</td></tr>';
|
|
}
|
|
document.getElementById('homeworkList').innerHTML = html;
|
|
}
|
|
}
|
|
loadHomework();
|
|
</script>
|
|
<script src="/assets/js/parent.js"></script>
|
|
|
|
<?php include __DIR__ . '/../includes/footer.php'; ?>
|