Autosave: 20260304-062638
This commit is contained in:
parent
85f641cde7
commit
63a866d898
13
departments.php
Normal file
13
departments.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
$section = 'departments';
|
||||||
|
require_once __DIR__ . '/db/config.php';
|
||||||
|
require_once __DIR__ . '/helpers.php';
|
||||||
|
|
||||||
|
$db = db();
|
||||||
|
$lang = $_SESSION['lang'];
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/actions.php';
|
||||||
|
require_once __DIR__ . '/includes/common_data.php';
|
||||||
|
require_once __DIR__ . '/includes/layout/header.php';
|
||||||
|
require_once __DIR__ . '/includes/pages/departments.php';
|
||||||
|
require_once __DIR__ . '/includes/layout/footer.php';
|
||||||
13
doctors.php
Normal file
13
doctors.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
$section = 'doctors';
|
||||||
|
require_once __DIR__ . '/db/config.php';
|
||||||
|
require_once __DIR__ . '/helpers.php';
|
||||||
|
|
||||||
|
$db = db();
|
||||||
|
$lang = $_SESSION['lang'];
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/actions.php';
|
||||||
|
require_once __DIR__ . '/includes/common_data.php';
|
||||||
|
require_once __DIR__ . '/includes/layout/header.php';
|
||||||
|
require_once __DIR__ . '/includes/pages/doctors.php';
|
||||||
|
require_once __DIR__ . '/includes/layout/footer.php';
|
||||||
23
employees.php
Normal file
23
employees.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
if (!isset($_SESSION['lang'])) {
|
||||||
|
$_SESSION['lang'] = 'en';
|
||||||
|
}
|
||||||
|
if (isset($_GET['lang'])) {
|
||||||
|
$_SESSION['lang'] = $_GET['lang'] === 'ar' ? 'ar' : 'en';
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'db/config.php';
|
||||||
|
require_once 'lang.php';
|
||||||
|
require_once 'helpers.php';
|
||||||
|
|
||||||
|
$db = db();
|
||||||
|
$lang = $_SESSION['lang'];
|
||||||
|
$section = 'employees';
|
||||||
|
|
||||||
|
require_once 'includes/actions.php';
|
||||||
|
require_once 'includes/common_data.php';
|
||||||
|
|
||||||
|
include 'includes/layout/header.php';
|
||||||
|
include 'includes/pages/employees.php';
|
||||||
|
include 'includes/layout/footer.php';
|
||||||
@ -1,7 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
// includes/actions.php
|
// includes/actions.php
|
||||||
$message = '';
|
$message = '';
|
||||||
|
|
||||||
|
if (isset($_SESSION['flash_message'])) {
|
||||||
|
$message = $_SESSION['flash_message'];
|
||||||
|
unset($_SESSION['flash_message']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
$redirect = false;
|
||||||
if (isset($_POST['action'])) {
|
if (isset($_POST['action'])) {
|
||||||
if ($_POST['action'] === 'add_patient') {
|
if ($_POST['action'] === 'add_patient') {
|
||||||
$name = $_POST['name'] ?? '';
|
$name = $_POST['name'] ?? '';
|
||||||
@ -16,7 +23,136 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
if ($name && $phone) {
|
if ($name && $phone) {
|
||||||
$stmt = $db->prepare("INSERT INTO patients (name, phone, dob, gender, blood_group, address, insurance_company_id, policy_number) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO patients (name, phone, dob, gender, blood_group, address, insurance_company_id, policy_number) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
$stmt->execute([$name, $phone, $dob, $gender, $blood_group, $address, $insurance_company_id, $policy_number]);
|
$stmt->execute([$name, $phone, $dob, $gender, $blood_group, $address, $insurance_company_id, $policy_number]);
|
||||||
$message = __('add_patient') . ' ' . __('successfully');
|
$_SESSION['flash_message'] = __('add_patient') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_patient') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name = $_POST['name'] ?? '';
|
||||||
|
$phone = $_POST['phone'] ?? '';
|
||||||
|
$dob = $_POST['dob'] ?? '';
|
||||||
|
$gender = $_POST['gender'] ?? '';
|
||||||
|
$blood_group = $_POST['blood_group'] ?? '';
|
||||||
|
$address = $_POST['address'] ?? '';
|
||||||
|
$insurance_company_id = $_POST['insurance_company_id'] ?: null;
|
||||||
|
$policy_number = $_POST['policy_number'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name && $phone) {
|
||||||
|
$stmt = $db->prepare("UPDATE patients SET name = ?, phone = ?, dob = ?, gender = ?, blood_group = ?, address = ?, insurance_company_id = ?, policy_number = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name, $phone, $dob, $gender, $blood_group, $address, $insurance_company_id, $policy_number, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_patient') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_patient') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM patients WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_patient') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_doctor') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$spec_en = $_POST['specialization_en'] ?? '';
|
||||||
|
$spec_ar = $_POST['specialization_ar'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$tel = $_POST['tel'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO doctors (name_en, name_ar, specialization_en, specialization_ar, department_id, tel, email) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $spec_en, $spec_ar, $dept_id, $tel, $email]);
|
||||||
|
$_SESSION['flash_message'] = __('add_doctor') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_doctor') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$spec_en = $_POST['specialization_en'] ?? '';
|
||||||
|
$spec_ar = $_POST['specialization_ar'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$tel = $_POST['tel'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE doctors SET name_en = ?, name_ar = ?, specialization_en = ?, specialization_ar = ?, department_id = ?, tel = ?, email = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $spec_en, $spec_ar, $dept_id, $tel, $email, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_doctor') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_doctor') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM doctors WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_doctor') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_nurse') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$tel = $_POST['tel'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO nurses (name_en, name_ar, department_id, tel, email) VALUES (?, ?, ?, ?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $dept_id, $tel, $email]);
|
||||||
|
$_SESSION['flash_message'] = __('add_nurse') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_nurse') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$tel = $_POST['tel'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE nurses SET name_en = ?, name_ar = ?, department_id = ?, tel = ?, email = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $dept_id, $tel, $email, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_nurse') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_nurse') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM nurses WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_nurse') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_department') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO departments (name_en, name_ar) VALUES (?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar]);
|
||||||
|
$_SESSION['flash_message'] = __('add_department') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_department') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE departments SET name_en = ?, name_ar = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_department') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_department') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM departments WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_department') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'add_insurance') {
|
} elseif ($_POST['action'] === 'add_insurance') {
|
||||||
$name_en = $_POST['name_en'] ?? '';
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
@ -28,7 +164,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
if ($name_en && $name_ar) {
|
if ($name_en && $name_ar) {
|
||||||
$stmt = $db->prepare("INSERT INTO insurance_companies (name_en, name_ar, email, phone, contact_info) VALUES (?, ?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO insurance_companies (name_en, name_ar, email, phone, contact_info) VALUES (?, ?, ?, ?, ?)");
|
||||||
$stmt->execute([$name_en, $name_ar, $email, $phone, $contact]);
|
$stmt->execute([$name_en, $name_ar, $email, $phone, $contact]);
|
||||||
$message = __('insurance_company') . ' ' . __('successfully');
|
$_SESSION['flash_message'] = __('insurance_company') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'book_appointment') {
|
} elseif ($_POST['action'] === 'book_appointment') {
|
||||||
$patient_id = $_POST['patient_id'] ?? '';
|
$patient_id = $_POST['patient_id'] ?? '';
|
||||||
@ -39,7 +176,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
if ($patient_id && $doctor_id && $date) {
|
if ($patient_id && $doctor_id && $date) {
|
||||||
$stmt = $db->prepare("INSERT INTO appointments (patient_id, doctor_id, appointment_date, reason) VALUES (?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO appointments (patient_id, doctor_id, appointment_date, reason) VALUES (?, ?, ?, ?)");
|
||||||
$stmt->execute([$patient_id, $doctor_id, $date, $reason]);
|
$stmt->execute([$patient_id, $doctor_id, $date, $reason]);
|
||||||
$message = __('book_appointment') . ' ' . __('successfully');
|
$_SESSION['flash_message'] = __('book_appointment') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'record_visit') {
|
} elseif ($_POST['action'] === 'record_visit') {
|
||||||
$patient_id = $_POST['patient_id'] ?? '';
|
$patient_id = $_POST['patient_id'] ?? '';
|
||||||
@ -60,7 +198,26 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
if ($appointment_id) {
|
if ($appointment_id) {
|
||||||
$db->prepare("UPDATE appointments SET status = 'Completed' WHERE id = ?")->execute([$appointment_id]);
|
$db->prepare("UPDATE appointments SET status = 'Completed' WHERE id = ?")->execute([$appointment_id]);
|
||||||
}
|
}
|
||||||
$message = __('visit_recorded');
|
$_SESSION['flash_message'] = __('visit_recorded');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_visit') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$patient_id = $_POST['patient_id'] ?? '';
|
||||||
|
$doctor_id = $_POST['doctor_id'] ?? '';
|
||||||
|
$weight = $_POST['weight'] ?? '';
|
||||||
|
$bp = $_POST['blood_pressure'] ?? '';
|
||||||
|
$hr = $_POST['heart_rate'] ?? '';
|
||||||
|
$temp = $_POST['temperature'] ?? '';
|
||||||
|
$symptoms = $_POST['symptoms'] ?? '';
|
||||||
|
$diagnosis = $_POST['diagnosis'] ?? '';
|
||||||
|
$treatment = $_POST['treatment_plan'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $patient_id && $doctor_id) {
|
||||||
|
$stmt = $db->prepare("UPDATE visits SET patient_id = ?, doctor_id = ?, weight = ?, blood_pressure = ?, heart_rate = ?, temperature = ?, symptoms = ?, diagnosis = ?, treatment_plan = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$patient_id, $doctor_id, $weight, $bp, $hr, $temp, $symptoms, $diagnosis, $treatment, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_visit') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'create_report') {
|
} elseif ($_POST['action'] === 'create_report') {
|
||||||
$visit_id = $_POST['visit_id'] ?? '';
|
$visit_id = $_POST['visit_id'] ?? '';
|
||||||
@ -71,7 +228,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
if ($visit_id && $type) {
|
if ($visit_id && $type) {
|
||||||
$stmt = $db->prepare("INSERT INTO provisional_reports (visit_id, report_type, findings, recommendations) VALUES (?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO provisional_reports (visit_id, report_type, findings, recommendations) VALUES (?, ?, ?, ?)");
|
||||||
$stmt->execute([$visit_id, $type, $findings, $recommendations]);
|
$stmt->execute([$visit_id, $type, $findings, $recommendations]);
|
||||||
$message = __('report_created');
|
$_SESSION['flash_message'] = __('report_created');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'create_bill') {
|
} elseif ($_POST['action'] === 'create_bill') {
|
||||||
$patient_id = $_POST['patient_id'] ?? '';
|
$patient_id = $_POST['patient_id'] ?? '';
|
||||||
@ -104,14 +262,153 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
$item_stmt->execute([$bill_id, $desc, $amounts[$index]]);
|
$item_stmt->execute([$bill_id, $desc, $amounts[$index]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$message = __('bill_created');
|
$_SESSION['flash_message'] = __('bill_created');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
} elseif ($_POST['action'] === 'mark_paid') {
|
} elseif ($_POST['action'] === 'mark_paid') {
|
||||||
$bill_id = $_POST['bill_id'] ?? '';
|
$bill_id = $_POST['bill_id'] ?? '';
|
||||||
if ($bill_id) {
|
if ($bill_id) {
|
||||||
$db->prepare("UPDATE bills SET status = 'Paid' WHERE id = ?")->execute([$bill_id]);
|
$db->prepare("UPDATE bills SET status = 'Paid' WHERE id = ?")->execute([$bill_id]);
|
||||||
$message = __('bill_paid');
|
$_SESSION['flash_message'] = __('bill_paid');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_employee') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$dob = $_POST['dob'] ?? '';
|
||||||
|
$mobile = $_POST['mobile'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$passion_en = $_POST['passion_en'] ?? '';
|
||||||
|
$passion_ar = $_POST['passion_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO employees (name_en, name_ar, dob, mobile, email, department_id, passion_en, passion_ar) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $dob, $mobile, $email, $dept_id, $passion_en, $passion_ar]);
|
||||||
|
$_SESSION['flash_message'] = __('add_employee') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_employee') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$dob = $_POST['dob'] ?? '';
|
||||||
|
$mobile = $_POST['mobile'] ?? '';
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
$dept_id = $_POST['department_id'] ?: null;
|
||||||
|
$passion_en = $_POST['passion_en'] ?? '';
|
||||||
|
$passion_ar = $_POST['passion_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE employees SET name_en = ?, name_ar = ?, dob = ?, mobile = ?, email = ?, department_id = ?, passion_en = ?, passion_ar = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $dob, $mobile, $email, $dept_id, $passion_en, $passion_ar, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_employee') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_employee') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM employees WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_employee') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_poison') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$desc_en = $_POST['description_en'] ?? '';
|
||||||
|
$desc_ar = $_POST['description_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO poisons (name_en, name_ar, description_en, description_ar) VALUES (?, ?, ?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $desc_en, $desc_ar]);
|
||||||
|
$_SESSION['flash_message'] = __('add_poison') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_poison') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$desc_en = $_POST['description_en'] ?? '';
|
||||||
|
$desc_ar = $_POST['description_ar'] ?? '';
|
||||||
|
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE poisons SET name_en = ?, name_ar = ?, description_en = ?, description_ar = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $desc_en, $desc_ar, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_poison') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_poison') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM poisons WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_poison') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_test_group') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO test_groups (name_en, name_ar) VALUES (?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar]);
|
||||||
|
$_SESSION['flash_message'] = __('add_test_group') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_test_group') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE test_groups SET name_en = ?, name_ar = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_test_group') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_test_group') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM test_groups WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_test_group') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'add_test') {
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$group_id = $_POST['group_id'] ?: null;
|
||||||
|
$price = $_POST['price'] ?? 0;
|
||||||
|
if ($name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("INSERT INTO laboratory_tests (name_en, name_ar, group_id, price) VALUES (?, ?, ?, ?)");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $group_id, $price]);
|
||||||
|
$_SESSION['flash_message'] = __('add_test') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'edit_test') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
$name_en = $_POST['name_en'] ?? '';
|
||||||
|
$name_ar = $_POST['name_ar'] ?? '';
|
||||||
|
$group_id = $_POST['group_id'] ?: null;
|
||||||
|
$price = $_POST['price'] ?? 0;
|
||||||
|
if ($id && $name_en && $name_ar) {
|
||||||
|
$stmt = $db->prepare("UPDATE laboratory_tests SET name_en = ?, name_ar = ?, group_id = ?, price = ? WHERE id = ?");
|
||||||
|
$stmt->execute([$name_en, $name_ar, $group_id, $price, $id]);
|
||||||
|
$_SESSION['flash_message'] = __('update_test') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
|
}
|
||||||
|
} elseif ($_POST['action'] === 'delete_test') {
|
||||||
|
$id = $_POST['id'] ?? '';
|
||||||
|
if ($id) {
|
||||||
|
$stmt = $db->prepare("DELETE FROM laboratory_tests WHERE id = ?");
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$_SESSION['flash_message'] = __('delete_test') . ' ' . __('successfully');
|
||||||
|
$redirect = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($redirect) {
|
||||||
|
header("Location: " . $_SERVER['REQUEST_URI']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -2,7 +2,14 @@
|
|||||||
// Common data for selects
|
// Common data for selects
|
||||||
$all_doctors = $db->query("SELECT id, name_$lang as name FROM doctors")->fetchAll();
|
$all_doctors = $db->query("SELECT id, name_$lang as name FROM doctors")->fetchAll();
|
||||||
$all_patients = $db->query("SELECT id, name FROM patients")->fetchAll();
|
$all_patients = $db->query("SELECT id, name FROM patients")->fetchAll();
|
||||||
|
$all_nurses = $db->query("SELECT id, name_$lang as name FROM nurses")->fetchAll();
|
||||||
|
$all_departments = $db->query("SELECT id, name_$lang as name FROM departments")->fetchAll();
|
||||||
|
$all_employees = $db->query("SELECT id, name_$lang as name FROM employees")->fetchAll();
|
||||||
|
$all_poisons = $db->query("SELECT id, name_$lang as name FROM poisons")->fetchAll();
|
||||||
$all_insurance = $db->query("SELECT id, name_$lang as name FROM insurance_companies")->fetchAll();
|
$all_insurance = $db->query("SELECT id, name_$lang as name FROM insurance_companies")->fetchAll();
|
||||||
|
$all_test_groups = $db->query("SELECT id, name_$lang as name FROM test_groups")->fetchAll();
|
||||||
|
$all_tests = $db->query("SELECT id, name_$lang as name, price FROM laboratory_tests")->fetchAll();
|
||||||
|
|
||||||
$scheduled_appointments = $db->query("
|
$scheduled_appointments = $db->query("
|
||||||
SELECT a.id, p.name as patient_name, a.appointment_date, a.patient_id, a.doctor_id
|
SELECT a.id, p.name as patient_name, a.appointment_date, a.patient_id, a.doctor_id
|
||||||
FROM appointments a
|
FROM appointments a
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,10 @@ $message = $message ?? '';
|
|||||||
.sidebar { min-height: 100vh; width: 250px; background-color: #002D62; color: white; transition: all 0.3s; }
|
.sidebar { min-height: 100vh; width: 250px; background-color: #002D62; color: white; transition: all 0.3s; }
|
||||||
.sidebar-link { color: #cfd8dc; text-decoration: none; padding: 12px 20px; display: block; border-left: 4px solid transparent; }
|
.sidebar-link { color: #cfd8dc; text-decoration: none; padding: 12px 20px; display: block; border-left: 4px solid transparent; }
|
||||||
.sidebar-link:hover, .sidebar-link.active { background-color: #003a80; color: white; border-left-color: #4fc3f7; }
|
.sidebar-link:hover, .sidebar-link.active { background-color: #003a80; color: white; border-left-color: #4fc3f7; }
|
||||||
|
.sidebar-submenu { background-color: #001f44; padding-left: 20px; }
|
||||||
|
<?php if (is_rtl()): ?>
|
||||||
|
.sidebar-submenu { padding-left: 0; padding-right: 20px; }
|
||||||
|
<?php endif; ?>
|
||||||
.main-content { flex: 1; padding: 25px; }
|
.main-content { flex: 1; padding: 25px; }
|
||||||
.card { border: none; border-radius: 8px; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); margin-bottom: 20px; }
|
.card { border: none; border-radius: 8px; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); margin-bottom: 20px; }
|
||||||
.stat-card { padding: 20px; text-align: center; }
|
.stat-card { padding: 20px; text-align: center; }
|
||||||
@ -55,11 +59,34 @@ $message = $message ?? '';
|
|||||||
<a href="dashboard.php" class="sidebar-link <?php echo $section === 'dashboard' ? 'active' : ''; ?>"><i class="bi bi-speedometer2 me-2"></i> <?php echo __('dashboard'); ?></a>
|
<a href="dashboard.php" class="sidebar-link <?php echo $section === 'dashboard' ? 'active' : ''; ?>"><i class="bi bi-speedometer2 me-2"></i> <?php echo __('dashboard'); ?></a>
|
||||||
<a href="patients.php" class="sidebar-link <?php echo $section === 'patients' ? 'active' : ''; ?>"><i class="bi bi-people me-2"></i> <?php echo __('patients'); ?></a>
|
<a href="patients.php" class="sidebar-link <?php echo $section === 'patients' ? 'active' : ''; ?>"><i class="bi bi-people me-2"></i> <?php echo __('patients'); ?></a>
|
||||||
<a href="visits.php" class="sidebar-link <?php echo $section === 'visits' ? 'active' : ''; ?>"><i class="bi bi-clipboard2-pulse me-2"></i> <?php echo __('visits'); ?></a>
|
<a href="visits.php" class="sidebar-link <?php echo $section === 'visits' ? 'active' : ''; ?>"><i class="bi bi-clipboard2-pulse me-2"></i> <?php echo __('visits'); ?></a>
|
||||||
|
|
||||||
|
<a href="#labSubmenu" data-bs-toggle="collapse" class="sidebar-link <?php echo in_array($section, ['laboratory_tests', 'test_groups']) ? 'active' : ''; ?> d-flex justify-content-between align-items-center">
|
||||||
|
<span><i class="bi bi-prescription2 me-2"></i> <?php echo __('laboratory'); ?></span>
|
||||||
|
<i class="bi bi-chevron-down small"></i>
|
||||||
|
</a>
|
||||||
|
<div class="collapse <?php echo in_array($section, ['laboratory_tests', 'test_groups']) ? 'show' : ''; ?>" id="labSubmenu">
|
||||||
|
<div class="sidebar-submenu">
|
||||||
|
<a href="laboratory_tests.php" class="sidebar-link py-2 <?php echo $section === 'laboratory_tests' ? 'active' : ''; ?>"><i class="bi bi-list-check me-2"></i> <?php echo __('tests'); ?></a>
|
||||||
|
<a href="test_groups.php" class="sidebar-link py-2 <?php echo $section === 'test_groups' ? 'active' : ''; ?>"><i class="bi bi-collection me-2"></i> <?php echo __('test_groups'); ?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a href="billing.php" class="sidebar-link <?php echo $section === 'billing' ? 'active' : ''; ?>"><i class="bi bi-receipt me-2"></i> <?php echo __('billing'); ?></a>
|
<a href="billing.php" class="sidebar-link <?php echo $section === 'billing' ? 'active' : ''; ?>"><i class="bi bi-receipt me-2"></i> <?php echo __('billing'); ?></a>
|
||||||
<a href="insurance.php" class="sidebar-link <?php echo $section === 'insurance' ? 'active' : ''; ?>"><i class="bi bi-shield-check me-2"></i> <?php echo __('insurance'); ?></a>
|
<a href="insurance.php" class="sidebar-link <?php echo $section === 'insurance' ? 'active' : ''; ?>"><i class="bi bi-shield-check me-2"></i> <?php echo __('insurance'); ?></a>
|
||||||
<a href="#" class="sidebar-link"><i class="bi bi-calendar-event me-2"></i> <?php echo __('appointments'); ?></a>
|
<a href="doctors.php" class="sidebar-link <?php echo $section === 'doctors' ? 'active' : ''; ?>"><i class="bi bi-person-badge me-2"></i> <?php echo __('doctors'); ?></a>
|
||||||
<a href="#" class="sidebar-link"><i class="bi bi-person-badge me-2"></i> <?php echo __('doctors'); ?></a>
|
<a href="nurses.php" class="sidebar-link <?php echo $section === 'nurses' ? 'active' : ''; ?>"><i class="bi bi-person-heart me-2"></i> <?php echo __('nurses'); ?></a>
|
||||||
<a href="#" class="sidebar-link"><i class="bi bi-diagram-3 me-2"></i> <?php echo __('departments'); ?></a>
|
<a href="departments.php" class="sidebar-link <?php echo $section === 'departments' ? 'active' : ''; ?>"><i class="bi bi-diagram-3 me-2"></i> <?php echo __('departments'); ?></a>
|
||||||
|
|
||||||
|
<a href="#settingsSubmenu" data-bs-toggle="collapse" class="sidebar-link <?php echo in_array($section, ['employees', 'poisons']) ? 'active' : ''; ?> d-flex justify-content-between align-items-center">
|
||||||
|
<span><i class="bi bi-gear me-2"></i> <?php echo __('settings'); ?></span>
|
||||||
|
<i class="bi bi-chevron-down small"></i>
|
||||||
|
</a>
|
||||||
|
<div class="collapse <?php echo in_array($section, ['employees', 'poisons']) ? 'show' : ''; ?>" id="settingsSubmenu">
|
||||||
|
<div class="sidebar-submenu">
|
||||||
|
<a href="employees.php" class="sidebar-link py-2 <?php echo $section === 'employees' ? 'active' : ''; ?>"><i class="bi bi-person-workspace me-2"></i> <?php echo __('employees'); ?></a>
|
||||||
|
<a href="poisons.php" class="sidebar-link py-2 <?php echo $section === 'poisons' ? 'active' : ''; ?>"><i class="bi bi-radioactive me-2"></i> <?php echo __('poisons'); ?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,58 +1,108 @@
|
|||||||
<?php
|
<?php
|
||||||
$bills_sql = "
|
$search_patient = $_GET['patient'] ?? '';
|
||||||
|
$search_status = $_GET['status'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
SELECT b.*, p.name as patient_name
|
SELECT b.*, p.name as patient_name
|
||||||
FROM bills b
|
FROM bills b
|
||||||
JOIN patients p ON b.patient_id = p.id
|
JOIN patients p ON b.patient_id = p.id
|
||||||
ORDER BY b.created_at DESC";
|
WHERE 1=1";
|
||||||
$bills = $db->query($bills_sql)->fetchAll();
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_patient) {
|
||||||
|
$query .= " AND p.name LIKE ?";
|
||||||
|
$params[] = "%$search_patient%";
|
||||||
|
}
|
||||||
|
if ($search_status) {
|
||||||
|
$query .= " AND b.status = ?";
|
||||||
|
$params[] = $search_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY b.created_at DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$bills = $stmt->fetchAll();
|
||||||
?>
|
?>
|
||||||
<div class="card shadow-sm">
|
|
||||||
<div class="card-header py-3 d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<h5 class="mb-0 fw-bold"><i class="bi bi-receipt me-2 text-primary"></i> <?php echo __('billing'); ?></h5>
|
<h3 class="fw-bold text-secondary"><?php echo __('billing'); ?></h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="patient" class="form-control bg-light border-start-0" placeholder="<?php echo __('patient'); ?>" value="<?php echo htmlspecialchars($search_patient); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<select name="status" class="form-select bg-light">
|
||||||
|
<option value=""><?php echo __('status'); ?> (<?php echo __('all'); ?>)</option>
|
||||||
|
<option value="Pending" <?php echo $search_status == 'Pending' ? 'selected' : ''; ?>><?php echo __('Pending'); ?></option>
|
||||||
|
<option value="Paid" <?php echo $search_status == 'Paid' ? 'selected' : ''; ?>><?php echo __('Paid'); ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<thead>
|
<thead class="table-light text-secondary">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th class="px-4 py-3">ID</th>
|
||||||
<th><?php echo __('date'); ?></th>
|
<th class="py-3"><?php echo __('date'); ?></th>
|
||||||
<th><?php echo __('patient'); ?></th>
|
<th class="py-3"><?php echo __('patient'); ?></th>
|
||||||
<th><?php echo __('total'); ?></th>
|
<th class="py-3"><?php echo __('total'); ?></th>
|
||||||
<th><?php echo __('insurance_covered'); ?></th>
|
<th class="py-3"><?php echo __('insurance_covered'); ?></th>
|
||||||
<th><?php echo __('patient_payable'); ?></th>
|
<th class="py-3"><?php echo __('patient_payable'); ?></th>
|
||||||
<th><?php echo __('status'); ?></th>
|
<th class="py-3"><?php echo __('status'); ?></th>
|
||||||
<th><?php echo __('actions'); ?></th>
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php if (empty($bills)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="8" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-receipt display-4 d-block mb-3"></i>
|
||||||
|
No bills found.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
<?php foreach ($bills as $b): ?>
|
<?php foreach ($bills as $b): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>#<?php echo $b['id']; ?></td>
|
<td class="px-4 text-secondary">#<?php echo $b['id']; ?></td>
|
||||||
<td><?php echo date('Y-m-d H:i', strtotime($b['created_at'])); ?></td>
|
<td class="text-secondary"><?php echo date('Y-m-d H:i', strtotime($b['created_at'])); ?></td>
|
||||||
<td><?php echo htmlspecialchars($b['patient_name']); ?></td>
|
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($b['patient_name']); ?></td>
|
||||||
<td>$<?php echo number_format($b['total_amount'], 2); ?></td>
|
<td class="text-dark">$<?php echo number_format($b['total_amount'], 2); ?></td>
|
||||||
<td class="text-primary">$<?php echo number_format($b['insurance_covered'], 2); ?></td>
|
<td class="text-primary">$<?php echo number_format($b['insurance_covered'], 2); ?></td>
|
||||||
<td class="fw-bold">$<?php echo number_format($b['patient_payable'], 2); ?></td>
|
<td class="fw-bold text-dark">$<?php echo number_format($b['patient_payable'], 2); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge <?php echo $b['status'] === 'Paid' ? 'bg-success' : 'bg-warning'; ?>">
|
<span class="badge <?php echo $b['status'] === 'Paid' ? 'bg-success bg-opacity-10 text-success border border-success border-opacity-25' : 'bg-warning bg-opacity-10 text-warning border border-warning border-opacity-25'; ?> px-2 py-1">
|
||||||
<?php echo __($b['status']); ?>
|
<?php echo __($b['status']); ?>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="text-end px-4">
|
||||||
<?php if ($b['status'] === 'Pending'): ?>
|
<?php if ($b['status'] === 'Pending'): ?>
|
||||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>?section=billing" method="POST" class="d-inline">
|
<form action="<?php echo $_SERVER['PHP_SELF']; ?>?section=billing" method="POST" class="d-inline">
|
||||||
<input type="hidden" name="action" value="mark_paid">
|
<input type="hidden" name="action" value="mark_paid">
|
||||||
<input type="hidden" name="bill_id" value="<?php echo $b['id']; ?>">
|
<input type="hidden" name="bill_id" value="<?php echo $b['id']; ?>">
|
||||||
<button type="submit" class="btn btn-sm btn-success">
|
<button type="submit" class="btn btn-sm btn-success px-3">
|
||||||
<i class="bi bi-check-circle"></i> <?php echo __('mark_as_paid'); ?>
|
<i class="bi bi-check-circle me-1"></i> <?php echo __('mark_as_paid'); ?>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; if (empty($bills)): ?>
|
<?php endforeach; ?>
|
||||||
<tr><td colspan="8" class="text-center py-4 text-muted">No bills found.</td></tr>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
90
includes/pages/departments.php
Normal file
90
includes/pages/departments.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
|
||||||
|
$query = "SELECT * FROM departments WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (name_en LIKE ? OR name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$departments = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('departments'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addDepartmentModal">
|
||||||
|
<i class="bi bi-plus-lg me-1"></i> <?php echo __('add_department'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name_en'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('name_ar'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($departments)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-diagram-3 display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_departments_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($departments as $dept): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $dept['id']; ?></td>
|
||||||
|
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($dept['name_en']); ?></td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($dept['name_ar']); ?></td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditDepartmentModal(<?php echo htmlspecialchars(json_encode($dept)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteDepartmentModal(<?php echo $dept['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
143
includes/pages/doctors.php
Normal file
143
includes/pages/doctors.php
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_tel = $_GET['tel'] ?? '';
|
||||||
|
$search_dept = $_GET['department_id'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT d.*, dept.name_$lang as department_name
|
||||||
|
FROM doctors d
|
||||||
|
LEFT JOIN departments dept ON d.department_id = dept.id
|
||||||
|
WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (d.name_en LIKE ? OR d.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_tel) {
|
||||||
|
$query .= " AND d.tel LIKE ?";
|
||||||
|
$params[] = "%$search_tel%";
|
||||||
|
}
|
||||||
|
if ($search_dept) {
|
||||||
|
$query .= " AND d.department_id = ?";
|
||||||
|
$params[] = $search_dept;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY d.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$doctors = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('doctors'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addDoctorModal">
|
||||||
|
<i class="bi bi-person-plus me-1"></i> <?php echo __('add_doctor'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-telephone"></i></span>
|
||||||
|
<input type="text" name="tel" class="form-control bg-light border-start-0" placeholder="<?php echo __('phone'); ?>" value="<?php echo htmlspecialchars($search_tel); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<select name="department_id" class="form-select bg-light">
|
||||||
|
<option value=""><?php echo __('department'); ?> (<?php echo __('all'); ?>)</option>
|
||||||
|
<?php foreach ($all_departments as $dept): ?>
|
||||||
|
<option value="<?php echo $dept['id']; ?>" <?php echo $search_dept == $dept['id'] ? 'selected' : ''; ?>>
|
||||||
|
<?php echo htmlspecialchars($dept['name']); ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('contact_info'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('specialization'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('department'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($doctors)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-person-badge display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_doctors_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($doctors as $doc): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $doc['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary bg-opacity-10 text-primary p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-person-vcard fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($doc['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($doc['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<small class="text-secondary"><i class="bi bi-telephone me-1"></i><?php echo htmlspecialchars($doc['tel'] ?: '-'); ?></small>
|
||||||
|
<small class="text-muted"><i class="bi bi-envelope me-1"></i><?php echo htmlspecialchars($doc['email'] ?: '-'); ?></small>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge bg-info bg-opacity-10 text-info border border-info border-opacity-25 px-2 py-1">
|
||||||
|
<?php echo htmlspecialchars($doc['specialization_'.$lang]); ?>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($doc['department_name'] ?? '-'); ?></td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditDoctorModal(<?php echo htmlspecialchars(json_encode($doc)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteDoctorModal(<?php echo $doc['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
145
includes/pages/employees.php
Normal file
145
includes/pages/employees.php
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_mobile = $_GET['mobile'] ?? '';
|
||||||
|
$search_dept = $_GET['department_id'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT e.*, dept.name_$lang as department_name
|
||||||
|
FROM employees e
|
||||||
|
LEFT JOIN departments dept ON e.department_id = dept.id
|
||||||
|
WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (e.name_en LIKE ? OR e.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_mobile) {
|
||||||
|
$query .= " AND e.mobile LIKE ?";
|
||||||
|
$params[] = "%$search_mobile%";
|
||||||
|
}
|
||||||
|
if ($search_dept) {
|
||||||
|
$query .= " AND e.department_id = ?";
|
||||||
|
$params[] = $search_dept;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY e.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$employees = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('employees'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addEmployeeModal">
|
||||||
|
<i class="bi bi-person-plus me-1"></i> <?php echo __('add_employee'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-phone"></i></span>
|
||||||
|
<input type="text" name="mobile" class="form-control bg-light border-start-0" placeholder="<?php echo __('mobile'); ?>" value="<?php echo htmlspecialchars($search_mobile); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<select name="department_id" class="form-select bg-light">
|
||||||
|
<option value=""><?php echo __('department'); ?> (<?php echo __('all'); ?>)</option>
|
||||||
|
<?php foreach ($all_departments as $dept): ?>
|
||||||
|
<option value="<?php echo $dept['id']; ?>" <?php echo $search_dept == $dept['id'] ? 'selected' : ''; ?>>
|
||||||
|
<?php echo htmlspecialchars($dept['name']); ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('dob'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('contact_info'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('department'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('passion'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($employees)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-person-workspace display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_employees_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($employees as $emp): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $emp['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary bg-opacity-10 text-primary p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-person fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($emp['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($emp['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td><?php echo htmlspecialchars($emp['dob'] ?: '-'); ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<small class="text-secondary"><i class="bi bi-phone me-1"></i><?php echo htmlspecialchars($emp['mobile'] ?: '-'); ?></small>
|
||||||
|
<small class="text-muted"><i class="bi bi-envelope me-1"></i><?php echo htmlspecialchars($emp['email'] ?: '-'); ?></small>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($emp['department_name'] ?? '-'); ?></td>
|
||||||
|
<td>
|
||||||
|
<small class="text-muted d-block" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||||
|
<?php echo htmlspecialchars($emp['passion_'.$lang] ?: '-'); ?>
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditEmployeeModal(<?php echo htmlspecialchars(json_encode($emp)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteEmployeeModal(<?php echo $emp['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,38 +1,89 @@
|
|||||||
<?php
|
<?php
|
||||||
$insurance_companies = $db->query("SELECT * FROM insurance_companies ORDER BY id DESC")->fetchAll();
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_phone = $_GET['phone'] ?? '';
|
||||||
|
|
||||||
|
$query = "SELECT * FROM insurance_companies WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (name_en LIKE ? OR name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_phone) {
|
||||||
|
$query .= " AND phone LIKE ?";
|
||||||
|
$params[] = "%$search_phone%";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$insurance_companies = $stmt->fetchAll();
|
||||||
?>
|
?>
|
||||||
<div class="card shadow-sm">
|
|
||||||
<div class="card-header py-3 d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<h5 class="mb-0 fw-bold"><i class="bi bi-shield-check me-2 text-primary"></i> <?php echo __('insurance_companies'); ?></h5>
|
<h3 class="fw-bold text-secondary"><?php echo __('insurance_companies'); ?></h3>
|
||||||
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addInsuranceModal">
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addInsuranceModal">
|
||||||
<i class="bi bi-plus-lg"></i> <?php echo __('add_insurance'); ?>
|
<i class="bi bi-plus-lg me-1"></i> <?php echo __('add_insurance'); ?>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-telephone"></i></span>
|
||||||
|
<input type="text" name="phone" class="form-control bg-light border-start-0" placeholder="<?php echo __('phone'); ?>" value="<?php echo htmlspecialchars($search_phone); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<thead>
|
<thead class="table-light text-secondary">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th class="px-4 py-3">ID</th>
|
||||||
<th><?php echo __('name'); ?> (EN)</th>
|
<th class="py-3"><?php echo __('name_en'); ?></th>
|
||||||
<th><?php echo __('name'); ?> (AR)</th>
|
<th class="py-3"><?php echo __('name_ar'); ?></th>
|
||||||
<th><?php echo __('email'); ?></th>
|
<th class="py-3"><?php echo __('email'); ?></th>
|
||||||
<th><?php echo __('phone'); ?></th>
|
<th class="py-3"><?php echo __('phone'); ?></th>
|
||||||
<th><?php echo __('date'); ?></th>
|
<th class="py-3 text-end px-4"><?php echo __('date'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php if (empty($insurance_companies)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-shield-check display-4 d-block mb-3"></i>
|
||||||
|
No insurance companies found.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
<?php foreach ($insurance_companies as $ic): ?>
|
<?php foreach ($insurance_companies as $ic): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>#<?php echo $ic['id']; ?></td>
|
<td class="px-4 text-secondary">#<?php echo $ic['id']; ?></td>
|
||||||
<td><?php echo htmlspecialchars($ic['name_en']); ?></td>
|
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($ic['name_en']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($ic['name_ar']); ?></td>
|
<td class="text-secondary"><?php echo htmlspecialchars($ic['name_ar']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($ic['email'] ?: '-'); ?></td>
|
<td class="text-secondary"><?php echo htmlspecialchars($ic['email'] ?: '-'); ?></td>
|
||||||
<td><?php echo htmlspecialchars($ic['phone'] ?: '-'); ?></td>
|
<td class="text-secondary"><?php echo htmlspecialchars($ic['phone'] ?: '-'); ?></td>
|
||||||
<td><?php echo date('Y-m-d', strtotime($ic['created_at'])); ?></td>
|
<td class="text-end px-4 text-muted"><?php echo date('Y-m-d', strtotime($ic['created_at'])); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; if (empty($insurance_companies)): ?>
|
<?php endforeach; ?>
|
||||||
<tr><td colspan="6" class="text-center py-4 text-muted">No insurance companies found.</td></tr>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
125
includes/pages/laboratory_tests.php
Normal file
125
includes/pages/laboratory_tests.php
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_group = $_GET['group_id'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT t.*, g.name_$lang as group_name
|
||||||
|
FROM laboratory_tests t
|
||||||
|
LEFT JOIN test_groups g ON t.group_id = g.id
|
||||||
|
WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (t.name_en LIKE ? OR t.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_group) {
|
||||||
|
$query .= " AND t.group_id = ?";
|
||||||
|
$params[] = $search_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY t.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$tests = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('tests'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addTestModal">
|
||||||
|
<i class="bi bi-plus-circle me-1"></i> <?php echo __('add_test'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('test_name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<select name="group_id" class="form-select bg-light">
|
||||||
|
<option value=""><?php echo __('test_group'); ?> (<?php echo __('all'); ?>)</option>
|
||||||
|
<?php foreach ($all_test_groups as $group): ?>
|
||||||
|
<option value="<?php echo $group['id']; ?>" <?php echo $search_group == $group['id'] ? 'selected' : ''; ?>>
|
||||||
|
<?php echo htmlspecialchars($group['name']); ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('test_name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('test_group'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('price'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($tests)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-prescription2 display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_tests_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($tests as $test): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $test['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary bg-opacity-10 text-primary p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-list-check fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($test['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($test['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge bg-info bg-opacity-10 text-info border border-info border-opacity-25 px-2 py-1">
|
||||||
|
<?php echo htmlspecialchars($test['group_name'] ?? '-'); ?>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="text-secondary fw-bold"><?php echo number_format($test['price'], 2); ?></td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditTestModal(<?php echo htmlspecialchars(json_encode($test)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteTestModal(<?php echo $test['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
137
includes/pages/nurses.php
Normal file
137
includes/pages/nurses.php
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_tel = $_GET['tel'] ?? '';
|
||||||
|
$search_dept = $_GET['department_id'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT n.*, dept.name_$lang as department_name
|
||||||
|
FROM nurses n
|
||||||
|
LEFT JOIN departments dept ON n.department_id = dept.id
|
||||||
|
WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (n.name_en LIKE ? OR n.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_tel) {
|
||||||
|
$query .= " AND n.tel LIKE ?";
|
||||||
|
$params[] = "%$search_tel%";
|
||||||
|
}
|
||||||
|
if ($search_dept) {
|
||||||
|
$query .= " AND n.department_id = ?";
|
||||||
|
$params[] = $search_dept;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY n.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$nurses = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('nurses'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addNurseModal">
|
||||||
|
<i class="bi bi-person-plus me-1"></i> <?php echo __('add_nurse'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-telephone"></i></span>
|
||||||
|
<input type="text" name="tel" class="form-control bg-light border-start-0" placeholder="<?php echo __('phone'); ?>" value="<?php echo htmlspecialchars($search_tel); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<select name="department_id" class="form-select bg-light">
|
||||||
|
<option value=""><?php echo __('department'); ?> (<?php echo __('all'); ?>)</option>
|
||||||
|
<?php foreach ($all_departments as $dept): ?>
|
||||||
|
<option value="<?php echo $dept['id']; ?>" <?php echo $search_dept == $dept['id'] ? 'selected' : ''; ?>>
|
||||||
|
<?php echo htmlspecialchars($dept['name']); ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('contact_info'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('department'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($nurses)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-person-heart display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_nurses_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($nurses as $nurse): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $nurse['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary bg-opacity-10 text-primary p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-person-vcard fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($nurse['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($nurse['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<small class="text-secondary"><i class="bi bi-telephone me-1"></i><?php echo htmlspecialchars($nurse['tel'] ?: '-'); ?></small>
|
||||||
|
<small class="text-muted"><i class="bi bi-envelope me-1"></i><?php echo htmlspecialchars($nurse['email'] ?: '-'); ?></small>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($nurse['department_name'] ?? '-'); ?></td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditNurseModal(<?php echo htmlspecialchars(json_encode($nurse)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteNurseModal(<?php echo $nurse['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,43 +1,122 @@
|
|||||||
<?php
|
<?php
|
||||||
$patients_sql = "
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
$search_phone = $_GET['phone'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
SELECT p.*, ic.name_$lang as insurance_name
|
SELECT p.*, ic.name_$lang as insurance_name
|
||||||
FROM patients p
|
FROM patients p
|
||||||
LEFT JOIN insurance_companies ic ON p.insurance_company_id = ic.id
|
LEFT JOIN insurance_companies ic ON p.insurance_company_id = ic.id
|
||||||
ORDER BY p.id DESC";
|
WHERE 1=1";
|
||||||
$patients = $db->query($patients_sql)->fetchAll();
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND p.name LIKE ?";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
if ($search_phone) {
|
||||||
|
$query .= " AND p.phone LIKE ?";
|
||||||
|
$params[] = "%$search_phone%";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY p.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$patients = $stmt->fetchAll();
|
||||||
?>
|
?>
|
||||||
<div class="card shadow-sm">
|
|
||||||
<div class="card-header py-3 d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<h5 class="mb-0 fw-bold"><i class="bi bi-people-fill me-2 text-primary"></i> <?php echo __('patients'); ?></h5>
|
<h3 class="fw-bold text-secondary"><?php echo __('patients'); ?></h3>
|
||||||
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#addPatientModal">
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addPatientModal">
|
||||||
<i class="bi bi-plus-lg"></i> <?php echo __('add_patient'); ?>
|
<i class="bi bi-person-plus me-1"></i> <?php echo __('add_patient'); ?>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-telephone"></i></span>
|
||||||
|
<input type="text" name="phone" class="form-control bg-light border-start-0" placeholder="<?php echo __('phone'); ?>" value="<?php echo htmlspecialchars($search_phone); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<thead>
|
<thead class="table-light text-secondary">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo __('name'); ?></th>
|
<th class="px-4 py-3"><?php echo __('name'); ?></th>
|
||||||
<th><?php echo __('age'); ?></th>
|
<th class="py-3"><?php echo __('age'); ?></th>
|
||||||
<th><?php echo __('phone'); ?></th>
|
<th class="py-3"><?php echo __('phone'); ?></th>
|
||||||
<th><?php echo __('dob'); ?></th>
|
<th class="py-3"><?php echo __('insurance'); ?></th>
|
||||||
<th><?php echo __('insurance'); ?></th>
|
<th class="py-3"><?php echo __('policy_number'); ?></th>
|
||||||
<th><?php echo __('policy_number'); ?></th>
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php if (empty($patients)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-people display-4 d-block mb-3"></i>
|
||||||
|
No patients found.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
<?php foreach ($patients as $p): ?>
|
<?php foreach ($patients as $p): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($p['name']); ?></td>
|
<td class="px-4">
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($p['name']); ?></div>
|
||||||
|
<small class="text-muted"><?php echo $p['dob']; ?></small>
|
||||||
|
</td>
|
||||||
<td><?php echo calculate_age($p['dob']); ?></td>
|
<td><?php echo calculate_age($p['dob']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($p['phone']); ?></td>
|
<td><?php echo htmlspecialchars($p['phone']); ?></td>
|
||||||
<td><?php echo $p['dob']; ?></td>
|
<td>
|
||||||
<td><span class="badge <?php echo $p['insurance_name'] ? 'bg-primary' : 'bg-secondary'; ?>"><?php echo $p['insurance_name'] ?: __('not_insured'); ?></span></td>
|
<span class="badge <?php echo $p['insurance_name'] ? 'bg-primary bg-opacity-10 text-primary border border-primary border-opacity-25' : 'bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-25'; ?> px-2 py-1">
|
||||||
<td><?php echo htmlspecialchars($p['policy_number'] ?: '-'); ?></td>
|
<?php echo $p['insurance_name'] ?: __('not_insured'); ?>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($p['policy_number'] ?: '-'); ?></td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick='showEditPatientModal(<?php echo json_encode($p); ?>)'
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-info py-1 px-2 border-end"
|
||||||
|
onclick="showRecordVisitModal(<?php echo $p['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('add_visit'); ?>">
|
||||||
|
<i class="bi bi-clipboard2-plus"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-success py-1 px-2 border-end"
|
||||||
|
onclick="showBillModal(null, <?php echo $p['id']; ?>, '<?php echo addslashes($p['name']); ?>')"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('add_bill'); ?>">
|
||||||
|
<i class="bi bi-receipt"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeletePatientModal(<?php echo $p['id']; ?>, '<?php echo addslashes($p['name']); ?>')"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; if (empty($patients)): ?>
|
<?php endforeach; ?>
|
||||||
<tr><td colspan="6" class="text-center py-4 text-muted">No patients found.</td></tr>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
105
includes/pages/poisons.php
Normal file
105
includes/pages/poisons.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
|
||||||
|
$query = "SELECT * FROM poisons WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (name_en LIKE ? OR name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$poisons = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('poisons'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addPoisonModal">
|
||||||
|
<i class="bi bi-plus-circle me-1"></i> <?php echo __('add_poison'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('description'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($poisons)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-radioactive display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_poisons_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($poisons as $poison): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $poison['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-danger bg-opacity-10 text-danger p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-virus fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($poison['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($poison['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="text-secondary" style="max-width: 400px;">
|
||||||
|
<div class="text-truncate fw-medium"><?php echo htmlspecialchars($poison['description_'.$lang] ?: '-'); ?></div>
|
||||||
|
<small class="text-muted text-truncate d-block"><?php echo htmlspecialchars($poison['description_'.($lang == 'en' ? 'ar' : 'en')] ?: '-'); ?></small>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditPoisonModal(<?php echo htmlspecialchars(json_encode($poison)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeletePoisonModal(<?php echo $poison['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
107
includes/pages/test_groups.php
Normal file
107
includes/pages/test_groups.php
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
<?php
|
||||||
|
$search_name = $_GET['name'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
|
SELECT g.*, (SELECT COUNT(*) FROM laboratory_tests WHERE group_id = g.id) as tests_count
|
||||||
|
FROM test_groups g
|
||||||
|
WHERE 1=1";
|
||||||
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_name) {
|
||||||
|
$query .= " AND (g.name_en LIKE ? OR g.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
$params[] = "%$search_name%";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY g.id DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$groups = $stmt->fetchAll();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h3 class="fw-bold text-secondary"><?php echo __('test_groups'); ?></h3>
|
||||||
|
<button class="btn btn-primary shadow-sm" data-bs-toggle="modal" data-bs-target="#addTestGroupModal">
|
||||||
|
<i class="bi bi-collection me-1"></i> <?php echo __('add_test_group'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="name" class="form-control bg-light border-start-0" placeholder="<?php echo __('name'); ?>" value="<?php echo htmlspecialchars($search_name); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light text-secondary">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('name'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('tests'); ?></th>
|
||||||
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php if (empty($groups)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-collection display-4 d-block mb-3"></i>
|
||||||
|
<?php echo __('no_test_groups_found'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php foreach ($groups as $group): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 fw-medium text-secondary"><?php echo $group['id']; ?></td>
|
||||||
|
<td>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="bg-primary bg-opacity-10 text-primary p-2 rounded-circle me-3">
|
||||||
|
<i class="bi bi-collection fs-5"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="fw-semibold text-dark"><?php echo htmlspecialchars($group['name_'.$lang]); ?></div>
|
||||||
|
<small class="text-muted"><?php echo htmlspecialchars($group['name_'.($lang == 'en' ? 'ar' : 'en')]); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-25 px-2 py-1">
|
||||||
|
<?php echo $group['tests_count']; ?> <?php echo __('tests'); ?>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="text-end px-4">
|
||||||
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
|
onclick="showEditTestGroupModal(<?php echo htmlspecialchars(json_encode($group)); ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
|
onclick="showDeleteTestGroupModal(<?php echo $group['id']; ?>)"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
|
<i class="bi bi-trash3"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,51 +1,121 @@
|
|||||||
<?php
|
<?php
|
||||||
$visits_sql = "
|
$search_patient = $_GET['patient'] ?? '';
|
||||||
|
$search_doctor = $_GET['doctor'] ?? '';
|
||||||
|
$search_date = $_GET['date'] ?? '';
|
||||||
|
|
||||||
|
$query = "
|
||||||
SELECT v.*, p.name as patient_name, d.name_$lang as doctor_name
|
SELECT v.*, p.name as patient_name, d.name_$lang as doctor_name
|
||||||
FROM visits v
|
FROM visits v
|
||||||
JOIN patients p ON v.patient_id = p.id
|
JOIN patients p ON v.patient_id = p.id
|
||||||
JOIN doctors d ON v.doctor_id = d.id
|
JOIN doctors d ON v.doctor_id = d.id
|
||||||
ORDER BY v.visit_date DESC";
|
WHERE 1=1";
|
||||||
$visits = $db->query($visits_sql)->fetchAll();
|
$params = [];
|
||||||
|
|
||||||
|
if ($search_patient) {
|
||||||
|
$query .= " AND p.name LIKE ?";
|
||||||
|
$params[] = "%$search_patient%";
|
||||||
|
}
|
||||||
|
if ($search_doctor) {
|
||||||
|
$query .= " AND (d.name_en LIKE ? OR d.name_ar LIKE ?)";
|
||||||
|
$params[] = "%$search_doctor%";
|
||||||
|
$params[] = "%$search_doctor%";
|
||||||
|
}
|
||||||
|
if ($search_date) {
|
||||||
|
$query .= " AND DATE(v.visit_date) = ?";
|
||||||
|
$params[] = $search_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query .= " ORDER BY v.visit_date DESC";
|
||||||
|
$stmt = $db->prepare($query);
|
||||||
|
$stmt->execute($params);
|
||||||
|
$visits = $stmt->fetchAll();
|
||||||
?>
|
?>
|
||||||
<div class="card shadow-sm">
|
|
||||||
<div class="card-header py-3 d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<h5 class="mb-0 fw-bold"><i class="bi bi-clipboard2-pulse me-2 text-primary"></i> <?php echo __('visits'); ?></h5>
|
<h3 class="fw-bold text-secondary"><?php echo __('visits'); ?></h3>
|
||||||
<button class="btn btn-info btn-sm text-white" data-bs-toggle="modal" data-bs-target="#recordVisitModal">
|
<button class="btn btn-info shadow-sm text-white" data-bs-toggle="modal" data-bs-target="#recordVisitModal">
|
||||||
<i class="bi bi-plus-lg"></i> <?php echo __('add_visit'); ?>
|
<i class="bi bi-plus-lg me-1"></i> <?php echo __('add_visit'); ?>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<div class="card shadow-sm border-0 mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form method="GET" action="" class="row g-3">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-search"></i></span>
|
||||||
|
<input type="text" name="patient" class="form-control bg-light border-start-0" placeholder="<?php echo __('patient'); ?>" value="<?php echo htmlspecialchars($search_patient); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-person-badge"></i></span>
|
||||||
|
<input type="text" name="doctor" class="form-control bg-light border-start-0" placeholder="<?php echo __('doctor'); ?>" value="<?php echo htmlspecialchars($search_doctor); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text bg-light border-end-0 text-muted"><i class="bi bi-calendar-event"></i></span>
|
||||||
|
<input type="date" name="date" class="form-control bg-light border-start-0" value="<?php echo htmlspecialchars($search_date); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<button type="submit" class="btn btn-secondary w-100"><?php echo __('search'); ?></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm border-0">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<thead>
|
<thead class="table-light text-secondary">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo __('date'); ?></th>
|
<th class="px-4 py-3"><?php echo __('date'); ?></th>
|
||||||
<th><?php echo __('patient'); ?></th>
|
<th class="py-3"><?php echo __('patient'); ?></th>
|
||||||
<th><?php echo __('doctor'); ?></th>
|
<th class="py-3"><?php echo __('doctor'); ?></th>
|
||||||
<th><?php echo __('diagnosis'); ?></th>
|
<th class="py-3"><?php echo __('diagnosis'); ?></th>
|
||||||
<th><?php echo __('actions'); ?></th>
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php if (empty($visits)): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-center py-5 text-muted">
|
||||||
|
<i class="bi bi-clipboard2-pulse display-4 d-block mb-3"></i>
|
||||||
|
No visits found.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else: ?>
|
||||||
<?php foreach ($visits as $v): ?>
|
<?php foreach ($visits as $v): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo date('Y-m-d H:i', strtotime($v['visit_date'])); ?></td>
|
<td class="px-4 text-secondary"><?php echo date('Y-m-d H:i', strtotime($v['visit_date'])); ?></td>
|
||||||
<td><?php echo htmlspecialchars($v['patient_name']); ?></td>
|
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($v['patient_name']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($v['doctor_name']); ?></td>
|
<td class="text-secondary"><?php echo htmlspecialchars($v['doctor_name']); ?></td>
|
||||||
<td><small class="text-truncate d-inline-block" style="max-width: 200px;"><?php echo htmlspecialchars($v['diagnosis']); ?></small></td>
|
<td><small class="text-truncate d-inline-block text-muted" style="max-width: 200px;"><?php echo htmlspecialchars($v['diagnosis']); ?></small></td>
|
||||||
<td>
|
<td class="text-end px-4">
|
||||||
<div class="btn-group">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-outline-primary btn-sm" onclick='showReportModal(<?php echo $v["id"]; ?>)'>
|
<button class="btn btn-link text-warning py-1 px-2 border-end"
|
||||||
<i class="bi bi-file-earmark-plus"></i> <?php echo __('new_report'); ?>
|
onclick='showEditVisitModal(<?php echo json_encode($v); ?>)'
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline-success btn-sm" onclick='showBillModal(<?php echo $v["id"]; ?>, <?php echo $v["patient_id"]; ?>, "<?php echo addslashes($v["patient_name"]); ?>")'>
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
<i class="bi bi-receipt"></i> <?php echo __('create_bill'); ?>
|
onclick='showReportModal(<?php echo $v["id"]; ?>)'
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('new_report'); ?>">
|
||||||
|
<i class="bi bi-file-earmark-plus"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-link text-success py-1 px-2"
|
||||||
|
onclick='showBillModal(<?php echo $v["id"]; ?>, <?php echo $v["patient_id"]; ?>, "<?php echo addslashes($v["patient_name"]); ?>")'
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('create_bill'); ?>">
|
||||||
|
<i class="bi bi-receipt"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; if (empty($visits)): ?>
|
<?php endforeach; ?>
|
||||||
<tr><td colspan="5" class="text-center py-4 text-muted">No visits recorded yet.</td></tr>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
133
init_db.php
133
init_db.php
@ -19,6 +19,19 @@ try {
|
|||||||
specialization_en VARCHAR(255),
|
specialization_en VARCHAR(255),
|
||||||
specialization_ar VARCHAR(255),
|
specialization_ar VARCHAR(255),
|
||||||
department_id INT,
|
department_id INT,
|
||||||
|
tel VARCHAR(20),
|
||||||
|
email VARCHAR(100),
|
||||||
|
FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE SET NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS nurses (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name_en VARCHAR(255) NOT NULL,
|
||||||
|
name_ar VARCHAR(255) NOT NULL,
|
||||||
|
department_id INT,
|
||||||
|
tel VARCHAR(20),
|
||||||
|
email VARCHAR(100),
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE SET NULL
|
FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE SET NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
@ -107,6 +120,46 @@ try {
|
|||||||
amount DECIMAL(10, 2),
|
amount DECIMAL(10, 2),
|
||||||
FOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE CASCADE
|
FOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS employees (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name_en VARCHAR(255) NOT NULL,
|
||||||
|
name_ar VARCHAR(255) NOT NULL,
|
||||||
|
dob DATE,
|
||||||
|
mobile VARCHAR(50),
|
||||||
|
email VARCHAR(100),
|
||||||
|
department_id INT,
|
||||||
|
passion_en TEXT,
|
||||||
|
passion_ar TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE SET NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS poisons (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name_en VARCHAR(255) NOT NULL,
|
||||||
|
name_ar VARCHAR(255) NOT NULL,
|
||||||
|
description_en TEXT,
|
||||||
|
description_ar TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS test_groups (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
name_en VARCHAR(255) NOT NULL,
|
||||||
|
name_ar VARCHAR(255) NOT NULL,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS laboratory_tests (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
group_id INT,
|
||||||
|
name_en VARCHAR(255) NOT NULL,
|
||||||
|
name_ar VARCHAR(255) NOT NULL,
|
||||||
|
price DECIMAL(10, 2) NOT NULL DEFAULT 0.00,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
FOREIGN KEY (group_id) REFERENCES test_groups(id) ON DELETE SET NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
";
|
";
|
||||||
|
|
||||||
$db->exec($sql);
|
$db->exec($sql);
|
||||||
@ -128,6 +181,11 @@ try {
|
|||||||
$db->exec("ALTER TABLE bills ADD COLUMN IF NOT EXISTS patient_payable DECIMAL(10, 2) DEFAULT 0.00");
|
$db->exec("ALTER TABLE bills ADD COLUMN IF NOT EXISTS patient_payable DECIMAL(10, 2) DEFAULT 0.00");
|
||||||
} catch (Exception $e) {}
|
} catch (Exception $e) {}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$db->exec("ALTER TABLE doctors ADD COLUMN IF NOT EXISTS tel VARCHAR(20)");
|
||||||
|
$db->exec("ALTER TABLE doctors ADD COLUMN IF NOT EXISTS email VARCHAR(100)");
|
||||||
|
} catch (Exception $e) {}
|
||||||
|
|
||||||
// Seed departments
|
// Seed departments
|
||||||
$stmt = $db->query("SELECT COUNT(*) FROM departments");
|
$stmt = $db->query("SELECT COUNT(*) FROM departments");
|
||||||
if ($stmt->fetchColumn() == 0) {
|
if ($stmt->fetchColumn() == 0) {
|
||||||
@ -156,6 +214,81 @@ try {
|
|||||||
('MedGulf', 'ميدغلف', '8004414444')");
|
('MedGulf', 'ميدغلف', '8004414444')");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Seed test groups (Clear and re-seed if requested or just append if empty)
|
||||||
|
$stmt = $db->query("SELECT COUNT(*) FROM test_groups");
|
||||||
|
if ($stmt->fetchColumn() <= 4) { // If only initial seed exists, clear and re-seed with full list
|
||||||
|
$db->exec("SET FOREIGN_KEY_CHECKS = 0");
|
||||||
|
$db->exec("TRUNCATE TABLE laboratory_tests");
|
||||||
|
$db->exec("TRUNCATE TABLE test_groups");
|
||||||
|
$db->exec("SET FOREIGN_KEY_CHECKS = 1");
|
||||||
|
|
||||||
|
$db->exec("INSERT INTO test_groups (id, name_en, name_ar) VALUES
|
||||||
|
(1, 'Hematology', 'علم الدم'),
|
||||||
|
(2, 'Biochemistry', 'الكيمياء الحيوية'),
|
||||||
|
(3, 'Microbiology', 'علم الأحياء الدقيقة'),
|
||||||
|
(4, 'Serology', 'علم المصل'),
|
||||||
|
(5, 'Immunology', 'علم المناعة'),
|
||||||
|
(6, 'Hormones', 'الهرمونات'),
|
||||||
|
(7, 'Coagulation', 'التخثر'),
|
||||||
|
(8, 'Electrolytes', 'الأملاح والمعادن'),
|
||||||
|
(9, 'Urine & Stool', 'البول والبراز'),
|
||||||
|
(10, 'Cardiac Markers', 'واصمات القلب')");
|
||||||
|
|
||||||
|
$db->exec("INSERT INTO laboratory_tests (group_id, name_en, name_ar, price) VALUES
|
||||||
|
(1, 'Complete Blood Count (CBC)', 'عد دم كامل', 150.00),
|
||||||
|
(1, 'ESR', 'سرعة الترسيب', 40.00),
|
||||||
|
(1, 'Reticulocyte count', 'عد الخلايا الشبكية', 60.00),
|
||||||
|
(1, 'Blood film', 'فيلم الدم', 80.00),
|
||||||
|
|
||||||
|
(2, 'Fast Blood Sugar (FBS)', 'سكر الدم الصائم', 50.00),
|
||||||
|
(2, 'HbA1c', 'السكر التراكمي', 120.00),
|
||||||
|
(2, 'Lipid Profile', 'فحص الدهون', 200.00),
|
||||||
|
(2, 'Liver Function Test (LFT)', 'وظائف الكبد', 180.00),
|
||||||
|
(2, 'Kidney Function Test (KFT)', 'وظائف الكلى', 150.00),
|
||||||
|
(2, 'Uric Acid', 'حمض اليوريك', 60.00),
|
||||||
|
|
||||||
|
(3, 'Urine Culture', 'مزرعة البول', 250.00),
|
||||||
|
(3, 'Stool Culture', 'مزرعة البراز', 250.00),
|
||||||
|
(3, 'Blood Culture', 'مزرعة الدم', 450.00),
|
||||||
|
(3, 'Throat Swab', 'مسحة الحلق', 200.00),
|
||||||
|
|
||||||
|
(4, 'CRP (C-Reactive Protein)', 'البروتين التفاعلي C', 90.00),
|
||||||
|
(4, 'RF (Rheumatoid Factor)', 'عامل الروماتويد', 100.00),
|
||||||
|
(4, 'ASO Titre', 'فحص أجسام مضادة للستربتوليسين', 110.00),
|
||||||
|
(4, 'HBsAg', 'التهاب الكبد ب', 120.00),
|
||||||
|
(4, 'HIV I & II', 'فيروس نقص المناعة البشرية', 180.00),
|
||||||
|
(4, 'HCV Antibodies', 'فيروس التهاب الكبد ج', 150.00),
|
||||||
|
|
||||||
|
(5, 'ANA', 'الأجسام المضادة للنواة', 220.00),
|
||||||
|
(5, 'Anti-dsDNA', 'الأجسام المضادة للحمض النووي', 280.00),
|
||||||
|
(5, 'Total IgE', 'الغلوبولين المناعي الكلي E', 190.00),
|
||||||
|
|
||||||
|
(6, 'TSH', 'الهرمون المنبه للدرقية', 130.00),
|
||||||
|
(6, 'Free T3', 'T3 الحر', 130.00),
|
||||||
|
(6, 'Free T4', 'T4 الحر', 130.00),
|
||||||
|
(6, 'Prolactin', 'هرمون الحليب', 150.00),
|
||||||
|
(6, 'Testosterone', 'هرمون التستوستيرون', 180.00),
|
||||||
|
(6, 'Vitamin D', 'فيتامين د', 350.00),
|
||||||
|
|
||||||
|
(7, 'PT (Prothrombin Time)', 'وقت البروثرومبين', 100.00),
|
||||||
|
(7, 'PTT (Partial Thromboplastin Time)', 'وقت الثرومبوبلاستين الجزئي', 120.00),
|
||||||
|
(7, 'INR', 'النسبة المعيارية الدولية', 100.00),
|
||||||
|
(7, 'D-Dimer', 'دي دايمر', 300.00),
|
||||||
|
|
||||||
|
(8, 'Sodium (Na)', 'الصوديوم', 70.00),
|
||||||
|
(8, 'Potassium (K)', 'البوتاسيوم', 70.00),
|
||||||
|
(8, 'Chloride (Cl)', 'الكلوريد', 70.00),
|
||||||
|
(8, 'Calcium (Ca)', 'الكالسيوم', 80.00),
|
||||||
|
(8, 'Magnesium (Mg)', 'المغنيسيوم', 90.00),
|
||||||
|
|
||||||
|
(9, 'Urine Analysis', 'تحليل البول', 50.00),
|
||||||
|
(9, 'Stool Analysis', 'تحليل البراز', 60.00),
|
||||||
|
(9, 'Occult Blood in Stool', 'الدم الخفي في البراز', 80.00),
|
||||||
|
|
||||||
|
(10, 'Troponin I', 'تروبونين I', 250.00),
|
||||||
|
(10, 'CK-MB', 'انزيم القلب CK-MB', 180.00)");
|
||||||
|
}
|
||||||
|
|
||||||
echo "Database setup completed successfully.";
|
echo "Database setup completed successfully.";
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
die("Database setup failed: " . $e->getMessage());
|
die("Database setup failed: " . $e->getMessage());
|
||||||
|
|||||||
9
laboratory_tests.php
Normal file
9
laboratory_tests.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
$section = 'laboratory_tests';
|
||||||
|
require_once 'includes/layout/header.php';
|
||||||
|
require_once 'includes/common_data.php';
|
||||||
|
require_once 'includes/actions.php';
|
||||||
|
require_once 'includes/pages/laboratory_tests.php';
|
||||||
|
require_once 'includes/layout/footer.php';
|
||||||
|
?>
|
||||||
128
lang.php
128
lang.php
@ -59,6 +59,8 @@ $translations = [
|
|||||||
'billing' => 'Billing',
|
'billing' => 'Billing',
|
||||||
'view_visit' => 'View Visit',
|
'view_visit' => 'View Visit',
|
||||||
'add_visit' => 'Record Visit',
|
'add_visit' => 'Record Visit',
|
||||||
|
'edit_visit' => 'Edit Visit',
|
||||||
|
'update_visit' => 'Update Visit',
|
||||||
'appointment' => 'Appointment',
|
'appointment' => 'Appointment',
|
||||||
'visit_recorded' => 'Visit recorded successfully',
|
'visit_recorded' => 'Visit recorded successfully',
|
||||||
'report_created' => 'Provisional report created successfully',
|
'report_created' => 'Provisional report created successfully',
|
||||||
@ -89,7 +91,67 @@ $translations = [
|
|||||||
'patient_payable' => 'Patient Payable',
|
'patient_payable' => 'Patient Payable',
|
||||||
'successfully' => 'successfully',
|
'successfully' => 'successfully',
|
||||||
'optional' => 'Optional',
|
'optional' => 'Optional',
|
||||||
'email' => 'Email'
|
'email' => 'Email',
|
||||||
|
'edit' => 'Edit',
|
||||||
|
'delete' => 'Delete',
|
||||||
|
'add_bill' => 'Add Bill',
|
||||||
|
'update_patient' => 'Update Patient',
|
||||||
|
'delete_patient' => 'Delete Patient',
|
||||||
|
'confirm_delete' => 'Are you sure you want to delete',
|
||||||
|
'add_doctor' => 'Add Doctor',
|
||||||
|
'add_department' => 'Add Department',
|
||||||
|
'name_en' => 'Name (English)',
|
||||||
|
'name_ar' => 'Name (Arabic)',
|
||||||
|
'specialization_en' => 'Specialization (English)',
|
||||||
|
'specialization_ar' => 'Specialization (Arabic)',
|
||||||
|
'update_doctor' => 'Update Doctor',
|
||||||
|
'delete_doctor' => 'Delete Doctor',
|
||||||
|
'update_department' => 'Update Department',
|
||||||
|
'delete_department' => 'Delete Department',
|
||||||
|
'no_doctors_found' => 'No doctors found',
|
||||||
|
'no_departments_found' => 'No departments found',
|
||||||
|
'all' => 'All',
|
||||||
|
'nurses' => 'Nurses',
|
||||||
|
'add_nurse' => 'Add Nurse',
|
||||||
|
'edit_nurse' => 'Edit Nurse',
|
||||||
|
'update_nurse' => 'Update Nurse',
|
||||||
|
'delete_nurse' => 'Delete Nurse',
|
||||||
|
'no_nurses_found' => 'No nurses found',
|
||||||
|
'settings' => 'Settings',
|
||||||
|
'employees' => 'Employees',
|
||||||
|
'poisons' => 'Poisons',
|
||||||
|
'mobile' => 'Mobile',
|
||||||
|
'passion' => 'Passion',
|
||||||
|
'passion_en' => 'Passion (English)',
|
||||||
|
'passion_ar' => 'Passion (Arabic)',
|
||||||
|
'add_employee' => 'Add Employee',
|
||||||
|
'edit_employee' => 'Edit Employee',
|
||||||
|
'update_employee' => 'Update Employee',
|
||||||
|
'delete_employee' => 'Delete Employee',
|
||||||
|
'no_employees_found' => 'No employees found',
|
||||||
|
'add_poison' => 'Add Poison',
|
||||||
|
'edit_poison' => 'Edit Poison',
|
||||||
|
'update_poison' => 'Update Poison',
|
||||||
|
'delete_poison' => 'Delete Poison',
|
||||||
|
'no_poisons_found' => 'No poisons found',
|
||||||
|
'description_en' => 'Description (English)',
|
||||||
|
'description_ar' => 'Description (Arabic)',
|
||||||
|
'laboratory' => 'Laboratory',
|
||||||
|
'tests' => 'Tests',
|
||||||
|
'test_groups' => 'Test Groups',
|
||||||
|
'test_name' => 'Test Name',
|
||||||
|
'test_group' => 'Test Group',
|
||||||
|
'price' => 'Price',
|
||||||
|
'add_test' => 'Add Test',
|
||||||
|
'edit_test' => 'Edit Test',
|
||||||
|
'update_test' => 'Update Test',
|
||||||
|
'delete_test' => 'Delete Test',
|
||||||
|
'no_tests_found' => 'No tests found',
|
||||||
|
'add_test_group' => 'Add Test Group',
|
||||||
|
'edit_test_group' => 'Edit Test Group',
|
||||||
|
'update_test_group' => 'Update Test Group',
|
||||||
|
'delete_test_group' => 'Delete Test Group',
|
||||||
|
'no_test_groups_found' => 'No test groups found'
|
||||||
],
|
],
|
||||||
'ar' => [
|
'ar' => [
|
||||||
'dashboard' => 'لوحة القيادة',
|
'dashboard' => 'لوحة القيادة',
|
||||||
@ -150,6 +212,8 @@ $translations = [
|
|||||||
'billing' => 'الفواتير',
|
'billing' => 'الفواتير',
|
||||||
'view_visit' => 'عرض الزيارة',
|
'view_visit' => 'عرض الزيارة',
|
||||||
'add_visit' => 'تسجيل زيارة',
|
'add_visit' => 'تسجيل زيارة',
|
||||||
|
'edit_visit' => 'تعديل زيارة',
|
||||||
|
'update_visit' => 'تحديث الزيارة',
|
||||||
'appointment' => 'الموعد',
|
'appointment' => 'الموعد',
|
||||||
'visit_recorded' => 'تم تسجيل الزيارة بنجاح',
|
'visit_recorded' => 'تم تسجيل الزيارة بنجاح',
|
||||||
'report_created' => 'تم إنشاء التقرير المؤقت بنجاح',
|
'report_created' => 'تم إنشاء التقرير المؤقت بنجاح',
|
||||||
@ -180,6 +244,66 @@ $translations = [
|
|||||||
'patient_payable' => 'مبلغ المريض',
|
'patient_payable' => 'مبلغ المريض',
|
||||||
'successfully' => 'بنجاح',
|
'successfully' => 'بنجاح',
|
||||||
'optional' => 'اختياري',
|
'optional' => 'اختياري',
|
||||||
'email' => 'البريد الإلكتروني'
|
'email' => 'البريد الإلكتروني',
|
||||||
|
'edit' => 'تعديل',
|
||||||
|
'delete' => 'حذف',
|
||||||
|
'add_bill' => 'إضافة فاتورة',
|
||||||
|
'update_patient' => 'تحديث بيانات المريض',
|
||||||
|
'delete_patient' => 'حذف مريض',
|
||||||
|
'confirm_delete' => 'هل أنت متأكد أنك تريد حذف',
|
||||||
|
'add_doctor' => 'إضافة طبيب',
|
||||||
|
'add_department' => 'إضافة قسم',
|
||||||
|
'name_en' => 'الاسم (إنجليزي)',
|
||||||
|
'name_ar' => 'الاسم (عربي)',
|
||||||
|
'specialization_en' => 'التخصص (إنجليزي)',
|
||||||
|
'specialization_ar' => 'التخصص (عربي)',
|
||||||
|
'update_doctor' => 'تحديث بيانات الطبيب',
|
||||||
|
'delete_doctor' => 'حذف طبيب',
|
||||||
|
'update_department' => 'تحديث القسم',
|
||||||
|
'delete_department' => 'حذف قسم',
|
||||||
|
'no_doctors_found' => 'لم يتم العثور على أطباء',
|
||||||
|
'no_departments_found' => 'لم يتم العثور على أقسام',
|
||||||
|
'all' => 'الكل',
|
||||||
|
'nurses' => 'الممرضات',
|
||||||
|
'add_nurse' => 'إضافة ممرضة',
|
||||||
|
'edit_nurse' => 'تعديل ممرضة',
|
||||||
|
'update_nurse' => 'تحديث بيانات الممرضة',
|
||||||
|
'delete_nurse' => 'حذف ممرضة',
|
||||||
|
'no_nurses_found' => 'لم يتم العثور على ممرضات',
|
||||||
|
'settings' => 'الإعدادات',
|
||||||
|
'employees' => 'الموظفون',
|
||||||
|
'poisons' => 'السموم',
|
||||||
|
'mobile' => 'الجوال',
|
||||||
|
'passion' => 'الشغف',
|
||||||
|
'passion_en' => 'الشغف (إنجليزي)',
|
||||||
|
'passion_ar' => 'الشغف (عربي)',
|
||||||
|
'add_employee' => 'إضافة موظف',
|
||||||
|
'edit_employee' => 'تعديل موظف',
|
||||||
|
'update_employee' => 'تحديث بيانات الموظف',
|
||||||
|
'delete_employee' => 'حذف موظف',
|
||||||
|
'no_employees_found' => 'لم يتم العثور على موظفين',
|
||||||
|
'add_poison' => 'إضافة سم',
|
||||||
|
'edit_poison' => 'تعديل سم',
|
||||||
|
'update_poison' => 'تحديث بيانات السم',
|
||||||
|
'delete_poison' => 'حذف سم',
|
||||||
|
'no_poisons_found' => 'لم يتم العثور على سموم',
|
||||||
|
'description_en' => 'الوصف (إنجليزي)',
|
||||||
|
'description_ar' => 'الوصف (عربي)',
|
||||||
|
'laboratory' => 'المختبر',
|
||||||
|
'tests' => 'الفحوصات',
|
||||||
|
'test_groups' => 'مجموعات الفحوصات',
|
||||||
|
'test_name' => 'اسم الفحص',
|
||||||
|
'test_group' => 'مجموعة الفحص',
|
||||||
|
'price' => 'السعر',
|
||||||
|
'add_test' => 'إضافة فحص',
|
||||||
|
'edit_test' => 'تعديل فحص',
|
||||||
|
'update_test' => 'تحديث بيانات الفحص',
|
||||||
|
'delete_test' => 'حذف فحص',
|
||||||
|
'no_tests_found' => 'لم يتم العثور على فحوصات',
|
||||||
|
'add_test_group' => 'إضافة مجموعة فحوصات',
|
||||||
|
'edit_test_group' => 'تعديل مجموعة فحوصات',
|
||||||
|
'update_test_group' => 'تحديث بيانات المجموعة',
|
||||||
|
'delete_test_group' => 'حذف مجموعة فحوصات',
|
||||||
|
'no_test_groups_found' => 'لم يتم العثور على مجموعات فحوصات'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
8
nurses.php
Normal file
8
nurses.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
// nurses.php
|
||||||
|
session_start();
|
||||||
|
$section = 'nurses';
|
||||||
|
require_once 'includes/layout/header.php';
|
||||||
|
require_once 'includes/actions.php';
|
||||||
|
require_once 'includes/pages/nurses.php';
|
||||||
|
require_once 'includes/layout/footer.php';
|
||||||
23
poisons.php
Normal file
23
poisons.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
if (!isset($_SESSION['lang'])) {
|
||||||
|
$_SESSION['lang'] = 'en';
|
||||||
|
}
|
||||||
|
if (isset($_GET['lang'])) {
|
||||||
|
$_SESSION['lang'] = $_GET['lang'] === 'ar' ? 'ar' : 'en';
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'db/config.php';
|
||||||
|
require_once 'lang.php';
|
||||||
|
require_once 'helpers.php';
|
||||||
|
|
||||||
|
$db = db();
|
||||||
|
$lang = $_SESSION['lang'];
|
||||||
|
$section = 'poisons';
|
||||||
|
|
||||||
|
require_once 'includes/actions.php';
|
||||||
|
require_once 'includes/common_data.php';
|
||||||
|
|
||||||
|
include 'includes/layout/header.php';
|
||||||
|
include 'includes/pages/poisons.php';
|
||||||
|
include 'includes/layout/footer.php';
|
||||||
9
test_groups.php
Normal file
9
test_groups.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
$section = 'test_groups';
|
||||||
|
require_once 'includes/layout/header.php';
|
||||||
|
require_once 'includes/common_data.php';
|
||||||
|
require_once 'includes/actions.php';
|
||||||
|
require_once 'includes/pages/test_groups.php';
|
||||||
|
require_once 'includes/layout/footer.php';
|
||||||
|
?>
|
||||||
Loading…
x
Reference in New Issue
Block a user