Fix table name click to cliq in all files

This commit is contained in:
Hamza-Ayed
2026-08-01 04:31:53 +03:00
parent 811b23ca9e
commit b78a6797d5
5 changed files with 7 additions and 6 deletions
@@ -12,7 +12,7 @@ try {
exit;
}
$stmt = $con->prepare("SELECT status FROM click_invoices WHERE invoice_number = :invoice_number LIMIT 1");
$stmt = $con->prepare("SELECT status FROM cliq_invoices WHERE invoice_number = :invoice_number LIMIT 1");
$stmt->execute([':invoice_number' => $invoiceNumber]);
$invoice = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -38,7 +38,7 @@ try {
// 1. البحث عن الفاتورة وتحديث حالتها
$stmt = $con->prepare(
"UPDATE `click_invoices`
"UPDATE `cliq_invoices`
SET `status` = 'completed', `click_transaction_id` = :transaction_id
WHERE `invoice_number` = :invoice_number AND `status` = 'pending'"
);
@@ -52,7 +52,7 @@ try {
$invoiceId = $con->lastInsertId(); // ملاحظة: هذا قد لا يعمل دائماً مع UPDATE، الأفضل جلب الـ ID
// جلب ID الفاتورة بعد التأكد من وجودها
$idStmt = $con->prepare("SELECT id FROM `click_invoices` WHERE `invoice_number` = :invoice_number");
$idStmt = $con->prepare("SELECT id FROM `cliq_invoices` WHERE `invoice_number` = :invoice_number");
$idStmt->execute([':invoice_number' => $invoiceNumber]);
$invoiceRecord = $idStmt->fetch();
$invoiceId = $invoiceRecord['id'];
@@ -32,7 +32,7 @@ try {
// البحث عن فاتورة معلقة لهذا الرقم
$stmt = $con->prepare(
"SELECT invoice_number, amount, user_id, user_type
FROM `click_invoices`
FROM `cliq_invoices`
WHERE `click_phone` = :click_phone AND `status` = 'pending'
ORDER BY `created_at` DESC LIMIT 1"
);