<?php
require_once 'db/config.php';

if (isset($_GET['id'])) {
    $id = $_GET['id'];
    
    $pdo = db();
    $stmt = $pdo->prepare("DELETE FROM event_types WHERE id = ?");
    $stmt->execute([$id]);
    
    session_start();
    $_SESSION['success_message'] = 'Event type deleted successfully.';
    header('Location: event_types.php');
    exit;
}
?>