Autosave: 20260228-033101
This commit is contained in:
parent
e1febf7e84
commit
3aa10f537e
@ -1,7 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
background-color: #f8f9fa;
|
||||||
background-size: 400% 400%;
|
|
||||||
animation: gradient 15s ease infinite;
|
|
||||||
color: #212529;
|
color: #212529;
|
||||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -36,22 +34,20 @@ body {
|
|||||||
.chat-container {
|
.chat-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
background: rgba(255, 255, 255, 0.85);
|
background: #ffffff;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 85vh;
|
height: 85vh;
|
||||||
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
|
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
|
||||||
backdrop-filter: blur(15px);
|
|
||||||
-webkit-backdrop-filter: blur(15px);
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-header {
|
.chat-header {
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: #f8f9fa;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -78,12 +74,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
background: rgba(255, 255, 255, 0.3);
|
background: rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
@ -92,32 +88,32 @@ body {
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
|
||||||
animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
from { opacity: 0; transform: translateY(20px) scale(0.95); }
|
from { opacity: 0; transform: translateY(10px); }
|
||||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
to { opacity: 1; transform: translateY(0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.visitor {
|
.message.visitor {
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
background: linear-gradient(135deg, #212529 0%, #343a40 100%);
|
background: #0d6efd;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.bot {
|
.message.bot {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
background: #ffffff;
|
background: #f1f3f5;
|
||||||
color: #212529;
|
color: #212529;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-input-area {
|
.chat-input-area {
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: #fff;
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,17 +128,17 @@ body {
|
|||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: rgba(255, 255, 255, 0.9);
|
background: #fff;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-input-area input:focus {
|
.chat-input-area input:focus {
|
||||||
border-color: #23a6d5;
|
border-color: #0d6efd;
|
||||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
|
box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-input-area button {
|
.chat-input-area button {
|
||||||
background: #212529;
|
background: #0d6efd;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.75rem 1.5rem;
|
padding: 0.75rem 1.5rem;
|
||||||
@ -153,90 +149,34 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chat-input-area button:hover {
|
.chat-input-area button:hover {
|
||||||
background: #000;
|
background: #0b5ed7;
|
||||||
transform: translateY(-2px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Background Animations */
|
|
||||||
.bg-animations {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blob {
|
|
||||||
position: absolute;
|
|
||||||
width: 500px;
|
|
||||||
height: 500px;
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
border-radius: 50%;
|
|
||||||
filter: blur(80px);
|
|
||||||
animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.blob-1 {
|
|
||||||
top: -10%;
|
|
||||||
left: -10%;
|
|
||||||
background: rgba(238, 119, 82, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.blob-2 {
|
|
||||||
bottom: -10%;
|
|
||||||
right: -10%;
|
|
||||||
background: rgba(35, 166, 213, 0.4);
|
|
||||||
animation-delay: -7s;
|
|
||||||
width: 600px;
|
|
||||||
height: 600px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blob-3 {
|
|
||||||
top: 40%;
|
|
||||||
left: 30%;
|
|
||||||
background: rgba(231, 60, 126, 0.3);
|
|
||||||
animation-delay: -14s;
|
|
||||||
width: 450px;
|
|
||||||
height: 450px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes move {
|
|
||||||
0% { transform: translate(0, 0) rotate(0deg) scale(1); }
|
|
||||||
33% { transform: translate(150px, 100px) rotate(120deg) scale(1.1); }
|
|
||||||
66% { transform: translate(-50px, 200px) rotate(240deg) scale(0.9); }
|
|
||||||
100% { transform: translate(0, 0) rotate(360deg) scale(1); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-link {
|
.admin-link {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #fff;
|
color: #6c757d;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background: rgba(0, 0, 0, 0.2);
|
background: rgba(0, 0, 0, 0.05);
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-link:hover {
|
.admin-link:hover {
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.1);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Admin Styles */
|
/* Admin Styles */
|
||||||
.admin-container {
|
.admin-container {
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
margin: 3rem auto;
|
margin: 2rem auto;
|
||||||
padding: 2.5rem;
|
padding: 2rem;
|
||||||
background: rgba(255, 255, 255, 0.85);
|
background: #fff;
|
||||||
backdrop-filter: blur(20px);
|
border-radius: 16px;
|
||||||
-webkit-backdrop-filter: blur(20px);
|
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
|
||||||
border-radius: 24px;
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
box-shadow: 0 20px 50px rgba(0,0,0,0.15);
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
@ -244,7 +184,7 @@ body {
|
|||||||
.admin-container h1 {
|
.admin-container h1 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
color: #212529;
|
color: #212529;
|
||||||
font-weight: 800;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
@ -268,11 +208,12 @@ body {
|
|||||||
.table td {
|
.table td {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border: none;
|
border-top: 1px solid #f1f3f5;
|
||||||
|
border-bottom: 1px solid #f1f3f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table tr td:first-child { border-radius: 12px 0 0 12px; }
|
.table tr td:first-child { border-left: 1px solid #f1f3f5; border-radius: 8px 0 0 8px; }
|
||||||
.table tr td:last-child { border-radius: 0 12px 12px 0; }
|
.table tr td:last-child { border-right: 1px solid #f1f3f5; border-radius: 0 8px 8px 0; }
|
||||||
|
|
||||||
.form-group {
|
.form-group {
|
||||||
margin-bottom: 1.25rem;
|
margin-bottom: 1.25rem;
|
||||||
@ -289,7 +230,7 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 12px;
|
border-radius: 8px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -297,6 +238,6 @@ body {
|
|||||||
|
|
||||||
.form-control:focus {
|
.form-control:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #23a6d5;
|
border-color: #0d6efd;
|
||||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.1);
|
box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ 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 = 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->execute([$charity_name, $charity_email, $charity_phone, $charity_address, $charity_logo, $charity_favicon]);
|
||||||
$_SESSION['success'] = 'تم تحديث إعدادات الجمعية بنجاح';
|
$_SESSION['success'] = 'تم تحديث إعدادات النظام بنجاح';
|
||||||
redirect('charity-settings.php');
|
redirect('charity-settings.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ $email_logs = db()->query("SELECT * FROM email_logs ORDER BY id DESC LIMIT 50")-
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<ul class="nav nav-tabs mb-4" id="settingsTabs" role="tablist">
|
<ul class="nav nav-tabs mb-4" id="settingsTabs" role="tablist">
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<button class="nav-link active" id="general-tab" data-bs-toggle="tab" data-bs-target="#general" type="button" role="tab">بيانات الجمعية</button>
|
<button class="nav-link active" id="general-tab" data-bs-toggle="tab" data-bs-target="#general" type="button" role="tab">بيانات النظام</button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<button class="nav-link" id="smtp-tab" data-bs-toggle="tab" data-bs-target="#smtp" type="button" role="tab">إعدادات SMTP</button>
|
<button class="nav-link" id="smtp-tab" data-bs-toggle="tab" data-bs-target="#smtp" type="button" role="tab">إعدادات SMTP</button>
|
||||||
@ -171,16 +171,16 @@ $email_logs = db()->query("SELECT * FROM email_logs ORDER BY id DESC LIMIT 50")-
|
|||||||
<div class="tab-content bg-white p-4 shadow-sm rounded border" id="settingsTabsContent">
|
<div class="tab-content bg-white p-4 shadow-sm rounded border" id="settingsTabsContent">
|
||||||
<!-- General Settings -->
|
<!-- General Settings -->
|
||||||
<div class="tab-pane show active" id="general" role="tabpanel">
|
<div class="tab-pane show active" id="general" role="tabpanel">
|
||||||
<h4 class="mb-4">بيانات الجمعية</h4>
|
<h4 class="mb-4">بيانات النظام</h4>
|
||||||
<form method="POST" enctype="multipart/form-data">
|
<form method="POST" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="update_charity" value="1">
|
<input type="hidden" name="update_charity" value="1">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 mb-3">
|
<div class="col-md-6 mb-3">
|
||||||
<label class="form-label">اسم الجمعية</label>
|
<label class="form-label">اسم النظام</label>
|
||||||
<input type="text" name="charity_name" class="form-control" value="<?= htmlspecialchars($charity['charity_name'] ?? '') ?>" required>
|
<input type="text" name="charity_name" class="form-control" value="<?= htmlspecialchars($charity['charity_name'] ?? '') ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 mb-3">
|
<div class="col-md-6 mb-3">
|
||||||
<label class="form-label">البريد الإلكتروني للجمعية</label>
|
<label class="form-label">البريد الإلكتروني للنظام</label>
|
||||||
<input type="email" name="charity_email" class="form-control" value="<?= htmlspecialchars($charity['charity_email'] ?? '') ?>">
|
<input type="email" name="charity_email" class="form-control" value="<?= htmlspecialchars($charity['charity_email'] ?? '') ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -194,7 +194,7 @@ $email_logs = db()->query("SELECT * FROM email_logs ORDER BY id DESC LIMIT 50")-
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 mb-3">
|
<div class="col-md-6 mb-3">
|
||||||
<label class="form-label">شعار الجمعية</label>
|
<label class="form-label">شعار النظام</label>
|
||||||
<input type="file" name="charity_logo" class="form-control" accept="image/*">
|
<input type="file" name="charity_logo" class="form-control" accept="image/*">
|
||||||
<?php if ($charity['charity_logo']): ?>
|
<?php if ($charity['charity_logo']): ?>
|
||||||
<div class="mt-2"><img src="<?= $charity['charity_logo'] ?>" alt="Logo" style="max-height: 80px;"></div>
|
<div class="mt-2"><img src="<?= $charity['charity_logo'] ?>" alt="Logo" style="max-height: 80px;"></div>
|
||||||
@ -208,7 +208,7 @@ $email_logs = db()->query("SELECT * FROM email_logs ORDER BY id DESC LIMIT 50")-
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-dark">تحديث إعدادات الجمعية</button>
|
<button type="submit" class="btn btn-dark">تحديث إعدادات النظام</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -10,10 +10,6 @@ $error = '';
|
|||||||
$success = '';
|
$success = '';
|
||||||
$step = 'request'; // 'request' or 'reset'
|
$step = 'request'; // 'request' or 'reset'
|
||||||
|
|
||||||
// Fetch charity settings for logo/name
|
|
||||||
$stmt = db()->query("SELECT * FROM charity_settings WHERE id = 1");
|
|
||||||
$charity = $stmt->fetch();
|
|
||||||
|
|
||||||
// Check if we are in reset mode (token in URL)
|
// Check if we are in reset mode (token in URL)
|
||||||
$token = $_GET['token'] ?? '';
|
$token = $_GET['token'] ?? '';
|
||||||
if ($token) {
|
if ($token) {
|
||||||
@ -49,7 +45,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$host = $_SERVER['HTTP_HOST'];
|
$host = $_SERVER['HTTP_HOST'];
|
||||||
$resetLink = "$protocol://$host/forgot_password.php?token=$newToken";
|
$resetLink = "$protocol://$host/forgot_password.php?token=$newToken";
|
||||||
|
|
||||||
$subject = "استعادة كلمة المرور - " . ($charity['charity_name'] ?? 'الجمعية الخيرية');
|
$subject = "استعادة كلمة المرور - " . ($charity_info['charity_name'] ?? 'النظام');
|
||||||
$html = "
|
$html = "
|
||||||
<div dir='rtl' style='font-family: Arial, sans-serif; text-align: right;'>
|
<div dir='rtl' style='font-family: Arial, sans-serif; text-align: right;'>
|
||||||
<h3>مرحباً {$user['full_name']}</h3>
|
<h3>مرحباً {$user['full_name']}</h3>
|
||||||
@ -67,7 +63,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$error = 'فشل إرسال البريد الإلكتروني. يرجى المحاولة لاحقاً أو التواصل مع الإدارة.';
|
$error = 'فشل إرسال البريد الإلكتروني. يرجى المحاولة لاحقاً أو التواصل مع الإدارة.';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// For security, don't reveal if email exists, but here we can be more helpful if it's a closed admin panel
|
|
||||||
$error = 'البريد الإلكتروني غير مسجل لدينا.';
|
$error = 'البريد الإلكتروني غير مسجل لدينا.';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -96,11 +91,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="card p-4 shadow-sm border-0 text-center">
|
<div class="card p-4 shadow-sm border-0 text-center">
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<?php if ($charity['charity_logo']): ?>
|
<?php if (!empty($charity_info['charity_logo'])): ?>
|
||||||
<img src="<?= htmlspecialchars($charity['charity_logo']) ?>" alt="Logo" class="mb-3" style="max-height: 80px;">
|
<img src="<?= htmlspecialchars($charity_info['charity_logo']) ?>" alt="Logo" class="mb-3" style="max-height: 80px;">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<h4 class="fw-bold">استعادة كلمة المرور</h4>
|
<h4 class="fw-bold">استعادة كلمة المرور</h4>
|
||||||
<p class="text-muted small">بريد <?= htmlspecialchars($charity['charity_name'] ?? 'الجمعية الخيرية') ?></p>
|
<p class="text-muted small">بريد <?= htmlspecialchars($charity_info['charity_name'] ?? 'النظام') ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($error): ?>
|
<?php if ($error): ?>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
</main>
|
<?php if (isLoggedIn()): ?>
|
||||||
</div>
|
</div><!-- Close main-content -->
|
||||||
</div>
|
<?php endif; ?>
|
||||||
|
|
||||||
<footer class="footer mt-auto py-3 bg-white border-top">
|
<footer class="footer mt-auto py-3 bg-white border-top">
|
||||||
<div class="container-fluid px-md-4 text-center">
|
<div class="container-fluid px-md-4 text-center">
|
||||||
<span class="text-muted small">
|
<span class="text-muted small">
|
||||||
© <?= date('Y') ?> <?= htmlspecialchars($charity_name) ?>. جميع الحقوق محفوظة.
|
© <?= date('Y') ?> <?= htmlspecialchars($charity_info['charity_name'] ?? 'نظام إدارة البريد') ?>. جميع الحقوق محفوظة.
|
||||||
</span>
|
</span>
|
||||||
<?php if (isAdmin()): ?>
|
<?php if (isAdmin()): ?>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
@ -27,8 +27,29 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="assets/js/main.js?v=<?= time() ?>"></script>
|
||||||
<script>
|
<script>
|
||||||
// Global JS functions if needed
|
// Sidebar Toggle for Mobile
|
||||||
|
document.getElementById('sidebarToggle')?.addEventListener('click', function() {
|
||||||
|
document.getElementById('sidebar').classList.toggle('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Theme Switcher
|
||||||
|
const checkbox = document.getElementById('checkbox');
|
||||||
|
if (checkbox) {
|
||||||
|
checkbox.addEventListener('change', () => {
|
||||||
|
const theme = checkbox.checked ? 'dark' : 'light';
|
||||||
|
document.documentElement.setAttribute('data-bs-theme', theme);
|
||||||
|
|
||||||
|
// Save preference to database
|
||||||
|
fetch('api/update_theme.php', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ theme: theme })
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -1,30 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
ob_start();
|
|
||||||
session_start();
|
session_start();
|
||||||
require_once __DIR__ . '/../db/config.php';
|
require_once __DIR__ . '/../db/config.php';
|
||||||
|
|
||||||
|
// Auth helpers
|
||||||
function isLoggedIn() {
|
function isLoggedIn() {
|
||||||
return isset($_SESSION['user_id']);
|
return isset($_SESSION['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isAdmin() {
|
function isAdmin() {
|
||||||
return isset($_SESSION['user_role']) && $_SESSION['user_role'] === 'admin';
|
return isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
|
||||||
}
|
|
||||||
|
|
||||||
function canView() {
|
|
||||||
return isAdmin() || (isset($_SESSION['can_view']) && $_SESSION['can_view'] == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function canAdd() {
|
|
||||||
return isAdmin() || (isset($_SESSION['can_add']) && $_SESSION['can_add'] == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function canEdit() {
|
|
||||||
return isAdmin() || (isset($_SESSION['can_edit']) && $_SESSION['can_edit'] == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function canDelete() {
|
|
||||||
return isAdmin() || (isset($_SESSION['can_delete']) && $_SESSION['can_delete'] == 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirect($path) {
|
function redirect($path) {
|
||||||
@ -32,292 +16,200 @@ function redirect($path) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allowed pages when not logged in
|
// Permission helpers
|
||||||
$allowed_pages = ['login.php', 'forgot_password.php'];
|
function canView() {
|
||||||
if (!isLoggedIn() && !in_array(basename($_SERVER['PHP_SELF']), $allowed_pages)) {
|
if (isAdmin()) return true;
|
||||||
|
return $_SESSION['can_view'] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canAdd() {
|
||||||
|
if (isAdmin()) return true;
|
||||||
|
return $_SESSION['can_add'] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canEdit() {
|
||||||
|
if (isAdmin()) return true;
|
||||||
|
return $_SESSION['can_edit'] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canDelete() {
|
||||||
|
if (isAdmin()) return true;
|
||||||
|
return $_SESSION['can_delete'] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isLoggedIn() && basename($_SERVER['PHP_SELF']) !== 'login.php' && basename($_SERVER['PHP_SELF']) !== 'forgot_password.php') {
|
||||||
redirect('login.php');
|
redirect('login.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch charity settings
|
// Fetch user info (theme and permissions)
|
||||||
$stmt = db()->query("SELECT * FROM charity_settings WHERE id = 1");
|
$user_theme = 'light';
|
||||||
$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;
|
$current_user = null;
|
||||||
if (isLoggedIn()) {
|
if (isLoggedIn()) {
|
||||||
$stmt = db()->prepare("SELECT full_name, profile_image, theme, can_view, can_add, can_edit, can_delete FROM users WHERE id = ?");
|
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||||
$stmt->execute([$_SESSION['user_id']]);
|
$stmt->execute([$_SESSION['user_id']]);
|
||||||
$current_user = $stmt->fetch();
|
$current_user = $stmt->fetch();
|
||||||
|
|
||||||
// Update session permissions
|
if ($current_user) {
|
||||||
$_SESSION['can_view'] = $current_user['can_view'] ?? 1;
|
$user_theme = $current_user['theme'] ?: 'light';
|
||||||
$_SESSION['can_add'] = $current_user['can_add'] ?? 0;
|
$_SESSION['can_view'] = (bool)$current_user['can_view'];
|
||||||
$_SESSION['can_edit'] = $current_user['can_edit'] ?? 0;
|
$_SESSION['can_add'] = (bool)$current_user['can_add'];
|
||||||
$_SESSION['can_delete'] = $current_user['can_delete'] ?? 0;
|
$_SESSION['can_edit'] = (bool)$current_user['can_edit'];
|
||||||
|
$_SESSION['can_delete'] = (bool)$current_user['can_delete'];
|
||||||
|
$_SESSION['name'] = $current_user['full_name'] ?: $current_user['username'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$user_theme = $current_user['theme'] ?? 'light';
|
|
||||||
|
// Fetch charity info for header/favicon
|
||||||
|
$charity_stmt = db()->query("SELECT * FROM charity_settings WHERE id = 1");
|
||||||
|
$charity_info = $charity_stmt->fetch();
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ar" dir="rtl" data-theme="<?= htmlspecialchars($user_theme) ?>">
|
<html lang="ar" dir="rtl" data-bs-theme="<?= $user_theme ?>">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title><?= htmlspecialchars($charity_name) ?></title>
|
<title><?= htmlspecialchars($charity_info['charity_name'] ?? 'نظام إدارة البريد') ?></title>
|
||||||
<?php if ($charity_favicon): ?>
|
|
||||||
<link rel="icon" type="image/x-icon" href="<?= $charity_favicon ?>?v=<?= time() ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
<!-- Bootstrap 5 RTL CSS -->
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css?v=<?php echo time(); ?>">
|
|
||||||
<!-- Google Fonts: Cairo -->
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet">
|
|
||||||
<!-- Font Awesome -->
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css?v=<?php echo time(); ?>">
|
|
||||||
|
|
||||||
<!-- JS Libraries (Loaded in head to support inline onclick handlers) -->
|
<!-- Bootstrap 5 RTL -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js?v=<?php echo time(); ?>"></script>
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.rtl.min.css">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
<!-- Font Awesome -->
|
||||||
<script src="https://cdn.ckeditor.com/ckeditor5/36.0.1/classic/ckeditor.js?v=<?php echo time(); ?>"></script>
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
|
||||||
|
<!-- Google Fonts - Cairo -->
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
<!-- Custom CSS -->
|
||||||
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time() ?>">
|
||||||
|
|
||||||
|
<?php if ($charity_info['charity_favicon']): ?>
|
||||||
|
<link rel="icon" type="image/x-icon" href="<?= $charity_info['charity_favicon'] ?>">
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
|
||||||
/* Light Theme (Default) */
|
|
||||||
--bg-color: #f8f9fa;
|
|
||||||
--text-color: #212529;
|
|
||||||
--sidebar-bg: #ffffff;
|
|
||||||
--card-bg: #ffffff;
|
|
||||||
--nav-link-color: #333333;
|
|
||||||
--nav-link-hover-bg: #f0f7ff;
|
|
||||||
--primary-color: #0d6efd;
|
|
||||||
--border-color: rgba(0, 0, 0, 0.075);
|
|
||||||
--muted-text: #6c757d;
|
|
||||||
--input-bg: #ffffff;
|
|
||||||
--input-border: #dee2e6;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme="dark"] {
|
|
||||||
--bg-color: #121212;
|
|
||||||
--text-color: #e0e0e0;
|
|
||||||
--sidebar-bg: #1e1e1e;
|
|
||||||
--card-bg: #1e1e1e;
|
|
||||||
--nav-link-color: #bbbbbb;
|
|
||||||
--nav-link-hover-bg: #2c2c2c;
|
|
||||||
--primary-color: #3788ff;
|
|
||||||
--border-color: rgba(255, 255, 255, 0.1);
|
|
||||||
--muted-text: #999999;
|
|
||||||
--input-bg: #2d2d2d;
|
|
||||||
--input-border: #444444;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme="midnight"] {
|
|
||||||
--bg-color: #0b0e14;
|
|
||||||
--text-color: #cbd5e0;
|
|
||||||
--sidebar-bg: #1a202c;
|
|
||||||
--card-bg: #1a202c;
|
|
||||||
--nav-link-color: #a0aec0;
|
|
||||||
--nav-link-hover-bg: #2d3748;
|
|
||||||
--primary-color: #63b3ed;
|
|
||||||
--border-color: rgba(255, 255, 255, 0.05);
|
|
||||||
--muted-text: #718096;
|
|
||||||
--input-bg: #2d3748;
|
|
||||||
--input-border: #4a5568;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme="forest"] {
|
|
||||||
--bg-color: #f0f4f0;
|
|
||||||
--text-color: #2d372d;
|
|
||||||
--sidebar-bg: #ffffff;
|
|
||||||
--card-bg: #ffffff;
|
|
||||||
--nav-link-color: #4a5d4a;
|
|
||||||
--nav-link-hover-bg: #e8f0e8;
|
|
||||||
--primary-color: #2d6a4f;
|
|
||||||
--border-color: rgba(0, 0, 0, 0.05);
|
|
||||||
--muted-text: #6b8e6b;
|
|
||||||
--input-bg: #ffffff;
|
|
||||||
--input-border: #ccd5cc;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: 'Cairo', sans-serif;
|
font-family: 'Cairo', sans-serif;
|
||||||
background-color: var(--bg-color);
|
background-color: var(--bs-body-bg);
|
||||||
color: var(--text-color);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 100vh;
|
|
||||||
transition: background-color 0.3s ease, color 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Bootstrap Overrides */
|
|
||||||
.bg-white { background-color: var(--card-bg) !important; }
|
|
||||||
.bg-light { background-color: var(--bg-color) !important; }
|
|
||||||
.text-dark { color: var(--text-color) !important; }
|
|
||||||
.text-muted { color: var(--muted-text) !important; }
|
|
||||||
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
|
|
||||||
.border-top { border-top: 1px solid var(--border-color) !important; }
|
|
||||||
.border { border: 1px solid var(--border-color) !important; }
|
|
||||||
.list-group-item { background-color: var(--card-bg); border-color: var(--border-color); color: var(--text-color); }
|
|
||||||
.form-control, .form-select { background-color: var(--input-bg); border-color: var(--input-border); color: var(--text-color); }
|
|
||||||
.form-control:focus, .form-select:focus { background-color: var(--input-bg); color: var(--text-color); border-color: var(--primary-color); }
|
|
||||||
.table { color: var(--text-color); border-color: var(--border-color); }
|
|
||||||
.table thead th { background-color: var(--bg-color); color: var(--text-color); }
|
|
||||||
.table-hover tbody tr:hover { background-color: var(--nav-link-hover-bg); }
|
|
||||||
|
|
||||||
.container-fluid.main-container {
|
|
||||||
flex: 1;
|
|
||||||
}
|
}
|
||||||
.sidebar {
|
.sidebar {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: var(--sidebar-bg);
|
background-color: #212529;
|
||||||
box-shadow: 0 0.125rem 0.25rem var(--border-color);
|
color: #fff;
|
||||||
padding-top: 1rem;
|
width: 250px;
|
||||||
transition: background-color 0.3s ease;
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
transition: all 0.3s;
|
||||||
}
|
}
|
||||||
.nav-link {
|
.sidebar .nav-link {
|
||||||
color: var(--nav-link-color);
|
color: rgba(255,255,255,0.7);
|
||||||
font-weight: 600;
|
padding: 12px 20px;
|
||||||
padding: 0.8rem 1.5rem;
|
border-radius: 0;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
.nav-link:hover, .nav-link.active {
|
.sidebar .nav-link:hover, .sidebar .nav-link.active {
|
||||||
background-color: var(--nav-link-hover-bg);
|
color: #fff;
|
||||||
color: var(--primary-color);
|
background-color: rgba(255,255,255,0.1);
|
||||||
border-left: 4px solid var(--primary-color);
|
|
||||||
}
|
}
|
||||||
.card {
|
.sidebar .nav-link.active {
|
||||||
border: none;
|
border-right: 4px solid #0d6efd;
|
||||||
box-shadow: 0 0.125rem 0.25rem var(--border-color);
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: var(--card-bg);
|
|
||||||
color: var(--text-color);
|
|
||||||
transition: background-color 0.3s ease;
|
|
||||||
}
|
}
|
||||||
.btn-primary {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.btn-primary:hover {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
filter: brightness(90%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-received { background-color: #e9ecef; color: #495057; }
|
|
||||||
.status-in_progress { background-color: #cff4fc; color: #055160; }
|
|
||||||
.status-closed { background-color: #d1e7dd; color: #0f5132; }
|
|
||||||
|
|
||||||
.modal-content {
|
|
||||||
background-color: var(--card-bg);
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
.modal-header.bg-primary {
|
|
||||||
background-color: var(--primary-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-profile-img {
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
border-radius: 50%;
|
|
||||||
object-fit: cover;
|
|
||||||
border: 2px solid var(--primary-color);
|
|
||||||
}
|
|
||||||
.charity-logo {
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 60px;
|
|
||||||
}
|
|
||||||
.navbar {
|
|
||||||
background-color: var(--sidebar-bg) !important;
|
|
||||||
border-color: var(--border-color) !important;
|
|
||||||
}
|
|
||||||
.navbar-brand {
|
|
||||||
color: var(--text-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-heading {
|
.sidebar-heading {
|
||||||
padding: 0.5rem 1.5rem;
|
padding: 20px 20px 10px;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.05rem;
|
letter-spacing: 0.1rem;
|
||||||
font-weight: 700;
|
color: rgba(255,255,255,0.4);
|
||||||
color: var(--muted-text);
|
}
|
||||||
margin-top: 1rem;
|
.main-content {
|
||||||
|
margin-right: 250px;
|
||||||
|
padding: 20px;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
.top-navbar {
|
||||||
|
margin-right: 250px;
|
||||||
|
background-color: var(--bs-tertiary-bg);
|
||||||
|
border-bottom: 1px solid var(--bs-border-color);
|
||||||
|
}
|
||||||
|
@media (max-width: 991.98px) {
|
||||||
|
.sidebar {
|
||||||
|
right: -250px;
|
||||||
|
}
|
||||||
|
.sidebar.show {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
.main-content, .top-navbar {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* RTL Fixes for Bootstrap */
|
||||||
|
.ms-auto { margin-right: auto !important; margin-left: 0 !important; }
|
||||||
|
.me-auto { margin-left: auto !important; margin-right: 0 !important; }
|
||||||
|
|
||||||
/* Theme Switcher Styles */
|
/* Theme Switcher Styles */
|
||||||
.theme-switcher {
|
.theme-switch-wrapper {
|
||||||
padding: 1rem 1.5rem;
|
|
||||||
border-top: 1px solid var(--border-color);
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
.theme-options {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
}
|
||||||
.theme-btn {
|
.theme-switch {
|
||||||
width: 24px;
|
display: inline-block;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
border-radius: 50%;
|
position: relative;
|
||||||
border: 2px solid transparent;
|
width: 50px;
|
||||||
|
}
|
||||||
|
.theme-switch input {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.slider {
|
||||||
|
background-color: #ccc;
|
||||||
|
bottom: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s;
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
transition: .4s;
|
||||||
|
border-radius: 34px;
|
||||||
}
|
}
|
||||||
.theme-btn:hover {
|
.slider:before {
|
||||||
transform: scale(1.2);
|
background-color: #fff;
|
||||||
|
bottom: 4px;
|
||||||
|
content: "";
|
||||||
|
height: 16px;
|
||||||
|
left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
transition: .4s;
|
||||||
|
width: 16px;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.theme-btn.active {
|
input:checked + .slider {
|
||||||
border-color: var(--primary-color);
|
background-color: #0d6efd;
|
||||||
|
}
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(26px);
|
||||||
}
|
}
|
||||||
.theme-btn-light { background-color: #f8f9fa; border: 1px solid #ddd; }
|
|
||||||
.theme-btn-dark { background-color: #121212; }
|
|
||||||
.theme-btn-midnight { background-color: #0b0e14; }
|
|
||||||
.theme-btn-forest { background-color: #2d6a4f; }
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="container-fluid main-container">
|
<?php if (isLoggedIn()): ?>
|
||||||
<div class="row">
|
|
||||||
<?php if (isLoggedIn()): ?>
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<nav class="col-md-3 col-lg-2 d-md-block sidebar">
|
<div class="sidebar d-flex flex-column" id="sidebar">
|
||||||
<div class="position-sticky">
|
<div class="p-3 text-center border-bottom border-secondary">
|
||||||
<div class="text-center mb-4">
|
<?php if ($charity_info['charity_logo']): ?>
|
||||||
<a href="index.php" class="text-decoration-none text-dark">
|
<img src="<?= $charity_info['charity_logo'] ?>" alt="Logo" class="img-fluid mb-2" style="max-height: 50px;">
|
||||||
<?php if ($charity_logo): ?>
|
|
||||||
<img src="<?= $charity_logo ?>?v=<?= time() ?>" alt="Logo" class="charity-logo mb-2">
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<h5 class="fw-bold mt-2"><?= htmlspecialchars($charity_name) ?></h5>
|
<h5 class="mb-0 fw-bold"><?= htmlspecialchars($charity_info['charity_name'] ?? 'إدارة البريد') ?></h5>
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="user-info text-center mb-4 py-3 border-bottom border-top">
|
<ul class="nav flex-column mt-3">
|
||||||
<?php if ($current_user['profile_image']): ?>
|
|
||||||
<img src="<?= $current_user['profile_image'] ?>?v=<?= time() ?>" alt="Profile" class="user-profile-img mb-2">
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="user-profile-img bg-light mx-auto d-flex align-items-center justify-content-center mb-2">
|
|
||||||
<i class="fas fa-user text-secondary fa-2x"></i>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<div class="small fw-bold"><?= htmlspecialchars($current_user['full_name'] ?? $_SESSION['username']) ?></div>
|
|
||||||
<div class="small text-muted">
|
|
||||||
<?php
|
|
||||||
if ($_SESSION['user_role'] === 'admin') echo 'مدير النظام';
|
|
||||||
elseif ($_SESSION['user_role'] === 'clerk') echo 'كاتب';
|
|
||||||
else echo 'موظف';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="nav flex-column">
|
|
||||||
<li class="nav-item">
|
<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-home me-2"></i> لوحة التحكم
|
<i class="fas fa-tachometer-alt me-2"></i> لوحة التحكم
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<div class="sidebar-heading">المراسلات الرسمية</div>
|
<div class="sidebar-heading">البريد الخارجي</div>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'inbound.php' ? 'active' : '' ?>" href="inbound.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'inbound.php' ? 'active' : '' ?>" href="inbound.php">
|
||||||
<i class="fas fa-download me-2"></i> البريد الوارد
|
<i class="fas fa-download me-2"></i> البريد الوارد
|
||||||
@ -329,25 +221,27 @@ $user_theme = $current_user['theme'] ?? 'light';
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<div class="sidebar-heading">بريد الموظفين</div>
|
<div class="sidebar-heading">البريد الداخلي</div>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'internal_inbox.php' ? 'active' : '' ?>" href="internal_inbox.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'internal_inbox.php' ? 'active' : '' ?>" href="internal_inbox.php">
|
||||||
<i class="fas fa-inbox me-2"></i> صندوق الوارد
|
<i class="fas fa-inbox me-2"></i> الوارد الداخلي
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'internal_outbox.php' ? 'active' : '' ?>" href="internal_outbox.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'internal_outbox.php' ? 'active' : '' ?>" href="internal_outbox.php">
|
||||||
<i class="fas fa-paper-plane me-2"></i> صندوق الصادر
|
<i class="fas fa-paper-plane me-2"></i> الصادر الداخلي
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php if (isAdmin()): ?>
|
<?php if (isAdmin()): ?>
|
||||||
<div class="sidebar-heading">الإدارة والنظام</div>
|
<div class="sidebar-heading">التقارير</div>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'overdue_report.php' ? 'active' : '' ?>" href="overdue_report.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'overdue_report.php' ? 'active' : '' ?>" href="overdue_report.php">
|
||||||
<i class="fas fa-chart-line me-2"></i> تقرير التأخير
|
<i class="fas fa-clock me-2"></i> بريد متأخر
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<div class="sidebar-heading">الإدارة</div>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'users.php' ? 'active' : '' ?>" href="users.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'users.php' ? 'active' : '' ?>" href="users.php">
|
||||||
<i class="fas fa-users me-2"></i> إدارة المستخدمين
|
<i class="fas fa-users me-2"></i> إدارة المستخدمين
|
||||||
@ -355,7 +249,7 @@ $user_theme = $current_user['theme'] ?? 'light';
|
|||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'charity-settings.php' ? 'active' : '' ?>" href="charity-settings.php">
|
<a class="nav-link <?= basename($_SERVER['PHP_SELF']) == 'charity-settings.php' ? 'active' : '' ?>" href="charity-settings.php">
|
||||||
<i class="fas fa-cog me-2"></i> إعدادات الجمعية
|
<i class="fas fa-cog me-2"></i> إعدادات النظام
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -368,50 +262,48 @@ $user_theme = $current_user['theme'] ?? 'light';
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Theme Switcher -->
|
<!-- Theme Switcher -->
|
||||||
<li class="theme-switcher">
|
<li class="nav-item mt-4 px-3">
|
||||||
<div class="small fw-bold mb-2 text-center">المظهر</div>
|
<div class="d-flex align-items-center justify-content-between text-secondary small">
|
||||||
<div class="theme-options">
|
<span>الوضع الليلي</span>
|
||||||
<div class="theme-btn theme-btn-light <?= $user_theme == 'light' ? 'active' : '' ?>" onclick="setTheme('light')" title="فاتح"></div>
|
<label class="theme-switch" for="checkbox">
|
||||||
<div class="theme-btn theme-btn-dark <?= $user_theme == 'dark' ? 'active' : '' ?>" onclick="setTheme('dark')" title="داكن"></div>
|
<input type="checkbox" id="checkbox" <?= $user_theme === 'dark' ? 'checked' : '' ?> />
|
||||||
<div class="theme-btn theme-btn-midnight <?= $user_theme == 'midnight' ? 'active' : '' ?>" onclick="setTheme('midnight')" title="منتصف الليل"></div>
|
<div class="slider"></div>
|
||||||
<div class="theme-btn theme-btn-forest <?= $user_theme == 'forest' ? 'active' : '' ?>" onclick="setTheme('forest')" title="غابة"></div>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item mt-2">
|
<li class="nav-item mt-auto border-top border-secondary">
|
||||||
<a class="nav-link text-danger" href="logout.php">
|
<a class="nav-link text-danger" href="logout.php">
|
||||||
<i class="fas fa-sign-out-alt me-2"></i> تسجيل الخروج
|
<i class="fas fa-sign-out-alt me-2"></i> تسجيل الخروج
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
|
||||||
|
|
||||||
<script>
|
<!-- Top Navbar -->
|
||||||
function setTheme(theme) {
|
<nav class="navbar navbar-expand navbar-light top-navbar sticky-top">
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
|
||||||
document.querySelectorAll('.theme-btn').forEach(btn => btn.classList.remove('active'));
|
|
||||||
document.querySelector('.theme-btn-' + theme).classList.add('active');
|
|
||||||
|
|
||||||
fetch('api/update_theme.php', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify({ theme: theme })
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (!data.success) console.error('Failed to update theme preference');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-md navbar-light bg-white d-md-none border-bottom mb-3">
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<span class="navbar-brand">القائمة</span>
|
<button class="btn btn-outline-secondary d-lg-none me-2" id="sidebarToggle">
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
|
<i class="fas fa-bars"></i>
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<div class="ms-auto d-flex align-items-center">
|
||||||
|
<div class="dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" role="button" data-bs-toggle="dropdown">
|
||||||
|
<div class="bg-primary text-white rounded-circle d-flex align-items-center justify-content-center me-2" style="width: 32px; height: 32px; font-size: 0.8rem;">
|
||||||
|
<?= mb_substr($_SESSION['name'] ?? 'U', 0, 1) ?>
|
||||||
|
</div>
|
||||||
|
<span class="d-none d-md-inline"><?= htmlspecialchars($_SESSION['name'] ?? 'المستخدم') ?></span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
|
<li><a class="dropdown-item" href="profile.php"><i class="fas fa-user me-2"></i> الملف الشخصي</a></li>
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li><a class="dropdown-item text-danger" href="logout.php"><i class="fas fa-sign-out-alt me-2"></i> خروج</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<main class="<?= isLoggedIn() ? 'col-md-9 ms-sm-auto col-lg-10' : 'col-12' ?> px-md-4 py-4">
|
|
||||||
|
<div class="main-content">
|
||||||
|
<?php endif; ?>
|
||||||
10
login.php
10
login.php
@ -37,10 +37,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
<div class="card shadow-sm border-0">
|
<div class="card shadow-sm border-0">
|
||||||
<div class="card-body p-4">
|
<div class="card-body p-4">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<?php if (!empty($charity['charity_logo'])): ?>
|
<?php if (!empty($charity_info['charity_logo'])): ?>
|
||||||
<img src="<?php echo htmlspecialchars($charity['charity_logo']); ?>" alt="Logo" class="img-fluid mb-3" style="max-height: 80px;">
|
<img src="<?php echo htmlspecialchars($charity_info['charity_logo']); ?>" alt="Logo" class="img-fluid mb-3" style="max-height: 80px;">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<h4 class="fw-bold mb-0"><?php echo htmlspecialchars($charity['charity_name'] ?? 'تسجيل الدخول'); ?></h4>
|
<h4 class="fw-bold mb-0"><?php echo htmlspecialchars($charity_info['charity_name'] ?? 'تسجيل الدخول'); ?></h4>
|
||||||
<p class="text-muted small">يرجى إدخال بيانات الاعتماد الخاصة بك</p>
|
<p class="text-muted small">يرجى إدخال بيانات الاعتماد الخاصة بك</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -70,10 +70,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center mt-3 text-muted small">
|
|
||||||
© <?php echo date('Y'); ?> <?php echo htmlspecialchars($charity['charity_name'] ?? ''); ?>. جميع الحقوق محفوظة.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user