first commit
This commit is contained in:
26
backend/ride/rides/getRideStatus.php
Normal file
26
backend/ride/rides/getRideStatus.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$id = filterRequest("id");
|
||||
|
||||
if (empty($id)) {
|
||||
jsonError("Missing ride ID.");
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "SELECT `status` FROM `ride` WHERE `id` = :id";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row && isset($row['status'])) {
|
||||
echo json_encode([
|
||||
"status" => "success",
|
||||
"data" => $row['status']
|
||||
]);
|
||||
} else {
|
||||
jsonError("Ride not found.");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user