<?php
/**
 * Delete Contact Submission
 */

session_start();
require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/includes/auth.php';

checkAdminAuth();

$id = intval($_GET['id'] ?? 0);

if ($id > 0) {
    $pdo = getDBConnection();
    
    $deleteStmt = $pdo->prepare("DELETE FROM contact_submissions WHERE id = :id");
    $deleteStmt->execute([':id' => $id]);
}

header('Location: contacts.php');
exit;

