<?php
include '../opendb.php';

if (isset($_GET['id'])) {
    $id = intval($_GET['id']); 

    $sql = "DELETE FROM notification WHERE id = $id";

    if (mysqli_query($conn, $sql)) {
        echo "<script>alert('Notification deleted successfully'); window.location.href='notification.php';</script>";
    } else {
        echo "Error deleting record: " . mysqli_error($conn);
    }
} else {
    echo "Invalid request.";
}

mysqli_close($conn);
?>
