diff --git a/charity-settings.php b/charity-settings.php index 3a180a5..32620c7 100644 --- a/charity-settings.php +++ b/charity-settings.php @@ -67,6 +67,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_charity'])) { redirect('charity-settings.php'); } +// Handle Advanced Settings Update (Super Admin Only) +if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_advanced'])) { + if (!isSuperAdmin()) { + $_SESSION['error'] = 'عذراً، هذا الإجراء متاح للمدير الخارق فقط'; + } else { + $site_maintenance = isset($_POST['site_maintenance']) ? 1 : 0; + $allow_registration = isset($_POST['allow_registration']) ? 1 : 0; + $site_footer = $_POST['site_footer']; + + $stmt = db()->prepare("UPDATE charity_settings SET site_maintenance = ?, allow_registration = ?, site_footer = ? WHERE id = 1"); + $stmt->execute([$site_maintenance, $allow_registration, $site_footer]); + $_SESSION['success'] = 'تم تحديث الإعدادات المتقدمة بنجاح'; + } + redirect('charity-settings.php'); +} + // Handle SMTP Settings Update if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_smtp'])) { if (!canEdit('settings')) { @@ -200,6 +216,11 @@ $post_max = ini_get('post_max_size');