ALWISP Staff Portal

Database connection failed: ' . htmlspecialchars($e->getMessage()) . '

'); } // Mark a single message as read if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['mark_read'])) { $db->prepare("UPDATE contacts SET is_read = 1 WHERE id = ?")->execute([(int)$_POST['mark_read']]); header('Location: /staff-portal'); exit; } // Mark all as read if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['mark_all_read'])) { $db->exec("UPDATE contacts SET is_read = 1"); header('Location: /staff-portal'); exit; } // ── Fetch messages ──────────────────────────────────────────────────────── $messages = $db->query("SELECT * FROM contacts ORDER BY created_at DESC")->fetchAll(); $unread_count = (int)$db->query("SELECT COUNT(*) FROM contacts WHERE is_read = 0")->fetchColumn(); $subject_labels = [ 'new-service' => 'New Service Inquiry', 'support' => 'Technical Support', 'billing' => 'Billing Question', 'coverage' => 'Coverage Question', 'other' => 'Other', ]; function h(string $s): string { return htmlspecialchars($s, ENT_QUOTES); } ?> <?= $unread_count ? "($unread_count) " : '' ?>Inbox – ALWISP Staff
ALWISP Staff Portal
0): ?>
Sign out
unread total submission
📭

No messages yet. They'll show up here once someone submits the contact form.