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

23 lines
561 B
PHP
Executable File

<?php
require_once __DIR__ . '/../../connect.php';
$driverID = filterRequest("driverID");
$sql = "SELECT * FROM `notificationCaptain`
WHERE `driverID` = :driverID
AND `dateCreated` > DATE_SUB(NOW(), INTERVAL 2 DAY)
ORDER BY `dateCreated` DESC
LIMIT 10";
$stmt = $con->prepare($sql);
$stmt->bindParam(':driverID', $driverID, PDO::PARAM_STR);
$stmt->execute();
$notifications = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($notifications) {
jsonSuccess($notifications);
} else {
jsonError("No notification data found");
}
?>