admin 22
This commit is contained in:
@@ -11,7 +11,7 @@ if (!empty($promo_code)) {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':promo_code', $promo_code, PDO::PARAM_STR);
|
||||
} else {
|
||||
$sql = "SELECT `id`, `promo_code`, `amount`, `description`, `passengerID`, `validity_start_date`, `validity_end_date` FROM `promos` ORDER BY id DESC";
|
||||
$sql = "SELECT `id`, `promo_code`, `amount`, `description`, `passengerID`, `validity_start_date`, `validity_end_date` FROM `promos` WHERE `passengerID` IN ('all', 'none', '') ORDER BY id DESC";
|
||||
$stmt = $con->prepare($sql);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ LEFT JOIN driver d ON
|
||||
LEFT JOIN ride ON ride.id = cm.ride_id
|
||||
left join payments on payments.rideId=cm.ride_id";
|
||||
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -178,7 +179,9 @@ if ($row) {
|
||||
}
|
||||
jsonSuccess($row);
|
||||
} else {
|
||||
// Return empty success for admin dashboard instead of error
|
||||
jsonSuccess([], "No complaints found");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
jsonError("Database error: " . $e->getMessage());
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user