From dbf1e7870fbcfec5c1ce8d10de6e5e68467337d5 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Mon, 3 Aug 2026 13:37:04 +0300 Subject: [PATCH] Update: 2026-08-03 13:37:04 --- backend/auth/driver/driver_details.php | 10 ++++++++- backend/encrypt_decrypt.php | 7 ++++++ .../lib/views/admin/admin_home_page.dart | 22 +++++++++++++------ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/backend/auth/driver/driver_details.php b/backend/auth/driver/driver_details.php index 356c345a..e8f6f277 100644 --- a/backend/auth/driver/driver_details.php +++ b/backend/auth/driver/driver_details.php @@ -10,7 +10,15 @@ if ($role !== 'admin' && $role !== 'super_admin') { exit; } -$driverId = filterRequest("id"); +// filterRequest() تقرأ من POST أو JSON body فقط ولا تلمس $_GET +// (core/helpers.php). شاشة مراجعة الوثائق تنادي هذه النقطة بـ +// ?id=... في الـ query string، فكانت تُرجع "driver_id is required" +// دائماً رغم إرسال المعرّف. نقبل الشكلين، ونقبل driver_id أيضاً +// لأن رسالة الخطأ نفسها تسمّيه هكذا. +$driverId = filterRequest("id") + ?: filterRequest("driver_id") + ?: (isset($_GET['id']) ? trim((string) $_GET['id']) : null) + ?: (isset($_GET['driver_id']) ? trim((string) $_GET['driver_id']) : null); if (empty($driverId)) { jsonError("driver_id is required."); diff --git a/backend/encrypt_decrypt.php b/backend/encrypt_decrypt.php index 895507e0..b0d1e4b0 100644 --- a/backend/encrypt_decrypt.php +++ b/backend/encrypt_decrypt.php @@ -44,6 +44,12 @@ if (!$key) { $iv = getenv('initializationVector'); // 16 bytes +// ‏الصنف نفسه معرَّف أيضاً في core/Security/EncryptionHelper.php، وأي ملف +// ‏يحمّل bootstrap.php ثم يصل إلى هنا كان ينهار بـ "Cannot declare class +// ‏EncryptionHelper, because the name is already in use" — وهو ما أسقط +// ‏blacklist_manager.php. نُبقي أول تعريف محمَّل (النسخة الحديثة في core) +// ‏ونتخطّى هذه النسخة القديمة المتروكة للتوافقية. +if (!class_exists('EncryptionHelper', false)) { class EncryptionHelper { private $key; private $iv; @@ -160,6 +166,7 @@ class EncryptionHelper { return $decrypted; } } +} // نهاية حارس class_exists // ✅ Load the key and IV from .env or use default values // ✅ Ensure the lengths are correct diff --git a/siro_admin/lib/views/admin/admin_home_page.dart b/siro_admin/lib/views/admin/admin_home_page.dart index c60860de..069de1ba 100644 --- a/siro_admin/lib/views/admin/admin_home_page.dart +++ b/siro_admin/lib/views/admin/admin_home_page.dart @@ -540,16 +540,24 @@ class _AdminHomePageState extends State children: [ Icon(Icons.schedule_rounded, color: cs.primary, size: 18), const SizedBox(width: 8), - Text('توزيع الرحلات حسب الوقت', - style: TextStyle( - color: cs.onSurface, - fontSize: 13, - fontWeight: FontWeight.w600)), - const Spacer(), - if (total > 0) + // العنوان مرن والعدد ثابت: بدون Expanded كان مجموع + // العرضين يتجاوز الحاوية بكسور البكسل في العربية + // (فاض 0.313 بكسل عند 1742 رحلة). + Expanded( + child: Text('توزيع الرحلات حسب الوقت', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: cs.onSurface, + fontSize: 13, + fontWeight: FontWeight.w600)), + ), + if (total > 0) ...[ + const SizedBox(width: 8), Text('${total.toInt()} رحلة', style: TextStyle( color: cs.onSurfaceVariant, fontSize: 11)), + ], ], ), const SizedBox(height: 16),