<?php
require_once('includes/load.php');
page_require_level(3);

$id = (int)$_GET['id'];
$reject = find_reject_by_id($id);

if (!$reject) {
    $session->msg("d", "Reject not found!");
    redirect('reject_list.php');
}

$sql = "DELETE FROM reject_area WHERE id={$id} LIMIT 1";
$result = $db->query($sql);

if ($result && $db->affected_rows() === 1) {
    $session->msg("s", "Reject deleted successfully!");
} else {
    $session->msg("d", "Failed to delete reject.");
}
redirect('reject_list.php');
?>
