<?php
require_once "../config/conexion.php";

$id = $_GET['id'] ?? '';

if (!empty($id)) {
    $stmt = $conexion->prepare("DELETE FROM usuarios WHERE id = ?");
    $stmt->bind_param("i", $id);
    if ($stmt->execute()) {
        echo json_encode(['success' => true, 'message' => 'Usuario eliminado correctamente']);
    } else {
        echo json_encode(['success' => false, 'message' => 'Error al eliminar']);
    }
} else {
    echo json_encode(['success' => false, 'message' => 'ID inválido']);
}
