From 0e4184bcba0f439b0355f9cb435646a09e0e1083 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 13 Feb 2026 08:55:01 +0000 Subject: [PATCH] change currency symbol --- admin/cases.php | 10 ++-- admin/donations.php | 4 +- admin/index.php | 6 +-- checkout.php | 19 ++++++-- index.php | 107 ++++++++++++++++++++++++++++++++++++++--- mail/WablasService.php | 26 ++++++++++ success.php | 15 ++++-- 7 files changed, 162 insertions(+), 25 deletions(-) diff --git a/admin/cases.php b/admin/cases.php index 0124646..32f3571 100644 --- a/admin/cases.php +++ b/admin/cases.php @@ -139,8 +139,8 @@ if (isset($_GET['edit'])) { -
$
- Raised: $ +
OMR
+ Raised: OMR @@ -215,8 +215,8 @@ if (isset($_GET['edit'])) {
- - + +
@@ -297,4 +297,4 @@ if (isset($_GET['edit'])) { - + \ No newline at end of file diff --git a/admin/donations.php b/admin/donations.php index f72d56a..0ed9899 100644 --- a/admin/donations.php +++ b/admin/donations.php @@ -70,7 +70,7 @@ $donations = $pdo->query("SELECT d.*, c.title_en as case_title, cat.name_en as c
- $ + OMR @@ -90,4 +90,4 @@ $donations = $pdo->query("SELECT d.*, c.title_en as case_title, cat.name_en as c
- + \ No newline at end of file diff --git a/admin/index.php b/admin/index.php index f8fe67f..c92e5b2 100644 --- a/admin/index.php +++ b/admin/index.php @@ -84,7 +84,7 @@ $recent_donations = $pdo->query("
Total Donations
-
$
+
OMR
@@ -121,7 +121,7 @@ $recent_donations = $pdo->query("
- $ + OMR @@ -137,4 +137,4 @@ $recent_donations = $pdo->query(" - + \ No newline at end of file diff --git a/checkout.php b/checkout.php index 0172862..3e0988c 100644 --- a/checkout.php +++ b/checkout.php @@ -13,6 +13,12 @@ $donor_name = $_POST['donor_name'] ?? 'Anonymous'; $donor_email = $_POST['donor_email'] ?? ''; $donor_phone = $_POST['donor_phone'] ?? ''; +// Gift fields +$is_gift = (int)($_POST['is_gift'] ?? 0); +$gift_recipient_name = $_POST['gift_recipient_name'] ?? null; +$gift_recipient_phone = $_POST['gift_recipient_phone'] ?? null; +$gift_message = $_POST['gift_message'] ?? null; + if ($amount <= 0) { die("Invalid amount"); } @@ -29,8 +35,10 @@ if (!$case) { } // Create pending donation -$stmt = $pdo->prepare("INSERT INTO donations (case_id, amount, status, donor_name, donor_email, donor_phone) VALUES (?, ?, 'pending', ?, ?, ?)"); -$stmt->execute([$case_id, $amount, $donor_name, $donor_email, $donor_phone]); +$sql = "INSERT INTO donations (case_id, amount, status, donor_name, donor_email, donor_phone, is_gift, gift_recipient_name, gift_recipient_phone, gift_message) + VALUES (?, ?, 'pending', ?, ?, ?, ?, ?, ?, ?)"; +$stmt = $pdo->prepare($sql); +$stmt->execute([$case_id, $amount, $donor_name, $donor_email, $donor_phone, $is_gift, $gift_recipient_name, $gift_recipient_phone, $gift_message]); $donation_id = $pdo->lastInsertId(); // Thawani Checkout Session Request @@ -39,7 +47,7 @@ $payload = [ 'mode' => 'payment', 'products' => [ [ - 'name' => $case['title_en'], + 'name' => ($is_gift ? "Gift Donation: " : "") . $case['title_en'], 'unit_amount' => (int)($amount * 1000), // Thawani uses OMR baiza (1 OMR = 1000 baiza) 'quantity' => 1 ] @@ -66,6 +74,9 @@ if (THAWANI_SECRET_KEY === 'rRQ26GcsZ60u9Y9v9876543210' || empty(THAWANI_SECRET_

Thawani Checkout Simulation

Donation ID: #

Amount: OMR

+ +
Gift for: ()
+
This is a simulation because no valid Thawani keys are configured in db/thawani_config.php.
@@ -119,4 +130,4 @@ if (isset($data['success']) && $data['success'] === true && isset($data['data'][ print_r($data); echo ""; echo "Go Back"; -} +} \ No newline at end of file diff --git a/index.php b/index.php index 124ba5c..035351c 100644 --- a/index.php +++ b/index.php @@ -36,7 +36,13 @@ $texts = [ 'new_badge' => 'NEW', 'monthly_giving' => 'Join our monthly giving circle', 'clear_search' => 'Clear Search', - 'priority_notice' => 'LATEST UPDATES' + 'priority_notice' => 'LATEST UPDATES', + '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.' ], 'ar' => [ 'title' => 'ادعم قضية', @@ -66,7 +72,13 @@ $texts = [ 'new_badge' => 'جديد', 'monthly_giving' => 'انضم إلى دائرة العطاء الشهري', 'clear_search' => 'مسح البحث', - 'priority_notice' => 'آخر التحديثات' + 'priority_notice' => 'آخر التحديثات', + 'donate_type_me' => 'تبرع لنفسي', + 'donate_type_gift' => 'تبرع كهدية لشخص آخر', + 'recipient_name' => 'اسم المستلم', + 'recipient_phone' => 'رقم هاتف المستلم', + 'gift_message' => 'رسالة الهدية', + 'gift_notice' => 'سيقوم النظام بإرسال إشعار إلى المستلم.' ] ]; @@ -502,6 +514,40 @@ function safe_truncate($text, $limit = 120) { [dir="rtl"] .hero h1 { letter-spacing: 0; } + + .donate-type-selector { + display: flex; + background: #f3f4f6; + padding: 4px; + border-radius: 12px; + margin-bottom: 1.5rem; + } + + .donate-type-btn { + flex: 1; + text-align: center; + padding: 8px; + border-radius: 10px; + cursor: pointer; + font-weight: 600; + font-size: 0.875rem; + transition: all 0.2s; + } + + .donate-type-btn.active { + background: #fff; + color: var(--primary-color); + box-shadow: 0 2px 4px rgba(0,0,0,0.05); + } + + #giftFields { + display: none; + border: 1px solid #e5e7eb; + padding: 1.25rem; + border-radius: 12px; + background: #f9fafb; + margin-top: 1rem; + } @@ -633,8 +679,8 @@ function safe_truncate($text, $limit = 120) {
- : $ - : $ + : OMR + : OMR
@@ -663,11 +709,23 @@ function safe_truncate($text, $limit = 120) {

+ + + + +
- $ + OMR
@@ -675,7 +733,7 @@ function safe_truncate($text, $limit = 120) { -
+
@@ -685,6 +743,26 @@ function safe_truncate($text, $limit = 120) {
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
-

A confirmation message has been sent to your WhatsApp number.

+

Confirmation messages have been sent to the relevant parties.

Return to Home @@ -127,4 +132,4 @@ if ($donation) { - + \ No newline at end of file