<?php
session_start();
if(!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true){
    header('Location: admin_login.php');
    exit;
}

require_once 'connectiondb.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $notification_id = $_POST['notification_id'] ?? null;

    if ($notification_id) {
        $stmt = $pdo->prepare("DELETE FROM exam_notifications WHERE id = ?");
        $stmt->execute([$notification_id]);
    }
}

header('Location: admin_dashboard.php');
exit;
?>
