From dcae1a1ef0ce9a0a2cbd6b10991e8024bf1bb433 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 13 Feb 2026 12:13:01 +0000 Subject: [PATCH] Autosave: 20260213-121301 --- about.php | 82 +++++ admin/i18n.php | 6 +- admin/sidebar.php | 4 + case.php | 272 ++++++++++++++++ contact.php | 136 ++++++++ includes/footer.php | 11 + includes/header.php | 243 +++++++++++++++ index.php | 736 ++++++++++++++------------------------------ 8 files changed, 982 insertions(+), 508 deletions(-) create mode 100644 about.php create mode 100644 case.php create mode 100644 contact.php create mode 100644 includes/footer.php create mode 100644 includes/header.php diff --git a/about.php b/about.php new file mode 100644 index 0000000..50beb87 --- /dev/null +++ b/about.php @@ -0,0 +1,82 @@ + [ + 'title' => 'About Us', + 'subtitle' => 'Learn more about our mission, vision, and values.', + 'lang_name' => 'العربية', + 'lang_code' => 'ar', + 'hero_title' => 'About Our Organization', + 'hero_sub' => 'Dedicated to making a difference in the world.', + 'admin_panel' => 'Admin Panel', + 'home' => 'Home', + 'about_us' => 'About Us', + 'contact_us' => 'Contact Us', + ], + 'ar' => [ + 'title' => 'من نحن', + 'subtitle' => 'تعرف على المزيد حول مهمتنا ورؤيتنا وقيمنا.', + 'lang_name' => 'English', + 'lang_code' => 'en', + 'hero_title' => 'حول منظمتنا', + 'hero_sub' => 'مكرسون لإحداث فرق في العالم.', + 'admin_panel' => 'لوحة التحكم', + 'home' => 'الرئيسية', + 'about_us' => 'من نحن', + 'contact_us' => 'اتصل بنا', + ] +]; + +$t = $texts[$lang]; + +// Database fetch +$pdo = db(); +$profile = $pdo->query("SELECT * FROM org_profile LIMIT 1")->fetch(); + +require_once 'includes/header.php'; +?> + +
+
+

+

+
+
+ +
+
+
+
+

Our Mission

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh.

+

Our Vision

+

Praesent vitae arcu tempor, aliquet nisl et, accumsan lectus. Curabitur vel sem sit amet nulla fermentum consequat. In eget nisl sedligula ultrices commodo. Nam vel velit nec turpis blandit malesuada. Duis ac accumsan erat. Phasellus et ex pretium, consequat lacus eget, pulvinar turpis. Integer maximus magna et, porttitor purus. Quisque non sodales sem, id eleifend tellus. Nulla ut sit amet sem non neque pellentesque.sdf

