query("SELECT * FROM events ORDER BY event_date ASC, start_time ASC");
$events = $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
die("خطأ في قاعدة البيانات");
}
$settings = get_settings();
$logo_path = $settings['site_logo'] ?? '';
if (empty($logo_path) || !file_exists($logo_path)) {
if (!empty($logo_path) && file_exists('uploads/charity/' . $logo_path)) {
$logo_path = 'uploads/charity/' . $logo_path;
} else {
$possible_logos = glob('uploads/charity/*logo*.*');
if (!empty($possible_logos)) {
$logo_path = $possible_logos[0];
} else {
$logo_path = '';
}
}
}
$logo_html = '';
if ($logo_path) {
$logo_html = '';
}
?>
| # | عنوان الحدث | التاريخ | الوقت | المكان | التفاصيل |
|---|---|---|---|---|---|
| = $count++ ?> | = htmlspecialchars($e['title'] ?? '') ?> | = $formatted_date ?> | = htmlspecialchars($time_str) ?> | = htmlspecialchars($e['location'] ?? 'غير محدد') ?> | = nl2br(htmlspecialchars($e['description'] ?? '')) ?> |