diff --git a/api/cities.php b/api/cities.php new file mode 100644 index 0000000..0d02c92 --- /dev/null +++ b/api/cities.php @@ -0,0 +1,36 @@ +prepare("INSERT INTO cities (name_en, name_ar) VALUES (?, ?)"); + $stmt->execute([$name_en, $name_ar]); + $id = $db->lastInsertId(); + echo json_encode(['success' => true, 'id' => $id, 'name_en' => $name_en, 'name_ar' => $name_ar]); + } catch (Exception $e) { + echo json_encode(['success' => false, 'error' => $e->getMessage()]); + } + } else { + echo json_encode(['success' => false, 'error' => 'Missing fields']); + } + } else { + echo json_encode(['success' => false, 'error' => 'Invalid action']); + } + exit; +} + +echo json_encode(['success' => false, 'error' => 'Invalid request method']); diff --git a/db/migrations/20260306_create_services_module.sql b/db/migrations/20260306_create_services_module.sql new file mode 100644 index 0000000..7bc346c --- /dev/null +++ b/db/migrations/20260306_create_services_module.sql @@ -0,0 +1,11 @@ +CREATE TABLE IF NOT EXISTS services ( + id INT AUTO_INCREMENT PRIMARY KEY, + name_en VARCHAR(255) NOT NULL, + name_ar VARCHAR(255) NOT NULL, + department_id INT NOT NULL, + price DECIMAL(10, 2) NOT NULL DEFAULT 0.00, + is_active TINYINT(1) NOT NULL DEFAULT 1, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + FOREIGN KEY (department_id) REFERENCES departments(id) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/includes/layout/footer.php b/includes/layout/footer.php index e8bfc8f..dfba574 100644 --- a/includes/layout/footer.php +++ b/includes/layout/footer.php @@ -58,15 +58,21 @@
- - - -
+ +
+
+ +
+ +
+
@@ -156,15 +162,21 @@
- - - -
+ +
+
+ +
+ +
+
@@ -3282,6 +3294,109 @@ $drug_groups_js = $db->query("SELECT * FROM drugs_groups ORDER BY name_$lang")-> setupAgeCalculation('add_patient_age', 'add_patient_dob'); setupAgeCalculation('edit_patient_age', 'edit_patient_dob'); + + + + + + + \ No newline at end of file diff --git a/includes/layout/header.php b/includes/layout/header.php index 6e751c9..a7748f9 100644 --- a/includes/layout/header.php +++ b/includes/layout/header.php @@ -146,6 +146,7 @@ $site_favicon = !empty($site_settings['company_favicon']) ? $site_settings['comp + diff --git a/includes/pages/patients.php b/includes/pages/patients.php index deb5e7f..6211bd2 100644 --- a/includes/pages/patients.php +++ b/includes/pages/patients.php @@ -48,7 +48,10 @@ if (isset($_GET['ajax_search'])) { - + + + +
@@ -62,7 +65,11 @@ if (isset($_GET['ajax_search'])) {
-