Update: 2026-06-16 22:44:11

This commit is contained in:
Hamza-Ayed
2026-06-16 22:44:11 +03:00
parent b516fbc4ed
commit 2c3816badb
97 changed files with 10137 additions and 116 deletions

View File

@@ -64,9 +64,9 @@ function finalizeForDriver(PDO $con, int $driverId, float $amount, string $payme
if ($stmtDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed.');
// إضافة سجل محاسبي لمحفظة سفر
$stmtSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod) VALUES (:driverId, 'driver', :amount, :paymentMethod)");
$stmtSefer->execute([':driverId' => $driverId, ':amount' => $amount, ':paymentMethod' => $paymentMethod]);
if ($stmtSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed.');
$stmtSiro = $con->prepare("INSERT INTO siroWallet (driverId, passengerId, amount, paymentMethod) VALUES (:driverId, 'driver', :amount, :paymentMethod)");
$stmtSiro->execute([':driverId' => $driverId, ':amount' => $amount, ':paymentMethod' => $paymentMethod]);
if ($stmtSiro->rowCount() === 0) throw new Exception('Insert to siroWallet failed.');
return ['success' => true, 'message' => 'Driver wallets updated.'];
}
@@ -90,9 +90,9 @@ function finalizeForPassenger(PDO $con, string $passengerId, float $amount, stri
if ($stmtPassenger->rowCount() === 0) throw new Exception('Update passengerWallet failed.');
// إضافة سجل محاسبي لمحفظة سفر
$stmtSefer = $con->prepare("INSERT INTO seferWallet (passengerId, driverId, amount, paymentMethod) VALUES (:passengerId, 'passenger', :amount, :paymentMethod)");
$stmtSefer->execute([':passengerId' => $passengerId, ':amount' => $amount, ':paymentMethod' => $paymentMethod]);
if ($stmtSefer->rowCount() === 0) throw new Exception('Insert to seferWallet for passenger failed.');
$stmtSiro = $con->prepare("INSERT INTO siroWallet (passengerId, driverId, amount, paymentMethod) VALUES (:passengerId, 'passenger', :amount, :paymentMethod)");
$stmtSiro->execute([':passengerId' => $passengerId, ':amount' => $amount, ':paymentMethod' => $paymentMethod]);
if ($stmtSiro->rowCount() === 0) throw new Exception('Insert to siroWallet for passenger failed.');
return ['success' => true, 'message' => 'Passenger wallets updated.'];
}