From 9f7d3b9c16f21302f9deaf028c19b0ca338f29d8 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 13 Apr 2026 14:24:18 +0000 Subject: [PATCH] add calander --- accounting.php | 26 +- accounting.php.bak | 196 -------- accounting_temp.php | 2 - accounts.php | 6 +- admin_dashboard.php | 333 +++++++++++++ charity-settings.php | 19 +- charity_members.php | 63 ++- charity_plans.php | 12 +- check_data.php | 0 check_db.php | 0 check_users.php | 0 committee_reports.php | 2 +- committees.php | 8 +- db/config.php | 8 + .../036_add_site_version_to_settings.sql | 1 + db/migrations/037_add_events_module.sql | 13 + desc_db.php | 0 events.php | 314 ++++++++++++ expense_categories.php | 12 +- expense_reports.php | 12 +- expenses.php | 20 +- expenses_dashboard.php | 6 +- fix_audit.php | 1 + fix_nulls.php | 18 + forgot_password.php | 4 +- hr_attendance.php | 8 +- hr_dashboard.php | 2 +- hr_employees.php | 26 +- hr_holidays.php | 10 +- hr_leaves.php | 16 +- hr_payroll.php | 10 +- hr_reports.php | 4 +- hr_zkteco.php | 8 +- inbound.php | 10 +- includes/footer.php | 10 +- includes/header.php | 37 +- includes/permissions.php | 9 +- includes/settings.php | 1 + index.php | 471 ++++++------------ install.php | 16 +- internal_inbox.php | 14 +- internal_outbox.php | 20 +- login.php | 4 +- meetings.php | 14 +- my_leaves.php | 6 +- outbound.php | 10 +- overdue_report.php | 10 +- print_charity_report.php | 12 +- print_committees_report.php | 14 +- print_events.php | 202 ++++++++ print_inbound.php | 16 +- print_meeting.php | 10 +- print_outbound.php | 16 +- stock_dashboard.php | 4 +- stock_in.php | 8 +- stock_items.php | 8 +- stock_lending.php | 12 +- stock_out.php | 8 +- stock_reports.php | 10 +- stock_settings.php | 4 +- test_db.php | 0 test_insert.php | 1 + test_trigger2.php | 0 test_trigger3.php | 0 trial_balance.php | 2 +- user_dashboard.php | 6 +- users.php | 11 +- view_committee.php | 18 +- view_mail.php | 34 +- 69 files changed, 1392 insertions(+), 796 deletions(-) create mode 100644 admin_dashboard.php create mode 100644 check_data.php create mode 100644 check_db.php create mode 100644 check_users.php create mode 100644 db/migrations/036_add_site_version_to_settings.sql create mode 100644 db/migrations/037_add_events_module.sql create mode 100644 desc_db.php create mode 100644 events.php create mode 100644 fix_audit.php create mode 100644 fix_nulls.php create mode 100644 print_events.php create mode 100644 test_db.php create mode 100644 test_insert.php create mode 100644 test_trigger2.php create mode 100644 test_trigger3.php diff --git a/accounting.php b/accounting.php index a30ba7a..0599619 100644 --- a/accounting.php +++ b/accounting.php @@ -97,13 +97,13 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset);
- +
- +
- +
@@ -144,7 +144,7 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset);
@@ -153,7 +153,7 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset);
@@ -204,7 +204,7 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset); @@ -213,7 +213,7 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset); @@ -246,20 +246,20 @@ $ledger = get_ledger_paginated($search, $date_from, $date_to, $limit, $offset); - - - - + + + + - + - + diff --git a/accounting.php.bak b/accounting.php.bak index fbffba4..e69de29 100644 --- a/accounting.php.bak +++ b/accounting.php.bak @@ -1,196 +0,0 @@ -prepare("SELECT * FROM user_permissions WHERE user_id = ? AND page = 'accounting' AND can_view = 1"); -$stmt->execute([$user_id]); -if (!$stmt->fetch()) { - echo "
لا تملك صلاحية الوصول لهذه الصفحة.
"; - require_once 'includes/footer.php'; - exit; -} - -// Handle form submission -if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) { - $date = $_POST["date"] ?? ""; - $description = $_POST["description"] ?? ""; - $reference = $_POST["reference"] ?? ""; - $entries = [ - ["account" => $_POST["debit_account"] ?? "", "debit" => (float)($_POST["amount"] ?? 0), "credit" => 0], - ["account" => $_POST["credit_account"] ?? "", "debit" => 0, "credit" => (float)($_POST["amount"] ?? 0)] - ]; - - if (add_journal_entry($date, $description, $reference, $entries)) { - $message = "تم إضافة القيد بنجاح."; - } else { - $error = "حدث خطأ أثناء إضافة القيد."; - } -} - -// Pagination and Filtering setup -$page = isset($_GET['p']) ? (int)$_GET['p'] : 1; -$limit = 10; -$offset = ($page - 1) * $limit; -$search = $_GET['search'] ?? ''; -$date_from = $_GET['date_from'] ?? ''; -$date_to = $_GET['date_to'] ?? ''; - -// Fetch ledger data with filters -$ledger_all = get_full_ledger_filtered($search, $date_from, $date_to); -$total_items = count($ledger_all); -$total_pages = ceil($total_items / $limit); -$ledger = array_slice($ledger_all, $offset, $limit); -?> - - - - - - -
-
-

المحاسبة (Accounting)

- -
- - $message
"; ?> - $error"; ?> - - -
-
- -
- -
-
- -
-
- -
-
- - -
- -
-
- - - - -
-
-

دفتر الأستاذ (General Ledger)

-
- - - - - - - - - - - - - - - -
التاريخالوصفالمرجعالحسابمديندائنالإجراءات
- - -
-
- - -
-
- - - - - - - \ No newline at end of file diff --git a/accounting_temp.php b/accounting_temp.php index 002defd..e69de29 100644 --- a/accounting_temp.php +++ b/accounting_temp.php @@ -1,2 +0,0 @@ - - diff --git a/accounts.php b/accounts.php index ff8b20d..681d91c 100644 --- a/accounts.php +++ b/accounts.php @@ -137,13 +137,13 @@ $typeMap = [ - + - +
-
+
+
+
+
+
+ + + + + +
+
+
+
+
+
- +
@@ -96,26 +121,26 @@ $members = $stmt->fetchAll(); - - - - + + + + - + - + - + diff --git a/committees.php b/committees.php index 05657f7..8e148db 100644 --- a/committees.php +++ b/committees.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/includes/header.php'; if (!canView('committees')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $error = ''; @@ -108,10 +108,10 @@ if (isset($_SESSION['error'])) { 0): ?> - - + + - + - + - - + + - - + + - + diff --git a/expenses.php b/expenses.php index f88caef..141c7f7 100644 --- a/expenses.php +++ b/expenses.php @@ -4,7 +4,7 @@ require_once __DIR__ . '/includes/accounting_functions.php'; // Include accounti require_once __DIR__ . '/includes/pagination.php'; if (!canView('expenses')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $error = ''; @@ -254,14 +254,14 @@ if (isset($_SESSION['success'])) {
- +
@@ -297,21 +297,21 @@ if (isset($_SESSION['success'])) { - + - - + + - + - + diff --git a/fix_audit.php b/fix_audit.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/fix_audit.php @@ -0,0 +1 @@ + diff --git a/fix_nulls.php b/fix_nulls.php new file mode 100644 index 0000000..46e38aa --- /dev/null +++ b/fix_nulls.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/forgot_password.php b/forgot_password.php index a0cd583..cd41048 100644 --- a/forgot_password.php +++ b/forgot_password.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/includes/header.php'; require_once __DIR__ . '/m_services/MailService.php'; if (isLoggedIn()) { - redirect('index.php'); + redirect('user_dashboard.php'); } $error = ''; @@ -92,7 +92,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- Logo + Logo

استعادة كلمة المرور

بريد

diff --git a/hr_attendance.php b/hr_attendance.php index 0fbbe05..23849c3 100644 --- a/hr_attendance.php +++ b/hr_attendance.php @@ -81,10 +81,10 @@ $records = $stmt->fetchAll();
-
+
-
+
@@ -113,7 +113,7 @@ $records = $stmt->fetchAll();
- + - + - + diff --git a/hr_employees.php b/hr_employees.php index 35ac605..3c686bb 100644 --- a/hr_employees.php +++ b/hr_employees.php @@ -112,10 +112,10 @@ $pagination = getPagination($page, $totalEmployees, $perPage); -
+
-
+
@@ -134,7 +134,7 @@ $pagination = getPagination($page, $totalEmployees, $perPage);
  • - +
    @@ -204,7 +204,7 @@ $pagination = getPagination($page, $totalEmployees, $perPage); @@ -285,12 +285,12 @@ $pagination = getPagination($page, $totalEmployees, $perPage);
    -
    +
- + - + - + - + - + - + @@ -231,7 +231,7 @@ $total_salaries = $sumStmt->fetchColumn() ?: 0; - + - + - + diff --git a/hr_zkteco.php b/hr_zkteco.php index 4b9480b..5d7d35d 100644 --- a/hr_zkteco.php +++ b/hr_zkteco.php @@ -149,14 +149,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { @@ -193,11 +193,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- +
- +
diff --git a/inbound.php b/inbound.php index 8990d4f..8ae7a8b 100644 --- a/inbound.php +++ b/inbound.php @@ -253,20 +253,20 @@ if (isset($_GET['id'])) {
- + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/print_charity_report.php b/print_charity_report.php index 135d5a9..30bcfb4 100644 --- a/print_charity_report.php +++ b/print_charity_report.php @@ -94,13 +94,13 @@ $status_labels = [ @@ -154,9 +154,9 @@ $status_labels = [ - + @@ -207,7 +207,7 @@ $status_labels = [
- هذا التقرير معتمد ومستخرج آلياً من نظام إدارة الجمعية - + هذا التقرير معتمد ومستخرج آلياً من نظام إدارة الجمعية -
diff --git a/print_committees_report.php b/print_committees_report.php index 6e2c794..4f10349 100644 --- a/print_committees_report.php +++ b/print_committees_report.php @@ -103,13 +103,13 @@ usort($committees, function($a, $b) { @@ -123,7 +123,7 @@ usort($committees, function($a, $b) {
- . + .
مؤشر الأداء (KPI): % @@ -131,7 +131,7 @@ usort($committees, function($a, $b) {

- +

@@ -154,8 +154,8 @@ usort($committees, function($a, $b) { $m): ?>
- - + + @@ -170,7 +170,7 @@ usort($committees, function($a, $b) {
- هذا التقرير معتمد ومستخرج آلياً من نظام إدارة اللجان - + هذا التقرير معتمد ومستخرج آلياً من نظام إدارة اللجان -
diff --git a/print_events.php b/print_events.php new file mode 100644 index 0000000..a8e309d --- /dev/null +++ b/print_events.php @@ -0,0 +1,202 @@ +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 = 'Logo'; +} +?> + + + + + طباعة الأحداث والتقويم + + + + + + + +
+
+ +
+ +

+ +

+ +
قائمة الأحداث والفعاليات
+
+ + +
+ لا توجد أحداث مسجلة حالياً +
+ +
الاسم
-
+
-
+
- نشط + نشط - غير نشط + غير نشط @@ -146,23 +171,23 @@ $members = $stmt->fetchAll();
- +
- +
- +
- +
- +
@@ -192,7 +217,7 @@ $members = $stmt->fetchAll();
-
-
+
+
من:
@@ -192,7 +192,7 @@ $status_labels = [
@@ -223,11 +223,11 @@ $status_labels = [
- +
- +
diff --git a/check_data.php b/check_data.php new file mode 100644 index 0000000..e69de29 diff --git a/check_db.php b/check_db.php new file mode 100644 index 0000000..e69de29 diff --git a/check_users.php b/check_users.php new file mode 100644 index 0000000..e69de29 diff --git a/committee_reports.php b/committee_reports.php index 119c8fb..06b5e47 100644 --- a/committee_reports.php +++ b/committee_reports.php @@ -185,7 +185,7 @@ usort($committees, function($a, $b) { #
إدارة diff --git a/db/config.php b/db/config.php index fd0c258..7639e56 100644 --- a/db/config.php +++ b/db/config.php @@ -20,6 +20,14 @@ function db() { $pdo->exec("SET @app_user_id = " . (int)$_SESSION['user_id']); } } + + // FORCE SET IT EVERY TIME db() IS CALLED just in case the connection was dropped or it wasn't set! + if (isset($_SESSION['user_id']) && $pdo) { + try { + $pdo->exec("SET @app_user_id = " . (int)$_SESSION['user_id']); + } catch (Exception $e) {} + } + return $pdo; } diff --git a/db/migrations/036_add_site_version_to_settings.sql b/db/migrations/036_add_site_version_to_settings.sql new file mode 100644 index 0000000..f424ac1 --- /dev/null +++ b/db/migrations/036_add_site_version_to_settings.sql @@ -0,0 +1 @@ +ALTER TABLE charity_settings ADD COLUMN IF NOT EXISTS site_version varchar(50) DEFAULT '1.3.0'; \ No newline at end of file diff --git a/db/migrations/037_add_events_module.sql b/db/migrations/037_add_events_module.sql new file mode 100644 index 0000000..20b841c --- /dev/null +++ b/db/migrations/037_add_events_module.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS events ( + id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + description TEXT, + event_date DATE NOT NULL, + start_time TIME DEFAULT NULL, + end_time TIME DEFAULT NULL, + location VARCHAR(255) DEFAULT NULL, + created_by INT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE SET NULL +); diff --git a/desc_db.php b/desc_db.php new file mode 100644 index 0000000..e69de29 diff --git a/events.php b/events.php new file mode 100644 index 0000000..56e62ee --- /dev/null +++ b/events.php @@ -0,0 +1,314 @@ +ليس لديك صلاحية لعرض هذه الصفحة."; + require_once 'includes/footer.php'; + exit; +} + +$can_add = canAdd('events'); +$can_edit = canEdit('events'); +$can_delete = canDelete('events'); + +// Handle AJAX requests +if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_GET['ajax'])) { + ob_clean(); header('Content-Type: application/json'); + $action = $_POST['action'] ?? ''; + + if ($action === 'fetch') { + $stmt = db()->query("SELECT id, title, description, event_date, start_time, end_time, location FROM events"); + $events = $stmt->fetchAll(); + $fc_events = []; + foreach($events as $e) { + $start = $e['event_date']; + if ($e['start_time']) $start .= 'T' . $e['start_time']; + + $end = $e['event_date']; + if ($e['end_time']) $end .= 'T' . $e['end_time']; + + $fc_events[] = [ + 'id' => $e['id'], + 'title' => $e['title'], + 'start' => $start, + 'end' => $end, + 'extendedProps' => [ + 'description' => $e['description'] ?? '', + 'location' => $e['location'] ?? '', + 'start_time' => $e['start_time'] ? substr($e['start_time'], 0, 5) : '', + 'end_time' => $e['end_time'] ? substr($e['end_time'], 0, 5) : '' + ] + ]; + } + echo json_encode($fc_events); + exit; + } + + if ($action === 'save' && ($can_add || $can_edit)) { + $id = $_POST['id'] ?? 0; + $title = $_POST['title'] ?? ''; + $date = $_POST['event_date'] ?? ''; + $start_time = !empty($_POST['start_time']) ? $_POST['start_time'] : null; + $end_time = !empty($_POST['end_time']) ? $_POST['end_time'] : null; + $location = $_POST['location'] ?? ''; + $description = $_POST['description'] ?? ''; + + if (!$title || !$date) { + echo json_encode(['success' => false, 'error' => 'البيانات الأساسية مطلوبة']); + exit; + } + + if ($id && $can_edit) { + $stmt = db()->prepare("UPDATE events SET title=?, description=?, event_date=?, start_time=?, end_time=?, location=? WHERE id=?"); + $stmt->execute([$title, $description, $date, $start_time, $end_time, $location, $id]); + } elseif (!$id && $can_add) { + $stmt = db()->prepare("INSERT INTO events (title, description, event_date, start_time, end_time, location, created_by) VALUES (?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$title, $description, $date, $start_time, $end_time, $location, $_SESSION['user_id']]); + } + + echo json_encode(['success' => true]); + exit; + } + + if ($action === 'delete' && $can_delete) { + $id = $_POST['id'] ?? 0; + db()->prepare("DELETE FROM events WHERE id=?")->execute([$id]); + echo json_encode(['success' => true]); + exit; + } +} +?> + + + + + +
+
+
+

التقويم والأحداث

+
+
+ + طباعة الأحداث + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/expense_categories.php b/expense_categories.php index a346f1d..4bde24d 100644 --- a/expense_categories.php +++ b/expense_categories.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/includes/header.php'; if (!canView('expense_settings')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $error = ''; @@ -109,16 +109,16 @@ if (isset($_SESSION['error'])) {
- + غير مرتبط @@ -164,7 +164,7 @@ if (isset($_SESSION['error'])) { diff --git a/expense_reports.php b/expense_reports.php index 9437525..d2b4d82 100644 --- a/expense_reports.php +++ b/expense_reports.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/includes/header.php'; if (!canView('expenses')) { - redirect('index.php'); + redirect('user_dashboard.php'); } // Params @@ -89,7 +89,7 @@ $categories = db()->query("SELECT * FROM expense_categories ORDER BY name")->fet @@ -134,7 +134,7 @@ $categories = db()->query("SELECT * FROM expense_categories ORDER BY name")->fet $amount): ?>
- +
@@ -173,11 +173,11 @@ $categories = db()->query("SELECT * FROM expense_categories ORDER BY name")->fet
- + -
Ref: +
Ref:
- + @@ -377,7 +377,7 @@ if (isset($_SESSION['success'])) { diff --git a/expenses_dashboard.php b/expenses_dashboard.php index 6fa2d16..0df57c3 100644 --- a/expenses_dashboard.php +++ b/expenses_dashboard.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/includes/header.php'; if (!canView('expenses')) { - redirect('index.php'); + redirect('user_dashboard.php'); } // Helper to get totals @@ -153,13 +153,13 @@ $recent_expenses = $stmt->fetchAll(PDO::FETCH_ASSOC);
fetchAll(); diff --git a/hr_dashboard.php b/hr_dashboard.php index ac9ef42..917393c 100644 --- a/hr_dashboard.php +++ b/hr_dashboard.php @@ -101,7 +101,7 @@ $recent_employees = db()->query("SELECT * FROM hr_employees ORDER BY join_date D
'secondary' }; ?> - +
@@ -314,14 +314,14 @@ $pagination = getPagination($page, $totalEmployees, $perPage); data-bs-toggle="modal" data-bs-target="#employeeModal" data-id="" - data-fname="" - data-lname="" - data-email="" - data-phone="" + data-fname="" + data-lname="" + data-email="" + data-phone="" data-gender="" data-bdate="" data-dept="" - data-job="" + data-job="" data-join="" data-salary="" data-status="" data-user="" diff --git a/hr_holidays.php b/hr_holidays.php index ed1adef..05ec93d 100644 --- a/hr_holidays.php +++ b/hr_holidays.php @@ -59,10 +59,10 @@ $holidays = db()->query("SELECT * FROM hr_holidays ORDER BY date_from DESC")->fe
-
+
-
+
@@ -98,11 +98,11 @@ $holidays = db()->query("SELECT * FROM hr_holidays ORDER BY date_from DESC")->fe } ?>
@@ -110,7 +110,7 @@ $holidays = db()->query("SELECT * FROM hr_holidays ORDER BY date_from DESC")->fe data-bs-toggle="modal" data-bs-target="#holidayModal" data-id="" - data-name="" + data-name="" data-from="" data-to="" onclick="editHoliday(this)"> diff --git a/hr_leaves.php b/hr_leaves.php index cc08ef9..d6568ec 100644 --- a/hr_leaves.php +++ b/hr_leaves.php @@ -134,10 +134,10 @@ $requests = $stmt->fetchAll(); -
+
-
+
يوم fetchAll(); @@ -266,7 +266,7 @@ $requests = $stmt->fetchAll(); data-type="" data-start="" data-end="" - data-reason="" + data-reason="" onclick="editLeave(this)"> diff --git a/hr_payroll.php b/hr_payroll.php index a9dacf4..c971fc5 100644 --- a/hr_payroll.php +++ b/hr_payroll.php @@ -175,10 +175,10 @@ $total_salaries = $sumStmt->fetchColumn() ?: 0; -
+
-
+
@@ -217,7 +217,7 @@ $total_salaries = $sumStmt->fetchColumn() ?: 0;
-
+
@@ -239,7 +239,7 @@ $total_salaries = $sumStmt->fetchColumn() ?: 0; data-bs-toggle="modal" data-bs-target="#editPayModal" data-id="" - data-name="" + data-name="" data-bonus="" data-deduct="" data-status=""> diff --git a/hr_reports.php b/hr_reports.php index 0d990c2..ffdbca3 100644 --- a/hr_reports.php +++ b/hr_reports.php @@ -146,10 +146,10 @@ $year = $_GET['year'] ?? date('Y'); #
-
+
مرفقات
- + @@ -277,7 +277,7 @@ if (isset($_GET['id'])) {
diff --git a/includes/footer.php b/includes/footer.php index e301dd6..a663807 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,21 +1,22 @@ - + + + - \ No newline at end of file + diff --git a/install.php b/install.php index ffb921a..8171d1e 100755 --- a/install.php +++ b/install.php @@ -68,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $content .= "}\n"; if (file_put_contents($config_file, $content)) { - header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME']) . '?step=3'); + header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME'] ?? '') . '?step=3'); exit; } else { $error = "Failed to write configuration file to $config_file. Please check permissions."; @@ -118,7 +118,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (empty($sql)) continue; // Split SQL into individual statements by ; followed by newline - $statements = preg_split('/;(?:\\s*[ + $statements = preg_split('/;(?:\\s*[ ]+)/', $sql); $file_success = true; @@ -168,7 +168,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (empty($errors)) { $success = "Successfully applied migrations."; - header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME']) . '?step=4'); + header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME'] ?? '') . '?step=4'); exit; } else { $error = "Applied migrations, but some errors occurred:
  • " . implode('
  • ', $errors) . "
"; @@ -199,7 +199,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $pdo->exec("INSERT IGNORE INTO charity_settings (id, charity_name) VALUES (1, 'Admin Panel')"); $pdo->exec("INSERT IGNORE INTO smtp_settings (id, is_enabled) VALUES (1, 0)"); - header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME']) . '?step=5'); + header('Location: ' . htmlspecialchars($_SERVER['SCRIPT_NAME'] ?? '') . '?step=5'); exit; } catch (Throwable $e) { $error = "Failed to create admin account: " . $e->getMessage(); @@ -263,7 +263,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- Next: Database Config + Next: Database Config Fix requirements to continue"; endif; ?> @@ -271,7 +271,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

Step 2: Database Connection

- +
@@ -296,7 +296,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

Step 3: Database Migrations

We will now run the SQL scripts to set up your database tables.

- +
@@ -304,7 +304,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

Step 4: Admin Account

- +
diff --git a/internal_inbox.php b/internal_inbox.php index 1ff6b4d..1945735 100644 --- a/internal_inbox.php +++ b/internal_inbox.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/includes/header.php'; // Every logged-in user can access their own internal mail if they have permission if (!canView('internal')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $user_id = $_SESSION['user_id']; @@ -55,7 +55,7 @@ function getStatusBadgeInternal($mail) { if ($status_name == 'in_progress') $display_name = 'قيد المعالجة'; if ($status_name == 'closed') $display_name = 'مؤرشف'; - return '' . htmlspecialchars($display_name) . ''; + return '' . htmlspecialchars($display_name ?? '') . ''; } ?> @@ -72,7 +72,7 @@ function getStatusBadgeInternal($mail) { @@ -83,7 +83,7 @@ function getStatusBadgeInternal($mail) {
- +
@@ -126,14 +126,14 @@ function getStatusBadgeInternal($mail) {
-
+
- + - @@ -142,7 +142,7 @@ function getStatusBadgeInternal($mail) { عرض diff --git a/internal_outbox.php b/internal_outbox.php index a4c3e97..049a5ba 100644 --- a/internal_outbox.php +++ b/internal_outbox.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/includes/header.php'; require_once __DIR__ . '/m_services/MailService.php'; if (!canView('internal')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $user_id = $_SESSION['user_id']; @@ -67,8 +67,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' $htmlBody = "

لديك رسالة داخلية جديدة

-

الموضوع: " . htmlspecialchars($subject) . "

-

المرسل: " . htmlspecialchars($_SESSION['name']) . "

+

الموضوع: " . htmlspecialchars($subject ?? '') . "

+

المرسل: " . htmlspecialchars($_SESSION['name'] ?? '') . "


" . $description . "

@@ -150,7 +150,7 @@ function getStatusBadgeInternal($mail) { if ($status_name == 'in_progress') $display_name = 'قيد المتابعة'; if ($status_name == 'closed') $display_name = 'مؤرشفة'; - return '' . htmlspecialchars($display_name) . ''; + return '' . htmlspecialchars($display_name ?? '') . ''; } ?> @@ -167,14 +167,14 @@ function getStatusBadgeInternal($mail) { @@ -185,7 +185,7 @@ function getStatusBadgeInternal($mail) {
- +
@@ -228,14 +228,14 @@ function getStatusBadgeInternal($mail) {
-
+
- + - @@ -244,7 +244,7 @@ function getStatusBadgeInternal($mail) { عرض diff --git a/login.php b/login.php index 70e3ac2..dd2e055 100644 --- a/login.php +++ b/login.php @@ -40,9 +40,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- Logo + Logo -

+

نظام إدارة الفرق التطوعية ولجان الزكاة

يرجى إدخال بيانات الاعتماد الخاصة بك

diff --git a/meetings.php b/meetings.php index b4efb42..e83fdbe 100644 --- a/meetings.php +++ b/meetings.php @@ -4,7 +4,7 @@ require_once __DIR__ . '/includes/header.php'; require_once __DIR__ . '/includes/pagination.php'; if (!canView('meetings')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $error = ''; @@ -190,7 +190,7 @@ if (isset($_SESSION['success'])) {
- +
@@ -240,9 +240,9 @@ if (isset($_SESSION['success'])) { ?>
- + -
+
@@ -251,14 +251,14 @@ if (isset($_SESSION['success'])) { - + - diff --git a/my_leaves.php b/my_leaves.php index 934400e..f546895 100644 --- a/my_leaves.php +++ b/my_leaves.php @@ -93,10 +93,10 @@ $requests = $stmt->fetchAll(); -
+
-
+
@@ -137,7 +137,7 @@ $requests = $stmt->fetchAll(); من
إلى
يوم
-
+
مرفقات
- +
diff --git a/overdue_report.php b/overdue_report.php index baef4b6..22fa1dd 100644 --- a/overdue_report.php +++ b/overdue_report.php @@ -2,7 +2,7 @@ require_once 'includes/header.php'; if (!canView('reports')) { - redirect('index.php'); + redirect('user_dashboard.php'); } $type_filter = $_GET['type'] ?? ''; @@ -64,7 +64,7 @@ function getStatusBadgeForReport($item) { if ($status_name == 'in_progress') $display_name = 'قيد المعالجة'; if ($status_name == 'closed') $display_name = 'مكتمل'; - return '' . htmlspecialchars($display_name) . ''; + return '' . htmlspecialchars($display_name ?? '') . ''; } ?> @@ -89,7 +89,7 @@ function getStatusBadgeForReport($item) { @@ -132,13 +132,13 @@ function getStatusBadgeForReport($item) { $diff = $today->diff($due_date)->format("%a"); ?>
- + -
+
@@ -193,7 +193,7 @@ $status_labels = [ $m): ?>
+ + + + + + + + + + + + + + + + + + + + + + +
#عنوان الحدثالتاريخالوقتالمكانالتفاصيل
+ + +
+ تم استخراج هذا المستند إلكترونياً من النظام بتاريخ +
+
+ + \ No newline at end of file diff --git a/print_inbound.php b/print_inbound.php index bf45149..b839a53 100644 --- a/print_inbound.php +++ b/print_inbound.php @@ -89,7 +89,7 @@ $hijriDate = gregorianToHijri($mail['date_registered']); - طباعة بريد وارد - <?= htmlspecialchars($mail['ref_no']) ?> + طباعة بريد وارد - <?= htmlspecialchars($mail['ref_no'] ?? '') ?>