prepare('SELECT * FROM dance_applications WHERE id = ?'); $stmt->execute([$id]); $application = $stmt->fetch(); if (!$application) { http_response_code(404); exit('找不到這筆報名資料。'); } $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { verify_csrf(); $status = trim((string) ($_POST['status'] ?? '')); $adminNotes = mb_substr(trim((string) ($_POST['admin_notes'] ?? '')), 0, 5000, 'UTF-8'); if (!isset($statusOptions[$status])) { $error = '請選擇有效的處理狀態。'; } else { $update = db()->prepare('UPDATE dance_applications SET status = ?, admin_notes = ? WHERE id = ?'); $update->execute([$status, $adminNotes !== '' ? $adminNotes : null, $id]); audit('update', 'dance_applications', $id, ['status' => $status, 'admin_notes' => $adminNotes]); flash('success', '報名資料的處理狀態已更新。'); redirect('dance-application.php?id=' . $id); } } render_header('處理熱舞社報名 #' . $id, 'dance-applications'); ?>
送出於 = h($application['created_at']) ?>