From b301aff8cb31cdc869dd76248e591004e07f6676 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 30 Apr 2026 02:18:22 +0300 Subject: [PATCH] 21 --- uploadImagePortrate.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/uploadImagePortrate.php b/uploadImagePortrate.php index 6ed43c3..46d7bca 100755 --- a/uploadImagePortrate.php +++ b/uploadImagePortrate.php @@ -33,22 +33,23 @@ try { appLog("✅ File moved successfully to: " . $uploadResult['path']); // 3. تحديث قاعدة البيانات - $linkImage = 'https://intaleq.xyz/portrate_captain_image/' . $new_filename; + $linkImage = 'https://api.intaleq.xyz/intaleq_v3/portrate_captain_image/' . $new_filename; $uploadDate = date("Y-m-d H:i:s"); // تأكد من أن الاتصال قادم من connect.php أو اجلبه $con = Database::get('main'); - // التحقق من وجود السائق - $stmt = $con->prepare("SELECT COUNT(*) FROM card_images WHERE driverID = ?"); + // التحقق من وجود السائق في جدول الصور الشخصية + $stmt = $con->prepare("SELECT COUNT(*) FROM imageProfileCaptain WHERE driverID = ?"); $stmt->execute([$driverID]); $count = $stmt->fetchColumn(); if ($count > 0) { // تحديث - $updateSQL = "UPDATE card_images SET upload_date = ?, image_name = ?, link = ? WHERE driverID = ?"; + $updateSQL = "UPDATE imageProfileCaptain SET image_name = ?, link = ? WHERE driverID = ?"; $updateStmt = $con->prepare($updateSQL); - $success = $updateStmt->execute([$uploadDate, $new_filename, $linkImage, $driverID]); + // Note: imageProfileCaptain doesn't seem to have 'upload_date' in the original insert, but let's check if we should add it. Let's just update image_name and link as in the insert statement. + $success = $updateStmt->execute([$new_filename, $linkImage, $driverID]); } else { // إدخال جديد $insertSQL = "INSERT INTO imageProfileCaptain (driverID, image_name, link) VALUES (?, ?, ?)";