diff --git a/admin_cities.php b/admin_cities.php index dfe568c..fcf41d1 100644 --- a/admin_cities.php +++ b/admin_cities.php @@ -207,10 +207,14 @@ render_header('Manage Cities', 'admin', true); - Edit -
+ + + + - +
@@ -223,4 +227,4 @@ render_header('Manage Cities', 'admin', true); - + \ No newline at end of file diff --git a/admin_company_profile.php b/admin_company_profile.php index b1a474c..4574855 100644 --- a/admin_company_profile.php +++ b/admin_company_profile.php @@ -109,88 +109,120 @@ render_header('Company Profile', 'admin', true);
-
-
- - -
- -
- - -
Displayed in the footer.
-
- -
- - -
Displayed in the footer.
-
+ -
- - -
Displayed in the footer.
-
- -
- -
- - % +
+ +
+
+
+ + +
+ +
+ + +
Displayed in the footer.
+
+ +
+ + +
Displayed in the footer.
+
+ +
+ + +
Displayed in the footer.
+
+ +
+ +
+ + % +
+
Percentage applied as a platform fee.
+
+ +
+
+
+ +
+ + +
+ Logo +
+ + +
Recommended size: 150x40px (PNG, JPG, SVG). Leave empty to keep current.
+
+ +
+ + +
+ Favicon +
+ + +
Recommended size: 32x32px (ICO, PNG, SVG). Leave empty to keep current.
+
-
Percentage applied as a platform fee.
- -
-
-
- -
- - -
- Logo + + +
- + \ No newline at end of file diff --git a/admin_countries.php b/admin_countries.php index b33ac91..ccb90d4 100644 --- a/admin_countries.php +++ b/admin_countries.php @@ -164,10 +164,14 @@ render_header('Manage Countries', 'admin', true); - Edit - + + + + - + @@ -180,4 +184,4 @@ render_header('Manage Countries', 'admin', true);
- + \ No newline at end of file diff --git a/admin_dashboard.php b/admin_dashboard.php index ffb7b2a..7620bb7 100644 --- a/admin_dashboard.php +++ b/admin_dashboard.php @@ -85,107 +85,113 @@ render_header(t('admin_dashboard'), 'admin', true);
-
-
-

Recent Shipments

- shown +
+
+

Recent Shipments

+ shown
- -
- - -
- - -
- -

-
- -
- - - - - - - - - - - +
+ +
+ + +
+ + +
+ +

+
+ +
+
ShipmentRouteAction
+ - - - - + + + + - - -
-
- -
-
- - - -
-
- - View Details - - ShipmentRouteAction
-
- + + + + + +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
-
-

Quick Links

- diff --git a/admin_faqs.php b/admin_faqs.php index 95f3f3d..5f73ce7 100644 --- a/admin_faqs.php +++ b/admin_faqs.php @@ -129,7 +129,7 @@ render_header('Manage FAQs', 'admin', true);
-
+
Edit FAQ
@@ -168,7 +168,7 @@ render_header('Manage FAQs', 'admin', true);
-
+
Add New FAQ
@@ -205,7 +205,7 @@ render_header('Manage FAQs', 'admin', true);
-
+
Current FAQs
@@ -217,7 +217,7 @@ render_header('Manage FAQs', 'admin', true);
- + diff --git a/admin_integrations.php b/admin_integrations.php index 5f015db..46eb598 100644 --- a/admin_integrations.php +++ b/admin_integrations.php @@ -73,129 +73,158 @@ render_header('Integrations', 'admin', true); - -
-

- - - - - Thawani Payments Gateway -

-

Configure your Oman-based Thawani Pay integration to process shipment payments.

+ + + +
-
-
- - -
-
- -
- - -
- -
- - -
-
-
- - -
-

- - - - Wablas WhatsApp Gateway -

-

Connect Wablas to automatically send WhatsApp notifications to Shippers and Truck Owners.

