<?php
require_once __DIR__ . '/../../connect.php';

$id = filterRequest("id");

$sql = "DELETE FROM `canecl` WHERE `id` = :id";
$stmt = $con->prepare($sql);
$stmt->bindParam(":id", $id, PDO::PARAM_INT); // تأكيد أن id رقم
$stmt->execute();

if ($stmt->rowCount() > 0) {
    jsonSuccess(null, "Record deleted successfully");
} else {
    jsonError("Failed to delete record");
}
?>