Update: 2026-08-01 03:01:01
This commit is contained in:
@@ -41,7 +41,7 @@ try {
|
||||
|
||||
// echo $con;
|
||||
// --- JWT Authentication ---
|
||||
include "functions.php"; // Include the functions file
|
||||
include __DIR__ . "/functions.php"; // Include the functions file
|
||||
|
||||
$decodedToken = authenticateJWT(); // Call the authentication function
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ include "../../connect.php";
|
||||
$passenger_id = filterRequest("passenger_id");
|
||||
|
||||
$sql = "SELECT
|
||||
COALESCE(dummy.passenger_id, '$passenger_id') AS passenger_id,
|
||||
COALESCE(dummy.passenger_id, :passenger_id) AS passenger_id,
|
||||
COALESCE(SUM(pw.balance), 0) AS total, -- Adjust column to represent payments
|
||||
COALESCE(p.first_name, '') AS first_name,
|
||||
COALESCE(p.last_name, '') AS last_name,
|
||||
COALESCE(p.phone, '') AS phone
|
||||
FROM
|
||||
(SELECT '$passenger_id' AS passenger_id) AS dummy
|
||||
(SELECT :passenger_id2 AS passenger_id) AS dummy
|
||||
LEFT JOIN `passengerWallet` pw ON pw.passenger_id = dummy.passenger_id
|
||||
LEFT JOIN passengers p ON p.id = dummy.passenger_id
|
||||
GROUP BY
|
||||
@@ -17,7 +17,7 @@ GROUP BY
|
||||
LIMIT 0, 25;
|
||||
";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->execute(['passenger_id' => $passenger_id, 'passenger_id2' => $passenger_id]);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Fetch the record
|
||||
|
||||
Reference in New Issue
Block a user