19 lines
560 B
PHP
19 lines
560 B
PHP
<?php
|
|
require_once __DIR__ . '/../../connect.php';
|
|
|
|
// استقبال ID السجل
|
|
$id = filterRequest("id");
|
|
|
|
// حذف السجل من جدول captains_car (أو CarRegistration لو هو الصحيح فعلاً)
|
|
$sql = "DELETE FROM captains_car WHERE id = :id";
|
|
$stmt = $con->prepare($sql);
|
|
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
|
|
$stmt->execute();
|
|
|
|
// التحقق من نجاح الحذف
|
|
if ($stmt->rowCount() > 0) {
|
|
jsonSuccess(null, "Car registration deleted successfully");
|
|
} else {
|
|
jsonError("Failed to delete car registration");
|
|
}
|
|
?>
|