From d1d4a0cc48e464ac57ad45bd01a2110e19cca92d Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 24 Mar 2026 05:40:05 +0000 Subject: [PATCH] adding data --- admin_cities.php | 40 +++++++++++++++++++++----- admin_countries.php | 40 +++++++++++++++++++++----- admin_faqs.php | 39 ++++++++++++++++++++----- admin_notification_templates.php | 28 +++++++++++++++++- admin_platform_users.php | 29 ++++++++++++++++++- uploads/trucks/reg_69c222f680ca5.jpg | 1 + uploads/trucks/reg_69c222f68d477.jpg | 1 + uploads/trucks/reg_69c222f68f3ca.jpg | 1 + uploads/trucks/reg_69c222f690c1c.jpg | 1 + uploads/trucks/reg_69c222f691903.jpg | 1 + uploads/trucks/reg_69c222f69343f.jpg | 1 + uploads/trucks/reg_69c222f697e5d.jpg | 1 + uploads/trucks/reg_69c222f6996d8.jpg | 1 + uploads/trucks/reg_69c222f69a0ab.jpg | 1 + uploads/trucks/reg_69c222f69b3a3.jpg | 1 + uploads/trucks/truck_69c222f680ca4.jpg | 1 + uploads/trucks/truck_69c222f68d475.jpg | 1 + uploads/trucks/truck_69c222f68f3c8.jpg | 1 + uploads/trucks/truck_69c222f690c1b.jpg | 1 + uploads/trucks/truck_69c222f691901.jpg | 1 + uploads/trucks/truck_69c222f69343d.jpg | 1 + uploads/trucks/truck_69c222f697e5b.jpg | 1 + uploads/trucks/truck_69c222f6996d7.jpg | 1 + uploads/trucks/truck_69c222f69a0a9.jpg | 1 + uploads/trucks/truck_69c222f69b3a2.jpg | 1 + 25 files changed, 173 insertions(+), 23 deletions(-) create mode 100644 uploads/trucks/reg_69c222f680ca5.jpg create mode 100644 uploads/trucks/reg_69c222f68d477.jpg create mode 100644 uploads/trucks/reg_69c222f68f3ca.jpg create mode 100644 uploads/trucks/reg_69c222f690c1c.jpg create mode 100644 uploads/trucks/reg_69c222f691903.jpg create mode 100644 uploads/trucks/reg_69c222f69343f.jpg create mode 100644 uploads/trucks/reg_69c222f697e5d.jpg create mode 100644 uploads/trucks/reg_69c222f6996d8.jpg create mode 100644 uploads/trucks/reg_69c222f69a0ab.jpg create mode 100644 uploads/trucks/reg_69c222f69b3a3.jpg create mode 100644 uploads/trucks/truck_69c222f680ca4.jpg create mode 100644 uploads/trucks/truck_69c222f68d475.jpg create mode 100644 uploads/trucks/truck_69c222f68f3c8.jpg create mode 100644 uploads/trucks/truck_69c222f690c1b.jpg create mode 100644 uploads/trucks/truck_69c222f691901.jpg create mode 100644 uploads/trucks/truck_69c222f69343d.jpg create mode 100644 uploads/trucks/truck_69c222f697e5b.jpg create mode 100644 uploads/trucks/truck_69c222f6996d7.jpg create mode 100644 uploads/trucks/truck_69c222f69a0a9.jpg create mode 100644 uploads/trucks/truck_69c222f69b3a2.jpg diff --git a/admin_cities.php b/admin_cities.php index 26bb5e9..446f068 100644 --- a/admin_cities.php +++ b/admin_cities.php @@ -83,6 +83,15 @@ $cityNameExpr = $lang === 'ar' : "COALESCE(NULLIF(c.name_en, ''), c.name_ar)"; $countries = db()->query("SELECT id, name_en, name_ar, {$countryNameExprNoAlias} AS display_name FROM countries ORDER BY display_name ASC")->fetchAll(); + +// Pagination +$page = max(1, (int)($_GET['page'] ?? 1)); +$limit = 20; +$offset = ($page - 1) * $limit; + +$total = (int)db()->query("SELECT COUNT(*) FROM cities")->fetchColumn(); +$totalPages = (int)ceil($total / $limit); + $cities = db()->query( "SELECT c.id, @@ -94,17 +103,15 @@ $cities = db()->query( FROM cities c JOIN countries co ON co.id = c.country_id ORDER BY country_name ASC, city_name ASC - LIMIT 200" + LIMIT $limit OFFSET $offset" )->fetchAll(); $editingCity = null; if ($editCityId > 0) { - foreach ($cities as $city) { - if ((int)$city['id'] === $editCityId) { - $editingCity = $city; - break; - } - } + // Fetch explicitly if editing, as it might not be on the current page + $stmt = db()->prepare("SELECT * FROM cities WHERE id = ?"); + $stmt->execute([$editCityId]); + $editingCity = $stmt->fetch(); } render_header('Manage Cities', 'admin', true); @@ -222,6 +229,25 @@ render_header('Manage Cities', 'admin', true); + + 1): ?> +
+ Showing of cities + +
+ diff --git a/admin_countries.php b/admin_countries.php index 71fbcc0..d95bf46 100644 --- a/admin_countries.php +++ b/admin_countries.php @@ -73,16 +73,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { validate_csrf_token(); $countryNameExprNoAlias = $lang === 'ar' ? "COALESCE(NULLIF(name_ar, ''), name_en)" : "COALESCE(NULLIF(name_en, ''), name_ar)"; -$countries = db()->query("SELECT id, name_en, name_ar, {$countryNameExprNoAlias} AS display_name FROM countries ORDER BY display_name ASC")->fetchAll(); + +// Pagination +$page = max(1, (int)($_GET['page'] ?? 1)); +$limit = 20; +$offset = ($page - 1) * $limit; + +$total = (int)db()->query("SELECT COUNT(*) FROM countries")->fetchColumn(); +$totalPages = (int)ceil($total / $limit); + +$countries = db()->query("SELECT id, name_en, name_ar, {$countryNameExprNoAlias} AS display_name FROM countries ORDER BY display_name ASC LIMIT $limit OFFSET $offset")->fetchAll(); $editingCountry = null; if ($editCountryId > 0) { - foreach ($countries as $country) { - if ((int)$country['id'] === $editCountryId) { - $editingCountry = $country; - break; - } - } + // Fetch explicitly if editing + $stmt = db()->prepare("SELECT id, name_en, name_ar, {$countryNameExprNoAlias} AS display_name FROM countries WHERE id = ?"); + $stmt->execute([$editCountryId]); + $editingCountry = $stmt->fetch(); } render_header('Manage Countries', 'admin', true); @@ -179,6 +186,25 @@ render_header('Manage Countries', 'admin', true); + + 1): ?> +
+ Showing of countries + +
+ diff --git a/admin_faqs.php b/admin_faqs.php index de9800d..d6f89c1 100644 --- a/admin_faqs.php +++ b/admin_faqs.php @@ -89,16 +89,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { validate_csrf_token(); } } -$faqs = db()->query("SELECT * FROM faqs ORDER BY sort_order ASC, id DESC")->fetchAll(); +// Pagination +$page = max(1, (int)($_GET['page'] ?? 1)); +$limit = 20; +$offset = ($page - 1) * $limit; + +$total = (int)db()->query("SELECT COUNT(*) FROM faqs")->fetchColumn(); +$totalPages = (int)ceil($total / $limit); + +$faqs = db()->query("SELECT * FROM faqs ORDER BY sort_order ASC, id DESC LIMIT $limit OFFSET $offset")->fetchAll(); $editingFaq = null; if ($editFaqId > 0) { - foreach ($faqs as $faq) { - if ((int)$faq['id'] === $editFaqId) { - $editingFaq = $faq; - break; - } - } + // Fetch specifically if editing + $stmt = db()->prepare("SELECT * FROM faqs WHERE id = ?"); + $stmt->execute([$editFaqId]); + $editingFaq = $stmt->fetch(); } render_header('Manage FAQs', 'admin', true); @@ -247,6 +253,25 @@ render_header('Manage FAQs', 'admin', true); + + 1): ?> +
+ Showing of FAQs + +
+ diff --git a/admin_notification_templates.php b/admin_notification_templates.php index 613d294..50bc45e 100644 --- a/admin_notification_templates.php +++ b/admin_notification_templates.php @@ -149,7 +149,14 @@ if ($action === 'edit' && $id > 0) { } // List View -$stmt = db()->query("SELECT * FROM notification_templates ORDER BY event_name ASC"); +$page = max(1, (int)($_GET['page'] ?? 1)); +$limit = 20; +$offset = ($page - 1) * $limit; + +$total = (int)db()->query("SELECT COUNT(*) FROM notification_templates")->fetchColumn(); +$totalPages = (int)ceil($total / $limit); + +$stmt = db()->query("SELECT * FROM notification_templates ORDER BY event_name ASC LIMIT $limit OFFSET $offset"); $templates = $stmt->fetchAll(); render_header(t('notification_templates'), 'admin', true); @@ -195,6 +202,25 @@ render_header(t('notification_templates'), 'admin', true); + + 1): ?> +
+ of templates + +
+ diff --git a/admin_platform_users.php b/admin_platform_users.php index eeb6cd9..7687efd 100644 --- a/admin_platform_users.php +++ b/admin_platform_users.php @@ -110,8 +110,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { validate_csrf_token(); } } +// Pagination +$page = max(1, (int)($_GET['page'] ?? 1)); +$limit = 20; +$offset = ($page - 1) * $limit; + +$total = (int)$pdo->query("SELECT COUNT(*) FROM users WHERE role = 'admin'")->fetchColumn(); +$totalPages = (int)ceil($total / $limit); + // Fetch Users -$stmtUsers = $pdo->query("SELECT id, email, full_name, created_at FROM users WHERE role = 'admin' ORDER BY created_at DESC"); +$stmtUsers = $pdo->query("SELECT id, email, full_name, created_at FROM users WHERE role = 'admin' ORDER BY created_at DESC LIMIT $limit OFFSET $offset"); $users = $stmtUsers->fetchAll(); // Fetch Permissions @@ -181,6 +189,25 @@ render_header(t('nav_platform_users'), 'platform_users', true); + + 1): ?> +
+ of users + +
+ diff --git a/uploads/trucks/reg_69c222f680ca5.jpg b/uploads/trucks/reg_69c222f680ca5.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f680ca5.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f68d477.jpg b/uploads/trucks/reg_69c222f68d477.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f68d477.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f68f3ca.jpg b/uploads/trucks/reg_69c222f68f3ca.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f68f3ca.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f690c1c.jpg b/uploads/trucks/reg_69c222f690c1c.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f690c1c.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f691903.jpg b/uploads/trucks/reg_69c222f691903.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f691903.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f69343f.jpg b/uploads/trucks/reg_69c222f69343f.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f69343f.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f697e5d.jpg b/uploads/trucks/reg_69c222f697e5d.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f697e5d.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f6996d8.jpg b/uploads/trucks/reg_69c222f6996d8.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f6996d8.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f69a0ab.jpg b/uploads/trucks/reg_69c222f69a0ab.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f69a0ab.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/reg_69c222f69b3a3.jpg b/uploads/trucks/reg_69c222f69b3a3.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/reg_69c222f69b3a3.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f680ca4.jpg b/uploads/trucks/truck_69c222f680ca4.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f680ca4.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f68d475.jpg b/uploads/trucks/truck_69c222f68d475.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f68d475.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f68f3c8.jpg b/uploads/trucks/truck_69c222f68f3c8.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f68f3c8.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f690c1b.jpg b/uploads/trucks/truck_69c222f690c1b.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f690c1b.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f691901.jpg b/uploads/trucks/truck_69c222f691901.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f691901.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f69343d.jpg b/uploads/trucks/truck_69c222f69343d.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f69343d.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f697e5b.jpg b/uploads/trucks/truck_69c222f697e5b.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f697e5b.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f6996d7.jpg b/uploads/trucks/truck_69c222f6996d7.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f6996d7.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f69a0a9.jpg b/uploads/trucks/truck_69c222f69a0a9.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f69a0a9.jpg @@ -0,0 +1 @@ +Sample Document diff --git a/uploads/trucks/truck_69c222f69b3a2.jpg b/uploads/trucks/truck_69c222f69b3a2.jpg new file mode 100644 index 0000000..a0e1827 --- /dev/null +++ b/uploads/trucks/truck_69c222f69b3a2.jpg @@ -0,0 +1 @@ +Sample Document