Initial commit with updated Auth and media ignored
This commit is contained in:
36
ride/notificationCaptain/add.php
Normal file
36
ride/notificationCaptain/add.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user