Files
intaleq_v3_pure_php/ride/notificationCaptain/add.php
2026-04-28 13:04:27 +03:00

36 lines
653 B
PHP

<?php
require_once __DIR__ . '/../../connect.php';
$driverID = filterRequest("driverID");
$title = filterRequest("title");
$body = filterRequest("body");
$isPin = filterRequest("isPin");
$sql = "INSERT INTO `notificationCaptain` (
`driverID`,
`title`,
`body`,
`isPin`
) VALUES (
:driverID,
:title,
:body,
:isPin
)";
$stmt = $con->prepare($sql);
$stmt->execute([
':driverID' => $driverID,
':title' => $title,
':body' => $body,
':isPin' => $isPin
]);
if ($stmt->rowCount() > 0) {
jsonSuccess(null, "Notification data saved successfully");
} else {
jsonError("Failed to save notification data");
}
?>