feat: 熱舞社報名後台

This commit is contained in:
2026-08-02 23:24:48 +08:00
parent 44c9cc6fe2
commit 1e2e935688
13 changed files with 542 additions and 17 deletions
+47
View File
@@ -183,6 +183,51 @@ function status_label(string $status): string
return ['draft' => '草稿', 'coming_soon' => '籌備中', 'published' => '公開', 'archived' => '封存', 'available' => '可使用'][$status] ?? $status;
}
function dance_application_statuses(): array
{
return [
'new' => '新報名',
'contacted' => '已聯絡',
'confirmed' => '確認參與',
'declined' => '暫不參與',
'archived' => '已封存',
];
}
function dance_attendance_label(?string $value): string
{
return [
'attended' => '參加過 20TH',
'watched_video' => '看過 20TH 影片',
'first_time' => '第一次知道',
][$value ?? ''] ?? '未填寫';
}
function dance_song_label(?string $value): string
{
return [
'couple' => 'Couple',
'comeback' => "Com' Back",
'road_fighter' => 'Road Fighter',
'pom_saeng_pom_sa' => 'Pom Saeng Pom Sa',
'other' => '其他',
][$value ?? ''] ?? '未選擇';
}
function dance_content_labels(?string $value): array
{
$labels = [
'cover' => '翻跳',
'medley' => '串燒聯舞',
'blessing' => '祝福影片',
'graphic' => '圖文應援',
'editing' => '影片剪輯',
'archive' => '資料整理',
];
$selected = array_filter(array_map('trim', explode(',', (string) $value)));
return array_map(static fn (string $item): string => $labels[$item] ?? $item, $selected);
}
function audit(string $action, string $entityType, ?int $entityId, array $details = []): void
{
$stmt = db()->prepare('INSERT INTO audit_logs (admin_user_id, action_name, entity_type, entity_id, details_json, ip_address) VALUES (?, ?, ?, ?, ?, ?)');
@@ -220,6 +265,8 @@ function render_header(string $title, string $active = ''): void
<?php foreach ($mods as $key => $mod): ?>
<a class="<?= $active === $key ? 'active' : '' ?>" href="records.php?module=<?= h($key) ?>"><i class="bi bi-<?= h($mod['icon']) ?>"></i><?= h($mod['label']) ?></a>
<?php endforeach; ?>
<p>水晶熱舞社</p>
<a class="<?= $active === 'dance-applications' ? 'active' : '' ?>" href="dance-applications.php"><i class="bi bi-person-hearts"></i>30TH 應援報名</a>
<p>系統</p>
<a class="<?= $active === 'publishing' ? 'active' : '' ?>" href="publishing.php"><i class="bi bi-eye"></i>公開狀態</a>
<a class="<?= $active === 'admins' ? 'active' : '' ?>" href="admins.php"><i class="bi bi-shield-lock"></i>管理者帳號</a>