query("SELECT * FROM charity_settings WHERE id = 1"); $charity = $stmt->fetch(); $charity_name = $charity['charity_name'] ?? 'بريد الجمعية'; $charity_logo = $charity['charity_logo'] ?? null; $charity_favicon = $charity['charity_favicon'] ?? null; // Fetch current user info if logged in $current_user = null; if (isLoggedIn()) { $stmt = db()->prepare("SELECT full_name, profile_image, theme, can_view, can_add, can_edit, can_delete FROM users WHERE id = ?"); $stmt->execute([$_SESSION['user_id']]); $current_user = $stmt->fetch(); // Update session permissions $_SESSION['can_view'] = $current_user['can_view']; $_SESSION['can_add'] = $current_user['can_add']; $_SESSION['can_edit'] = $current_user['can_edit']; $_SESSION['can_delete'] = $current_user['can_delete']; } $user_theme = $current_user['theme'] ?? 'light'; ?> <?= htmlspecialchars($charity_name) ?>