Update: 2026-06-18 16:46:30
This commit is contained in:
@@ -7,6 +7,7 @@ include "../../jwtconnect.php";
|
||||
try {
|
||||
$driverID = filterRequest("driverID");
|
||||
$amount_raw = filterRequest("amount");
|
||||
$phone = filterRequest("phone");
|
||||
|
||||
$amount = is_numeric($amount_raw) ? (float) $amount_raw : 0.0;
|
||||
|
||||
@@ -29,8 +30,8 @@ try {
|
||||
} else {
|
||||
// إنشاء فاتورة جديدة برقم عشوائي
|
||||
$invoice_number = random_int(100000, 999999);
|
||||
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())");
|
||||
$stmtIns->execute([$invoice_number, $driverID, $amount]);
|
||||
$stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, phone, amount, status, created_at) VALUES (?, ?, ?, ?, 'pending', NOW())");
|
||||
$stmtIns->execute([$invoice_number, $driverID, $phone ?: null, $amount]);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
|
||||
Reference in New Issue
Block a user