Update: 2026-06-18 16:46:30

This commit is contained in:
Hamza-Ayed
2026-06-18 16:46:30 +03:00
parent 8b52d2f115
commit f13faa8c31
12 changed files with 693 additions and 169 deletions

View File

@@ -6,6 +6,7 @@ include "../../../jwtconnect.php";
try {
$passengerID = filterRequest("passengerID");
$amount_raw = filterRequest("amount");
$phone = filterRequest("phone");
$amount = is_numeric($amount_raw) ? (float) $amount_raw : 0.0;
if (empty($passengerID) || $amount <= 0) {
@@ -25,8 +26,8 @@ try {
$con->prepare("UPDATE invoices_shamcash_passenger SET created_at=NOW() WHERE id=?")->execute([$existing['id']]);
} else {
$invoice_number = random_int(100000, 999999);
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash_passenger (invoice_number, passengerID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())");
$stmtIns->execute([$invoice_number, $passengerID, $amount]);
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash_passenger (invoice_number, passengerID, phone, amount, status, created_at) VALUES (?, ?, ?, ?, 'pending', NOW())");
$stmtIns->execute([$invoice_number, $passengerID, $phone ?: null, $amount]);
}
echo json_encode([