+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/admin/i18n.php b/admin/i18n.php index d63f220..eeb10dc 100644 --- a/admin/i18n.php +++ b/admin/i18n.php @@ -9,7 +9,7 @@ if (isset($_GET['lang']) && in_array($_GET['lang'], ['en', 'ar'])) { $_SESSION['lang'] = $_GET['lang']; } -$lang = $_SESSION['lang'] ?? 'en'; +$lang = $_SESSION['lang'] ?? 'ar'; $is_rtl = ($lang === 'ar'); $translations = [ @@ -193,6 +193,7 @@ $translations = [ 'Last 30 Days' => 'Last 30 Days', 'Quick Links' => 'Quick Links', 'View All' => 'View All', + 'view_website' => 'View Website', ], 'ar' => [ 'dashboard' => 'لوحة التحكم', @@ -374,6 +375,7 @@ $translations = [ 'Last 30 Days' => 'آخر 30 يوماً', 'Quick Links' => 'روابط سريعة', 'View All' => 'عرض الكل', + 'view_website' => 'عرض الموقع', ] ]; @@ -390,4 +392,4 @@ function get_current_lang() { function is_rtl() { global $is_rtl; return $is_rtl; -} +} \ No newline at end of file diff --git a/admin/sidebar.php b/admin/sidebar.php index bab0ed8..f23d49e 100644 --- a/admin/sidebar.php +++ b/admin/sidebar.php @@ -44,6 +44,10 @@ $current_lang = get_current_lang(); + + + +
diff --git a/case.php b/case.php new file mode 100644 index 0000000..725ca46 --- /dev/null +++ b/case.php @@ -0,0 +1,272 @@ + [ + 'title' => 'Case Details', + 'raised' => 'Raised', + 'of' => 'of', + 'goal' => 'Goal', + 'donate_now' => 'Donate Now', + 'modal_title' => 'Make a Donation', + 'modal_amount' => 'Amount (OMR)', + 'modal_name' => 'Your Name', + 'modal_email' => 'Your Email', + 'modal_phone' => 'Phone Number', + 'modal_submit' => 'Proceed to Payment', + 'back_to_home' => 'Back to All Cases', + 'case_not_found' => 'Case Not Found', + 'case_not_found_desc' => 'The case you are looking for does not exist or is no longer active.', + 'donate_type_me' => 'Donate for myself', + 'donate_type_gift' => 'Donate as a gift', + 'recipient_name' => 'Recipient Name', + 'recipient_phone' => 'Recipient Phone', + 'gift_message' => 'Gift Message', + 'gift_notice' => 'The system will send a notification to the recipient.', + 'home' => 'Home', + 'about_us' => 'About Us', + 'contact_us' => 'Contact Us', + 'admin_panel' => 'Admin Panel', + 'lang_name' => 'العربية', + 'lang_code' => 'ar', + ], + 'ar' => [ + 'title' => 'تفاصيل الحالة', + 'raised' => 'تم جمع', + 'of' => 'من', + 'goal' => 'الهدف', + 'donate_now' => 'تبرع الآن', + 'modal_title' => 'تبرع الآن', + 'modal_amount' => 'المبلغ (ريال عماني)', + 'modal_name' => 'الاسم', + 'modal_email' => 'البريد الإلكتروني', + 'modal_phone' => 'رقم الهاتف', + 'modal_submit' => 'الانتقال للدفع', + 'back_to_home' => 'العودة إلى جميع الحالات', + 'case_not_found' => 'الحالة غير موجودة', + 'case_not_found_desc' => 'الحالة التي تبحث عنها غير موجودة أو لم تعد نشطة.', + 'donate_type_me' => 'تبرع لنفسي', + 'donate_type_gift' => 'تبرع كهدية لشخص آخر', + 'recipient_name' => 'اسم المستلم', + 'recipient_phone' => 'رقم هاتف المستلم', + 'gift_message' => 'رسالة الهدية', + 'gift_notice' => 'سيقوم النظام بإرسال إشعار إلى المستلم.', + 'home' => 'الرئيسية', + 'about_us' => 'من نحن', + 'contact_us' => 'اتصل بنا', + 'admin_panel' => 'لوحة التحكم', + 'lang_name' => 'English', + 'lang_code' => 'en', + ] +]; + +$t = $texts[$lang]; + +// Database fetch +$pdo = db(); +$profile = $pdo->query("SELECT * FROM org_profile LIMIT 1")->fetch(); + +// Get Case ID +$case_id = isset($_GET['id']) ? (int)$_GET['id'] : 0; + +if ($case_id === 0) { + $case = null; +} else { + $stmt = $pdo->prepare("SELECT c.*, cat.name_en as cat_name_en, cat.name_ar as cat_name_ar + FROM cases c + LEFT JOIN categories cat ON c.category_id = cat.id + WHERE c.id = :id AND c.status = 'active'"); + $stmt->execute(['id' => $case_id]); + $case = $stmt->fetch(); +} + +require_once 'includes/header.php'; +?> + + + + +
+
+

+

+
+
+ +
+
+
+
+ + Case Image + + +
+

+
+ +
+
+
+
+
+ : OMR + : OMR +
+
+ +
+ +
+
+
+
+
+ +
+
+ +

+

+ + + +
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..fef340d --- /dev/null +++ b/contact.php @@ -0,0 +1,136 @@ + [ + 'title' => 'Contact Us', + 'subtitle' => 'We\'d love to hear from you!', + 'lang_name' => 'العربية', + 'lang_code' => 'ar', + 'hero_title' => 'Get in Touch', + 'hero_sub' => 'Fill out the form below to send us a message.', + 'admin_panel' => 'Admin Panel', + 'home' => 'Home', + 'about_us' => 'About Us', + 'contact_us' => 'Contact Us', + 'your_name' => 'Your Name', + 'your_email' => 'Your Email', + 'your_message' => 'Your Message', + 'send_message' => 'Send Message', + 'message_sent' => 'Your message has been sent successfully!', + 'message_error' => 'There was an error sending your message. Please try again later.', + ], + 'ar' => [ + 'title' => 'اتصل بنا', + 'subtitle' => 'يسعدنا أن نسمع منك!', + 'lang_name' => 'English', + 'lang_code' => 'en', + 'hero_title' => 'تواصل معنا', + 'hero_sub' => 'املأ النموذج أدناه لإرسال رسالة لنا.', + 'admin_panel' => 'لوحة التحكم', + 'home' => 'الرئيسية', + 'about_us' => 'من نحن', + 'contact_us' => 'اتصل بنا', + 'your_name' => 'اسمك', + 'your_email' => 'بريدك الإلكتروني', + 'your_message' => 'رسالتك', + 'send_message' => 'إرسال الرسالة', + 'message_sent' => 'تم إرسال رسالتك بنجاح!', + 'message_error' => 'حدث خطأ أثناء إرسال رسالتك. يرجى المحاولة مرة أخرى في وقت لاحق.', + ] +]; + +$t = $texts[$lang]; + +$message_status = null; +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $name = $_POST['name'] ?? ''; + $email = $_POST['email'] ?? ''; + $message = $_POST['message'] ?? ''; + + $result = MailService::sendContactMessage($name, $email, $message); + + if ($result['success']) { + $message_status = 'success'; + } else { + $message_status = 'error'; + } +} + +// Database fetch +$pdo = db(); +$profile = $pdo->query("SELECT * FROM org_profile LIMIT 1")->fetch(); + +require_once 'includes/header.php'; +?> + + +
+
+

