技术栈: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
101 lines
3.2 KiB
PHP
101 lines
3.2 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'] !== 'parent') {
|
|
header('Location: /index.php');
|
|
exit();
|
|
}
|
|
|
|
$page_title = '首页';
|
|
include __DIR__ . '/../includes/header.php';
|
|
?>
|
|
|
|
<div class="nav">
|
|
<a href="/parent/dashboard.php" class="nav-item active">首页</a>
|
|
<a href="/parent/history.php" class="nav-item">历史记录</a>
|
|
<a href="/parent/attendance.php" class="nav-item">考勤记录</a>
|
|
<a href="/parent/password.php" class="nav-item">修改密码</a>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="child-info">
|
|
<div class="child-name" id="childName">--</div>
|
|
<div class="child-no" id="childNo">--</div>
|
|
<div class="child-no" id="childDormitory" style="display:none;"></div>
|
|
</div>
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<div class="stat-label">当前操行分</div>
|
|
<div class="stat-value" id="totalPoints">--</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div class="stat-label">班级排名</div>
|
|
<div class="stat-value" id="studentRank">--</div>
|
|
</div>
|
|
</div>
|
|
<div class="initial-points-hint" id="initialPointsHint"></div>
|
|
</div>
|
|
|
|
<style>
|
|
.child-info {
|
|
text-align: center;
|
|
padding: 20px;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
border-radius: 12px;
|
|
color: white;
|
|
margin-bottom: 20px;
|
|
}
|
|
.child-name { font-size: 24px; font-weight: bold; margin-bottom: 8px; }
|
|
.child-no { font-size: 14px; opacity: 0.9; }
|
|
.initial-points-hint {
|
|
text-align: center;
|
|
color: #999;
|
|
font-size: 13px;
|
|
margin-top: 8px;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
async function loadDashboard() {
|
|
const res = await apiGet('/api/parent/child/conduct');
|
|
if (res && res.success) {
|
|
document.getElementById('childName').textContent = res.data.student_name;
|
|
document.getElementById('childNo').textContent = res.data.student_no;
|
|
document.getElementById('totalPoints').textContent = res.data.total_points;
|
|
if (res.data.dormitory_number) {
|
|
document.getElementById('childDormitory').textContent = '宿舍号: ' + res.data.dormitory_number;
|
|
document.getElementById('childDormitory').style.display = '';
|
|
}
|
|
}
|
|
|
|
// 加载排名信息
|
|
const rankRes = await apiGet('/api/parent/child/ranking');
|
|
if (rankRes && rankRes.success) {
|
|
const rank = rankRes.data.rank;
|
|
if (rank) {
|
|
document.getElementById('studentRank').textContent = `第${rank}名`;
|
|
} else {
|
|
document.getElementById('studentRank').textContent = '--';
|
|
}
|
|
}
|
|
|
|
// 显示初始分提示
|
|
const initialPoints = window.STUDENT_INITIAL_POINTS || 60;
|
|
document.getElementById('initialPointsHint').textContent = `初始操行分为 ${initialPoints} 分`;
|
|
}
|
|
loadDashboard();
|
|
</script>
|
|
<script src="/assets/js/parent.js"></script>
|
|
|
|
<?php include __DIR__ . '/../includes/footer.php'; ?>
|