add slogan
This commit is contained in:
parent
9e429aea35
commit
36d1266f5e
@ -35,6 +35,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_charity'])) {
|
||||
$_SESSION['error'] = 'عذراً، ليس لديك الصلاحية لتعديل الإعدادات';
|
||||
} else {
|
||||
$charity_name = $_POST['charity_name'];
|
||||
$charity_slogan = $_POST['charity_slogan'] ?? null;
|
||||
$charity_email = $_POST['charity_email'];
|
||||
$charity_phone = $_POST['charity_phone'];
|
||||
$charity_address = $_POST['charity_address'];
|
||||
@ -60,8 +61,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_charity'])) {
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = db()->prepare("UPDATE charity_settings SET charity_name = ?, charity_email = ?, charity_phone = ?, charity_address = ?, charity_logo = ?, charity_favicon = ? WHERE id = 1");
|
||||
$stmt->execute([$charity_name, $charity_email, $charity_phone, $charity_address, $charity_logo, $charity_favicon]);
|
||||
$stmt = db()->prepare("UPDATE charity_settings SET charity_name = ?, charity_slogan = ?, charity_email = ?, charity_phone = ?, charity_address = ?, charity_logo = ?, charity_favicon = ? WHERE id = 1");
|
||||
$stmt->execute([$charity_name, $charity_slogan, $charity_email, $charity_phone, $charity_address, $charity_logo, $charity_favicon]);
|
||||
$_SESSION['success'] = 'تم تحديث إعدادات النظام بنجاح';
|
||||
}
|
||||
redirect('charity-settings.php');
|
||||
@ -241,14 +242,20 @@ $post_max = ini_get('post_max_size');
|
||||
<label class="form-label fw-bold">اسم النظام / الجهة</label>
|
||||
<input type="text" name="charity_name" class="form-control" value="<?= htmlspecialchars($charity['charity_name'] ?? '') ?>" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label fw-bold">شعار الجهة (Slogan)</label>
|
||||
<input type="text" name="charity_slogan" class="form-control" value="<?= htmlspecialchars($charity['charity_slogan'] ?? '') ?>" placeholder="أدخل شعار الجهة الذي سيظهر تحت الاسم">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label fw-bold">البريد الإلكتروني الرسمي</label>
|
||||
<input type="email" name="charity_email" class="form-control" value="<?= htmlspecialchars($charity['charity_email'] ?? '') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-bold">رقم الهاتف</label>
|
||||
<input type="text" name="charity_phone" class="form-control" value="<?= htmlspecialchars($charity['charity_phone'] ?? '') ?>">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label fw-bold">رقم الهاتف</label>
|
||||
<input type="text" name="charity_phone" class="form-control" value="<?= htmlspecialchars($charity['charity_phone'] ?? '') ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-bold">العنوان</label>
|
||||
|
||||
2
db/migrations/017_add_slogan_to_settings.sql
Normal file
2
db/migrations/017_add_slogan_to_settings.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- Add slogan field to charity_settings table
|
||||
ALTER TABLE charity_settings ADD COLUMN IF NOT EXISTS charity_slogan VARCHAR(255) DEFAULT NULL AFTER charity_name;
|
||||
@ -293,7 +293,7 @@ if (!isLoggedIn() && basename($_SERVER['PHP_SELF']) !== 'login.php' && basename(
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar d-flex flex-column" id="sidebar">
|
||||
<div class="p-3 text-center border-bottom border-secondary">
|
||||
<a href="index.php" class="text-decoration-none text-white d-block logo-link">
|
||||
<a href="user_dashboard.php" class="text-decoration-none text-white d-block logo-link">
|
||||
<?php if (!empty($sys_settings['site_logo'])): ?>
|
||||
<img src="<?= $sys_settings['site_logo'] ?>" alt="Logo" class="img-fluid mb-2" style="max-height: 50px;">
|
||||
<?php endif; ?>
|
||||
@ -303,7 +303,7 @@ if (!isLoggedIn() && basename($_SERVER['PHP_SELF']) !== 'login.php' && basename(
|
||||
|
||||
<ul class="nav flex-column mt-3 mb-4">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'index.php' || basename($_SERVER['PHP_SELF']) == 'user_dashboard.php') ? 'active' : '' ?>" href="index.php">
|
||||
<a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'user_dashboard.php') ? 'active' : '' ?>" href="user_dashboard.php">
|
||||
<i class="fas fa-tachometer-alt me-2"></i> لوحة التحكم
|
||||
</a>
|
||||
</li>
|
||||
@ -351,10 +351,18 @@ if (!isLoggedIn() && basename($_SERVER['PHP_SELF']) !== 'login.php' && basename(
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (canView('users') || canView('settings')): ?>
|
||||
<?php if (canView('users') || canView('settings') || isAdmin()): ?>
|
||||
<div class="sidebar-heading">الإدارة</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isAdmin()): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'index.php' ? 'active' : '' ?>" href="index.php">
|
||||
<i class="fas fa-chart-line me-2"></i> إحصائيات النظام
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (canView('users')): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'users.php' ? 'active' : '' ?>" href="users.php">
|
||||
|
||||
@ -19,6 +19,7 @@ if (!function_exists('get_settings')) {
|
||||
|
||||
$settings = [
|
||||
'site_name' => $charity['charity_name'] ?? 'نظام إدارة البريد',
|
||||
'site_slogan' => $charity['charity_slogan'] ?? '',
|
||||
'site_email' => $charity['charity_email'] ?? '',
|
||||
'site_phone' => $charity['charity_phone'] ?? '',
|
||||
'site_address' => $charity['charity_address'] ?? '',
|
||||
@ -46,6 +47,7 @@ if (!function_exists('get_settings')) {
|
||||
// Fallback settings if DB is not ready
|
||||
$settings = [
|
||||
'site_name' => 'نظام إدارة البريد',
|
||||
'site_slogan' => '',
|
||||
'site_maintenance' => false,
|
||||
'smtp' => ['enabled' => false]
|
||||
];
|
||||
@ -65,6 +67,7 @@ if (!function_exists('getCharitySettings')) {
|
||||
// Return only the keys that might be expected by older code
|
||||
return [
|
||||
'charity_name' => $settings['site_name'],
|
||||
'charity_slogan' => $settings['site_slogan'],
|
||||
'charity_email' => $settings['site_email'],
|
||||
'charity_phone' => $settings['site_phone'],
|
||||
'charity_address' => $settings['site_address'],
|
||||
|
||||
@ -42,6 +42,7 @@ $settings = get_settings();
|
||||
$logo = !empty($settings['site_logo']) ? $settings['site_logo'] : '';
|
||||
$site_name = $settings['site_name'];
|
||||
$site_address = $settings['site_address'];
|
||||
$site_slogan = $settings['site_slogan'];
|
||||
|
||||
/**
|
||||
* Convert Gregorian date to Hijri
|
||||
@ -134,8 +135,8 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
/* Header Style */
|
||||
.header-container {
|
||||
border-bottom: 3px double #00827F;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: 2px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
@ -144,16 +145,18 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
max-height: 80px;
|
||||
}
|
||||
.header-info { text-align: left; }
|
||||
.site-name { font-size: 24px; font-weight: bold; color: #00827F; margin-bottom: 5px; }
|
||||
.site-name { font-size: 24px; font-weight: bold; color: #00827F; margin-bottom: 2px; }
|
||||
.site-slogan { font-size: 14px; font-weight: bold; color: #00827F; margin-bottom: 2px; }
|
||||
|
||||
/* Meta & Content */
|
||||
.mail-meta {
|
||||
margin-bottom: 25px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #f9f9f9;
|
||||
padding: 12px;
|
||||
border: 1px solid #eee;
|
||||
background: transparent;
|
||||
padding: 2px 0;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mail-content {
|
||||
font-size: 18px;
|
||||
@ -261,6 +264,9 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
</div>
|
||||
<div class="header-info">
|
||||
<div class="site-name"><?= htmlspecialchars($site_name) ?></div>
|
||||
<?php if (!empty($site_slogan)): ?>
|
||||
<div class="site-slogan"><?= htmlspecialchars($site_slogan) ?></div>
|
||||
<?php endif; ?>
|
||||
<div style="font-size: 12px; color: #666;"><?= htmlspecialchars($site_address) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -42,6 +42,7 @@ $settings = get_settings();
|
||||
$logo = !empty($settings['site_logo']) ? $settings['site_logo'] : '';
|
||||
$site_name = $settings['site_name'];
|
||||
$site_address = $settings['site_address'];
|
||||
$site_slogan = $settings['site_slogan'];
|
||||
|
||||
/**
|
||||
* Convert Gregorian date to Hijri
|
||||
@ -134,8 +135,8 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
/* Header Style */
|
||||
.header-container {
|
||||
border-bottom: 3px double #00827F;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: 2px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
@ -144,16 +145,18 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
max-height: 80px;
|
||||
}
|
||||
.header-info { text-align: left; }
|
||||
.site-name { font-size: 24px; font-weight: bold; color: #00827F; margin-bottom: 5px; }
|
||||
.site-name { font-size: 24px; font-weight: bold; color: #00827F; margin-bottom: 2px; }
|
||||
.site-slogan { font-size: 14px; font-weight: bold; color: #00827F; margin-bottom: 2px; }
|
||||
|
||||
/* Meta & Content */
|
||||
.mail-meta {
|
||||
margin-bottom: 25px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #f9f9f9;
|
||||
padding: 12px;
|
||||
border: 1px solid #eee;
|
||||
background: transparent;
|
||||
padding: 2px 0;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mail-content {
|
||||
font-size: 18px;
|
||||
@ -261,6 +264,9 @@ $hijriDate = gregorianToHijri($mail['date_registered']);
|
||||
</div>
|
||||
<div class="header-info">
|
||||
<div class="site-name"><?= htmlspecialchars($site_name) ?></div>
|
||||
<?php if (!empty($site_slogan)): ?>
|
||||
<div class="site-slogan"><?= htmlspecialchars($site_slogan) ?></div>
|
||||
<?php endif; ?>
|
||||
<div style="font-size: 12px; color: #666;"><?= htmlspecialchars($site_address) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user