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