<?php
session_start();
include('includes/db.php');

$id = $_GET['id'] ?? null;
if (!$id) {
    echo "ID inválido!";
    exit;
}

$stmt = $pdo->prepare("DELETE FROM clientes WHERE id = ?");
$stmt->execute([$id]);

$redirect = $_GET['redirect'] ?? 'clientes.php';
header("Location: $redirect");
exit;
?>
