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

27 lines
582 B
PHP

<?php
//getRideStatusBegin.php
require_once __DIR__ . '/../../connect.php';
$ride_id = filterRequest("ride_id");
if (empty($ride_id)) {
jsonError("Ride ID is missing.");
exit;
}
$sql = "SELECT `status`, `DriverIsGoingToPassenger`, `rideTimeStart` FROM `ride` WHERE `id` = :ride_id";
$stmt = $con->prepare($sql);
$stmt->bindParam(':ride_id', $ride_id, PDO::PARAM_INT);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($row) {
echo json_encode([
"status" => "success",
"data" => $row
]);
} else {
jsonError("Ride not found.");
}
?>