69 lines
1.9 KiB
PHP
69 lines
1.9 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 active">首页</a>
|
|
<a href="/parent/attendance.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>
|
|
<div class="card">
|
|
<div class="conduct-score">
|
|
<div class="score-number" id="totalPoints">--</div>
|
|
<div class="score-label">当前操行分</div>
|
|
</div>
|
|
</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; }
|
|
.score-number { font-size: 72px; font-weight: bold; color: #667eea; text-align: center; }
|
|
</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;
|
|
}
|
|
}
|
|
loadDashboard();
|
|
</script>
|
|
<script src="/assets/js/parent.js"></script>
|
|
|
|
<?php include __DIR__ . '/../includes/footer.php'; ?>
|