+

+
+
+ +
+
+
+
+ + + + + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + + + + + diff --git a/includes/footer.php b/includes/footer.php new file mode 100644 index 0000000..60e702f --- /dev/null +++ b/includes/footer.php @@ -0,0 +1,11 @@ +
+
+ + + +

© . All rights reserved.

+

Address, City, Country

+

Phone: +123456789 | Email: info@example.com

+
+
\ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..ebbddeb --- /dev/null +++ b/includes/header.php @@ -0,0 +1,243 @@ + + + + + + + <?= ($lang === 'en' ? ($profile['name_en'] ?? 'Organization') : ($profile['name_ar'] ?? 'المؤسسة')) . ' - ' . $t['title'] ?> + + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+ +
+ + +
+ + + + + [] +   + + + + +
+ + +
+
+
+
+
+
+ + diff --git a/index.php b/index.php index e79e8a8..6eb59ea 100644 --- a/index.php +++ b/index.php @@ -2,8 +2,8 @@ require_once 'db/config.php'; // Language configuration -$lang = $_GET['lang'] ?? 'en'; -if (!in_array($lang, ['en', 'ar'])) $lang = 'en'; +$lang = $_GET['lang'] ?? 'ar'; +if (!in_array($lang, ['en', 'ar'])) $lang = 'ar'; $dir = ($lang === 'ar') ? 'rtl' : 'ltr'; // UI Text @@ -44,7 +44,10 @@ $texts = [ 'gift_message' => 'Gift Message', 'gift_notice' => 'The system will send a notification to the recipient.', 'read_more' => 'Read More', - 'close' => 'Close' + 'close' => 'Close', + 'home' => 'Home', + 'about_us' => 'About Us', + 'contact_us' => 'Contact Us', ], 'ar' => [ 'title' => 'ادعم قضية', @@ -82,7 +85,10 @@ $texts = [ 'gift_message' => 'رسالة الهدية', 'gift_notice' => 'سيقوم النظام بإرسال إشعار إلى المستلم.', 'read_more' => 'اقرأ المزيد', - 'close' => 'إغلاق' + 'close' => 'إغلاق', + 'home' => 'الرئيسية', + 'about_us' => 'من نحن', + 'contact_us' => 'اتصل بنا', ] ]; @@ -124,10 +130,6 @@ $stmt = $pdo->prepare($sql); $stmt->execute($params); $cases = $stmt->fetchAll(); -// Project meta -$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? $t['subtitle']; -$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; - // Helpers for safe string operations function safe_strlen($text) { if (empty($text)) return 0; @@ -144,487 +146,251 @@ function safe_truncate($text, $limit = 120) { } return (strlen($text) > $limit) ? substr($text, 0, $limit) . "..." : $text; } + +require_once 'includes/header.php'; ?> - - - - - - <?= ($lang === 'en' ? ($profile['name_en'] ?? 'Organization') : ($profile['name_ar'] ?? 'المؤسسة')) . ' - ' . $t['title'] ?> - - "> - - - - - - - + - - - - -
-
-
- - -
-
- -
- - -
- - -
- - [] -   -
- - - -
- - -
-
-
-
-
-
- - +#giftFields { + display: none; + border: 1px solid #e5e7eb; + padding: 1.25rem; + border-radius: 12px; + background: #f9fafb; + margin-top: 1rem; +} +
@@ -697,18 +463,13 @@ function safe_truncate($text, $limit = 120) {
-

+

+ + + +

- - - - -

@@ -733,24 +494,6 @@ function safe_truncate($text, $limit = 120) {
- - - -
-
- - - -

© . All rights reserved.

-
-
+