From 07e733df85305922afa716fc09a8e495d6eee571 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 22 Mar 2026 03:40:33 +0000 Subject: [PATCH] update dashboard --- appointments.php | 3 +++ billing.php | 3 +++ cities.php | 3 +++ dashboard.php | 4 ++++ departments.php | 3 +++ doctors.php | 3 +++ drugs.php | 3 +++ drugs_groups.php | 3 +++ employees.php | 3 +++ hospital_services.php | 3 +++ insurance.php | 3 +++ inventory_categories.php | 3 +++ inventory_dashboard.php | 3 +++ inventory_items.php | 3 +++ inventory_reports.php | 3 +++ inventory_transactions.php | 3 +++ laboratory_inquiries.php | 3 +++ laboratory_tests.php | 3 +++ nurses.php | 3 +++ patients.php | 3 +++ pharmacy_inventory.php | 3 +++ pharmacy_lpos.php | 3 +++ pharmacy_pos.php | 3 +++ pharmacy_sales.php | 3 +++ positions.php | 3 +++ print_appointments.php | 3 +++ print_bill.php | 3 +++ print_insurance_statement.php | 3 +++ print_patient_label.php | 3 +++ print_pharmacy_receipt.php | 3 +++ print_pharmacy_report.php | 3 +++ print_prescription.php | 3 +++ print_xray_inquiry.php | 3 +++ queue_ads.php | 3 +++ reports.php | 3 +++ roles.php | 3 +++ settings.php | 3 +++ suppliers.php | 3 +++ test_groups.php | 3 +++ users.php | 3 +++ visits.php | 3 +++ xray_groups.php | 3 +++ xray_inquiries.php | 3 +++ xray_tests.php | 3 +++ 44 files changed, 133 insertions(+) diff --git a/appointments.php b/appointments.php index 2da6959..a93ea79 100644 --- a/appointments.php +++ b/appointments.php @@ -2,6 +2,9 @@ $section = 'appointments'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/billing.php b/billing.php index 7ade78e..7b7c19b 100644 --- a/billing.php +++ b/billing.php @@ -3,6 +3,9 @@ $section = 'billing'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/cities.php b/cities.php index 55963e9..fdb5dd6 100644 --- a/cities.php +++ b/cities.php @@ -3,6 +3,9 @@ $section = 'cities'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/dashboard.php b/dashboard.php index e9aa3e8..5362dfe 100644 --- a/dashboard.php +++ b/dashboard.php @@ -3,6 +3,10 @@ $section = 'dashboard'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +// Auth Check (Moved to top to prevent 500 error on unauthenticated access) +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/departments.php b/departments.php index a9837f1..5a8e336 100644 --- a/departments.php +++ b/departments.php @@ -3,6 +3,9 @@ $section = 'departments'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/doctors.php b/doctors.php index 2165bd2..a310fab 100644 --- a/doctors.php +++ b/doctors.php @@ -3,6 +3,9 @@ $section = 'doctors'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/drugs.php b/drugs.php index 3ca3197..9d1bedb 100644 --- a/drugs.php +++ b/drugs.php @@ -2,6 +2,9 @@ $section = 'drugs'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/drugs_groups.php b/drugs_groups.php index d73cf32..0a79da4 100644 --- a/drugs_groups.php +++ b/drugs_groups.php @@ -2,6 +2,9 @@ $section = 'drugs_groups'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/employees.php b/employees.php index fdf563d..053233e 100644 --- a/employees.php +++ b/employees.php @@ -11,6 +11,9 @@ require_once 'db/config.php'; require_once 'lang.php'; require_once 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; $section = 'employees'; diff --git a/hospital_services.php b/hospital_services.php index 93fadf6..3a59c04 100644 --- a/hospital_services.php +++ b/hospital_services.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); // Handle Form Submissions diff --git a/insurance.php b/insurance.php index e789543..4635b20 100644 --- a/insurance.php +++ b/insurance.php @@ -3,6 +3,9 @@ $section = 'insurance'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/inventory_categories.php b/inventory_categories.php index 3b2f7ce..aaa3d27 100644 --- a/inventory_categories.php +++ b/inventory_categories.php @@ -2,6 +2,9 @@ $section = 'inventory_categories'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; check_auth(); diff --git a/inventory_dashboard.php b/inventory_dashboard.php index 636e742..c953a18 100644 --- a/inventory_dashboard.php +++ b/inventory_dashboard.php @@ -2,6 +2,9 @@ $section = 'inventory_dashboard'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; check_auth(); diff --git a/inventory_items.php b/inventory_items.php index 7452d1e..dcec378 100644 --- a/inventory_items.php +++ b/inventory_items.php @@ -2,6 +2,9 @@ $section = 'inventory_items'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; check_auth(); diff --git a/inventory_reports.php b/inventory_reports.php index dba3a12..b1ca8b3 100644 --- a/inventory_reports.php +++ b/inventory_reports.php @@ -2,6 +2,9 @@ $section = 'inventory_reports'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; check_auth(); diff --git a/inventory_transactions.php b/inventory_transactions.php index bc60df6..d63f8fd 100644 --- a/inventory_transactions.php +++ b/inventory_transactions.php @@ -2,6 +2,9 @@ $section = 'inventory_transactions'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; check_auth(); diff --git a/laboratory_inquiries.php b/laboratory_inquiries.php index 534ba34..cad2353 100644 --- a/laboratory_inquiries.php +++ b/laboratory_inquiries.php @@ -3,6 +3,9 @@ $section = 'laboratory_inquiries'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/laboratory_tests.php b/laboratory_tests.php index a78db5e..cc72409 100644 --- a/laboratory_tests.php +++ b/laboratory_tests.php @@ -3,6 +3,9 @@ $section = 'laboratory_tests'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/nurses.php b/nurses.php index 38f3abe..93985b1 100644 --- a/nurses.php +++ b/nurses.php @@ -3,6 +3,9 @@ $section = 'nurses'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/patients.php b/patients.php index 9c4a717..e395572 100644 --- a/patients.php +++ b/patients.php @@ -3,6 +3,9 @@ $section = 'patients'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/pharmacy_inventory.php b/pharmacy_inventory.php index c37aa6a..4a95a1a 100644 --- a/pharmacy_inventory.php +++ b/pharmacy_inventory.php @@ -3,6 +3,9 @@ $section = 'pharmacy_inventory'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/pharmacy_lpos.php b/pharmacy_lpos.php index eb276a4..df193e9 100644 --- a/pharmacy_lpos.php +++ b/pharmacy_lpos.php @@ -3,6 +3,9 @@ $section = 'pharmacy_lpos'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/pharmacy_pos.php b/pharmacy_pos.php index 3b7f716..82f26e4 100644 --- a/pharmacy_pos.php +++ b/pharmacy_pos.php @@ -3,6 +3,9 @@ $section = 'pharmacy_pos'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/pharmacy_sales.php b/pharmacy_sales.php index b02d3df..10e3979 100644 --- a/pharmacy_sales.php +++ b/pharmacy_sales.php @@ -3,6 +3,9 @@ $section = 'pharmacy_sales'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/positions.php b/positions.php index 215e0e6..6d802d3 100644 --- a/positions.php +++ b/positions.php @@ -11,6 +11,9 @@ require_once 'db/config.php'; require_once 'lang.php'; require_once 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; $section = 'positions'; diff --git a/print_appointments.php b/print_appointments.php index 7537d84..2c65cbb 100644 --- a/print_appointments.php +++ b/print_appointments.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $lang = $_SESSION['lang'] ?? 'en'; $date = $_GET['date'] ?? date('Y-m-d'); $doctor_id = $_GET['doctor_id'] ?? ''; diff --git a/print_bill.php b/print_bill.php index ae152c9..bad4d3e 100644 --- a/print_bill.php +++ b/print_bill.php @@ -2,6 +2,9 @@ require 'db/config.php'; require 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + // Enable error reporting for debugging ini_set('display_errors', 1); ini_set('display_startup_errors', 1); diff --git a/print_insurance_statement.php b/print_insurance_statement.php index 26f2ada..05e189e 100644 --- a/print_insurance_statement.php +++ b/print_insurance_statement.php @@ -2,6 +2,9 @@ require 'db/config.php'; require 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + // Enable error reporting ini_set('display_errors', 1); ini_set('display_startup_errors', 1); diff --git a/print_patient_label.php b/print_patient_label.php index e6e2532..753172f 100644 --- a/print_patient_label.php +++ b/print_patient_label.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/print_pharmacy_receipt.php b/print_pharmacy_receipt.php index 568f886..e82eeaa 100644 --- a/print_pharmacy_receipt.php +++ b/print_pharmacy_receipt.php @@ -2,6 +2,9 @@ require 'db/config.php'; require 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + // Enable error reporting for debugging ini_set('display_errors', 1); ini_set('display_startup_errors', 1); diff --git a/print_pharmacy_report.php b/print_pharmacy_report.php index ff9c227..8d8ca60 100644 --- a/print_pharmacy_report.php +++ b/print_pharmacy_report.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $pdo = db(); $lang = $_SESSION['lang'] ?? 'en'; $type = $_GET['type'] ?? 'inventory_valuation'; diff --git a/print_prescription.php b/print_prescription.php index 3eee0b5..280e50c 100644 --- a/print_prescription.php +++ b/print_prescription.php @@ -2,6 +2,9 @@ require 'db/config.php'; require 'helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + // Enable error reporting for debugging (remove in production if sensitive) ini_set('display_errors', 1); ini_set('display_startup_errors', 1); diff --git a/print_xray_inquiry.php b/print_xray_inquiry.php index 8b568c2..76193e6 100644 --- a/print_xray_inquiry.php +++ b/print_xray_inquiry.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'] ?? 'en'; $id = $_GET['id'] ?? 0; diff --git a/queue_ads.php b/queue_ads.php index fe18847..d34959d 100644 --- a/queue_ads.php +++ b/queue_ads.php @@ -3,6 +3,9 @@ $section = 'queue_ads'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/reports.php b/reports.php index ada19bd..ba958aa 100644 --- a/reports.php +++ b/reports.php @@ -3,6 +3,9 @@ $section = 'reports'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/roles.php b/roles.php index c0a823c..88804f0 100644 --- a/roles.php +++ b/roles.php @@ -2,6 +2,9 @@ $section = 'roles'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; // Check permissions diff --git a/settings.php b/settings.php index e1bae39..2ea6a8d 100644 --- a/settings.php +++ b/settings.php @@ -3,6 +3,9 @@ $section = 'company_profile'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; $message = ''; diff --git a/suppliers.php b/suppliers.php index 3a68096..def6220 100644 --- a/suppliers.php +++ b/suppliers.php @@ -3,6 +3,9 @@ $section = 'suppliers'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'] ?? 'en'; diff --git a/test_groups.php b/test_groups.php index cfc8498..f014536 100644 --- a/test_groups.php +++ b/test_groups.php @@ -3,6 +3,9 @@ $section = 'test_groups'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/users.php b/users.php index 8639130..d405ec0 100644 --- a/users.php +++ b/users.php @@ -2,6 +2,9 @@ $section = 'users'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; + +require_once __DIR__ . '/includes/auth.php'; +check_auth(); require_once __DIR__ . '/includes/auth.php'; // Check permissions diff --git a/visits.php b/visits.php index 7fcdbda..e10744a 100644 --- a/visits.php +++ b/visits.php @@ -3,6 +3,9 @@ $section = 'visits'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/xray_groups.php b/xray_groups.php index 17080c1..a4e3a3a 100644 --- a/xray_groups.php +++ b/xray_groups.php @@ -3,6 +3,9 @@ $section = 'xray_groups'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/xray_inquiries.php b/xray_inquiries.php index 5231c47..403fdad 100644 --- a/xray_inquiries.php +++ b/xray_inquiries.php @@ -3,6 +3,9 @@ $section = 'xray_inquiries'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang']; diff --git a/xray_tests.php b/xray_tests.php index 5ab91d7..4a4c6e8 100644 --- a/xray_tests.php +++ b/xray_tests.php @@ -3,6 +3,9 @@ $section = 'xray_tests'; require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/helpers.php'; +require_once __DIR__ . '/includes/auth.php'; +check_auth(); + $db = db(); $lang = $_SESSION['lang'];