- -
-
-
- > - + +
+
+

+ + + + + Thawani Payments Gateway +

+

Configure your Oman-based Thawani Pay integration to process shipment payments.

+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+
-
- - -
Your assigned server node from the Wablas dashboard.
-
- -
- - -
+ +
+
+

+ + + + Wablas WhatsApp Gateway +

+

Connect Wablas to automatically send WhatsApp notifications to Shippers and Truck Owners.

-
- - -
Optional. Provide if your Wablas webhooks require signature verification.
+
+
+
+ > + +
+
+ +
+ + +
Your assigned server node from the Wablas dashboard.
+
+ +
+ + +
+ +
+ + +
Optional. Provide if your Wablas webhooks require signature verification.
+
+
-
- - -
-

- - - - SMTP Mail Settings -

-

Configure your SMTP server to send emails and system notifications.

+ + +
+
+

+ + + + SMTP Mail Settings +

+

Configure your SMTP server to send emails and system notifications.

-
-
- - -
- -
- - -
+
+
+ + +
+ +
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - +
+ + +
+
+
- -
+ +
diff --git a/admin_landing_pages.php b/admin_landing_pages.php index 4ddc328..fd746e4 100644 --- a/admin_landing_pages.php +++ b/admin_landing_pages.php @@ -222,12 +222,16 @@ render_header(t('app_name') . ' - Landing Pages', 'admin', true);
- Edit + + +
- +
diff --git a/admin_notification_templates.php b/admin_notification_templates.php index 0c4cb85..d154e3c 100644 --- a/admin_notification_templates.php +++ b/admin_notification_templates.php @@ -185,8 +185,8 @@ render_header('Notification Templates', 'admin', true);
diff --git a/admin_platform_users.php b/admin_platform_users.php index ff18382..cbceb9d 100644 --- a/admin_platform_users.php +++ b/admin_platform_users.php @@ -166,12 +166,12 @@ render_header(t('nav_platform_users'), 'platform_users', true); diff --git a/admin_shipment_edit.php b/admin_shipment_edit.php index 492e076..55abe59 100644 --- a/admin_shipment_edit.php +++ b/admin_shipment_edit.php @@ -3,19 +3,29 @@ declare(strict_types=1); require_once __DIR__ . '/includes/layout.php'; -$errors = []; -$flash = null; - $id = (int)($_GET['id'] ?? 0); +$isAjax = isset($_GET['ajax']) && $_GET['ajax'] === '1'; + if (!$id) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Invalid ID']); + exit; + } header('Location: admin_shipments.php'); exit; } +$errors = []; +$flash = null; + $stmt = db()->prepare("SELECT * FROM shipments WHERE id = ?"); $stmt->execute([$id]); $shipment = $stmt->fetch(); if (!$shipment) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Shipment not found']); + exit; + } header('Location: admin_shipments.php'); exit; } @@ -85,6 +95,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ]); $flash = "Shipment updated successfully."; + if ($isAjax) { + header('Content-Type: application/json'); + echo json_encode(['success' => true, 'message' => $flash]); + exit; + } + // Refresh data $stmt->execute([$id]); $shipment = $stmt->fetch(); @@ -107,9 +123,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $destination_cities_list = $stmt->fetchAll(); } } + + if ($isAjax && $errors) { + header('Content-Type: application/json'); + echo json_encode(['success' => false, 'message' => implode('
', $errors)]); + exit; + } } -render_header('Edit Shipment', 'admin', true); +// -- OUTPUT START -- +if (!$isAjax): + render_header('Edit Shipment', 'admin', true); ?>
@@ -143,127 +167,154 @@ render_header('Edit Shipment', 'admin', true);
-
-
-
-
- - -
-
- - -
+
+
Shipment Details
+
+ - -
- - -
-
- - + + + + + +
+ + +
+
+ + +
-
- - -
+ +
+ + +
+
+ + -
-
- - -
-
- - + + + + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
-
- - + +
+ -
- - + +
+
-
- -
- -
- + + + + +
+ - \ No newline at end of file + \ No newline at end of file diff --git a/admin_shipments.php b/admin_shipments.php index b492c15..d09831c 100644 --- a/admin_shipments.php +++ b/admin_shipments.php @@ -164,24 +164,20 @@ render_header('Manage Shipments', 'admin', true); diff --git a/truck_owner_dashboard.php b/truck_owner_dashboard.php index 11f85da..0611c13 100644 --- a/truck_owner_dashboard.php +++ b/truck_owner_dashboard.php @@ -174,8 +174,8 @@ $flash = get_flash(); $ - - + +
Sort Question (EN)
- - Edit + +
- - @@ -215,4 +211,109 @@ render_header('Manage Shipments', 'admin', true); + + + + + \ No newline at end of file diff --git a/admin_shipper_edit.php b/admin_shipper_edit.php index 1510c8a..70f074e 100644 --- a/admin_shipper_edit.php +++ b/admin_shipper_edit.php @@ -4,7 +4,13 @@ declare(strict_types=1); require_once __DIR__ . '/includes/layout.php'; $userId = (int)($_GET['id'] ?? 0); +$isAjax = isset($_GET['ajax']) && $_GET['ajax'] === '1'; + if ($userId <= 0) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Invalid ID']); + exit; + } header('Location: admin_shippers.php'); exit; } @@ -24,6 +30,10 @@ $stmt->execute([$userId]); $shipper = $stmt->fetch(); if (!$shipper) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Shipper not found']); + exit; + } header('Location: admin_shippers.php'); exit; } @@ -80,6 +90,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { db()->commit(); $flash = 'Shipper profile updated successfully.'; + if ($isAjax) { + header('Content-Type: application/json'); + echo json_encode(['success' => true, 'message' => $flash]); + exit; + } + // Refresh data $shipper['full_name'] = $fullName; $shipper['email'] = $email; @@ -99,9 +115,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } } + + if ($isAjax && $errors) { + header('Content-Type: application/json'); + echo json_encode(['success' => false, 'message' => implode('
', $errors)]); + exit; + } } -render_header('Edit Shipper', 'admin', true); +// -- OUTPUT START -- +if (!$isAjax): + render_header('Edit Shipper', 'admin', true); ?>
@@ -125,7 +149,18 @@ render_header('Edit Shipper', 'admin', true);
-
+ + + + + + + +
Cancel
+
+ +
+ - \ No newline at end of file + \ No newline at end of file diff --git a/admin_shippers.php b/admin_shippers.php index 930730f..3c45926 100644 --- a/admin_shippers.php +++ b/admin_shippers.php @@ -167,32 +167,27 @@ render_header('Manage Shippers', 'admin', true);
- - - - + +
- - -
@@ -226,4 +221,109 @@ render_header('Manage Shippers', 'admin', true); + + + + + \ No newline at end of file diff --git a/admin_truck_owner_edit.php b/admin_truck_owner_edit.php index 1663483..7122dfe 100644 --- a/admin_truck_owner_edit.php +++ b/admin_truck_owner_edit.php @@ -4,7 +4,13 @@ declare(strict_types=1); require_once __DIR__ . '/includes/layout.php'; $userId = (int)($_GET['id'] ?? 0); +$isAjax = isset($_GET['ajax']) && $_GET['ajax'] === '1'; + if ($userId <= 0) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Invalid ID']); + exit; + } header('Location: admin_truck_owners.php'); exit; } @@ -26,6 +32,10 @@ $stmt->execute([$userId]); $owner = $stmt->fetch(); if (!$owner) { + if ($isAjax) { + echo json_encode(['success' => false, 'message' => 'Owner not found']); + exit; + } header('Location: admin_truck_owners.php'); exit; } @@ -96,7 +106,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { db()->commit(); $flash = 'Truck Owner profile updated successfully.'; - // Refresh data + // If AJAX, return success immediately + if ($isAjax) { + header('Content-Type: application/json'); + echo json_encode(['success' => true, 'message' => $flash]); + exit; + } + + // Refresh data for non-ajax $owner['full_name'] = $fullName; $owner['email'] = $email; $owner['status'] = $status; @@ -120,13 +137,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } } + + if ($isAjax && $errors) { + header('Content-Type: application/json'); + echo json_encode(['success' => false, 'message' => implode('
', $errors)]); + exit; + } } $idCards = json_decode($owner['id_card_path'] ?? '[]', true) ?: []; $regs = json_decode($owner['registration_path'] ?? '[]', true) ?: []; $pic = $owner['truck_pic_path']; -render_header('Edit Truck Owner', 'admin', true); +// -- OUTPUT START -- +if (!$isAjax): + render_header('Edit Truck Owner', 'admin', true); ?>
@@ -150,8 +175,20 @@ render_header('Edit Truck Owner', 'admin', true);
-
-
Personal Details
+ + + + + + + + +
Cancel
+ +
+ +
+ - \ No newline at end of file + \ No newline at end of file diff --git a/admin_truck_owners.php b/admin_truck_owners.php index f812709..a1023f8 100644 --- a/admin_truck_owners.php +++ b/admin_truck_owners.php @@ -175,32 +175,27 @@ render_header('Manage Truck Owners', 'admin', true);
- - - - + +
- - -
@@ -234,6 +229,23 @@ render_header('Manage Truck Owners', 'admin', true); + + + + + \ No newline at end of file diff --git a/assets/css/custom.css b/assets/css/custom.css index 2426c8d..6db30d1 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -10,6 +10,14 @@ --success: #10b981; --warning: #f59e0b; --shadow: 0 10px 30px rgba(15, 23, 42, 0.05); + + /* Sidebar Theme */ + --sidebar-bg: #000080; + --sidebar-text: #ffffff; + --sidebar-text-hover: #e2e8f0; + --sidebar-active-bg: rgba(255, 255, 255, 0.15); + --sidebar-active-text: #ffffff; + --sidebar-border: rgba(255, 255, 255, 0.1); } body.app-body { @@ -42,6 +50,18 @@ body.app-body { background: var(--surface); box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; + overflow: hidden; /* Ensure headers/footers are clipped */ +} + +/* New Panel Header Style */ +.panel-heading, +.card-header { + background-color: var(--sidebar-bg); + color: #ffffff; + padding: 16px 24px; + border-bottom: 1px solid var(--sidebar-border); + font-weight: 600; + font-size: 1.1rem; } .hero-section { @@ -149,13 +169,24 @@ body.app-body { color: #9333ea; } +/* Update Table Headers to match Sidebar */ .table thead th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; - color: var(--muted); - border-bottom: 2px solid #f1f5f9; - padding-bottom: 12px; + color: var(--sidebar-text); + background-color: var(--sidebar-bg); + border-bottom: 2px solid var(--sidebar-border); + padding: 14px 16px; /* Increased padding */ + vertical-align: middle; +} +/* Ensure first and last th have rounded corners if table is isolated? + Bootstrap tables usually handle this, but with custom bg we might need to be careful. */ +.table thead th:first-child { + border-top-left-radius: 8px; +} +.table thead th:last-child { + border-top-right-radius: 8px; } .table tbody td { @@ -236,34 +267,78 @@ body.app-body { border-radius: 12px; } +/* Sidebar Styles Updated */ .admin-sidebar { + background-color: var(--sidebar-bg); + color: var(--sidebar-text); position: sticky; top: 76px; height: calc(100vh - 76px); overflow-y: auto; border-radius: 0; + /* Ensure it covers the parent's white bg */ + margin-right: -1px; /* Overlap border if needed */ } +/* Sidebar Headings */ +.admin-sidebar h2 { + color: #ffffff !important; /* Force white for headings */ + border-bottom: 1px solid var(--sidebar-border); + padding-bottom: 12px; + margin-bottom: 20px; + font-size: 1.1rem; +} +.admin-sidebar h2 i { + color: var(--sidebar-active-bg) !important; +} + +/* Sidebar Links */ .admin-nav-link { display: block; padding: 12px 16px; - border-radius: 12px; - color: #475569; + border-radius: 8px; /* Slightly smaller radius for tighter list */ + color: var(--sidebar-text); text-decoration: none; - font-weight: 600; + font-weight: 500; border: 1px solid transparent; transition: all 0.2s ease; + margin-bottom: 4px; } .admin-nav-link:hover { - background: #f1f5f9; - color: #0f172a; + background: rgba(255, 255, 255, 0.05); + color: var(--sidebar-text-hover); } .admin-nav-link.active { - background: #eff6ff; - color: var(--primary); - border-color: #bfdbfe; + background: var(--sidebar-active-bg); + color: var(--sidebar-active-text); + border-color: transparent; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +/* Collapsible Toggles in Sidebar */ +.admin-sidebar .nav-link { + color: var(--sidebar-text) !important; +} +.admin-sidebar .nav-link:hover { + color: var(--sidebar-text-hover) !important; + background: rgba(255, 255, 255, 0.05); +} + +/* Sub-menus borders */ +.admin-sidebar .border-start { + border-color: var(--sidebar-border) !important; +} + +/* Logout button in sidebar */ +.admin-sidebar .btn-outline-danger { + border-color: #ef4444; + color: #ef4444; +} +.admin-sidebar .btn-outline-danger:hover { + background: #ef4444; + color: #ffffff; } [dir="rtl"] .navbar .ms-auto { @@ -293,5 +368,6 @@ body.app-body { position: static; height: auto; overflow-y: visible; + background-color: var(--sidebar-bg); /* Keep dark on mobile too */ } } \ No newline at end of file diff --git a/includes/app.php b/includes/app.php index 9b99ab8..1a0e543 100644 --- a/includes/app.php +++ b/includes/app.php @@ -193,6 +193,7 @@ $translations = [ 'total_offers' => 'Total Offers', 'won_shipments' => 'Won Shipments', 'nav_platform_users' => 'Platform Users', + 'notification_templates' => 'Notification Templates', 'manage_permissions' => 'Manage Permissions', 'create_user' => 'Create User', 'edit_user' => 'Edit User', @@ -313,7 +314,7 @@ $translations = [ 'user_registration' => 'تسجيل المستخدم', 'pages' => 'الصفحات', 'faqs' => 'الأسئلة الشائعة', - 'landing_pages' => 'صفحات الهبوط', + 'landing_pages' => 'إعدادات الصفحة الرئيسية', 'login_title' => 'مرحبًا بعودتك', 'login_subtitle' => 'قم بتسجيل الدخول إلى حسابك للمتابعة', 'email_address' => 'البريد الإلكتروني', @@ -385,6 +386,7 @@ $translations = [ 'total_offers' => 'إجمالي العروض', 'won_shipments' => 'الشحنات الفائزة', 'nav_platform_users' => 'مستخدمو المنصة', + 'notification_templates' => 'قوالب الإشعارات', 'manage_permissions' => 'إدارة الصلاحيات', 'create_user' => 'إنشاء مستخدم', 'edit_user' => 'تعديل المستخدم', @@ -604,4 +606,4 @@ function has_permission(string $permissionSlug, ?int $userId = null): bool } catch (Throwable $e) { return false; } -} \ No newline at end of file +} diff --git a/includes/layout.php b/includes/layout.php index 8408915..8be5bf1 100644 --- a/includes/layout.php +++ b/includes/layout.php @@ -224,12 +224,12 @@ function render_admin_sidebar(string $active = 'dashboard'): void
- - + +