+
+
\ No newline at end of file
diff --git a/includes/pages/test_groups.php b/includes/pages/test_groups.php
index d92b600..4aa1fb0 100644
--- a/includes/pages/test_groups.php
+++ b/includes/pages/test_groups.php
@@ -1,19 +1,131 @@
query($query);
+// Pagination Logic
+$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
+$limit = 10;
+$offset = ($page - 1) * $limit;
+$search = isset($_GET['search']) ? trim($_GET['search']) : '';
+
+$where_clause = "";
+$params = [];
+
+if ($search) {
+ $where_clause = "WHERE name_en LIKE ? OR name_ar LIKE ?";
+ $params[] = "%$search%";
+ $params[] = "%$search%";
+}
+
+// Total count
+$count_query = "SELECT COUNT(*) FROM test_groups $where_clause";
+$stmt = $db->prepare($count_query);
+$stmt->execute($params);
+$total_records = $stmt->fetchColumn();
+$total_pages = ceil($total_records / $limit);
+
+// Fetch data
+$query = "SELECT * FROM test_groups $where_clause ORDER BY id DESC LIMIT $limit OFFSET $offset";
+$stmt = $db->prepare($query);
+$stmt->execute($params);
$groups = $stmt->fetchAll();
+
+// Handle AJAX Request
+if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
+ ob_start();
+?>
+
+
+
+
#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1): ?>
+
+
+
+
+
+
+
+ $html]);
+ exit;
+}
?>
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
@@ -28,7 +140,7 @@ $groups = $stmt->fetchAll();
- No groups found.
+
@@ -56,6 +168,145 @@ $groups = $stmt->fetchAll();
+
+
+ 1): ?>
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/includes/pages/xray_groups.php b/includes/pages/xray_groups.php
index 96d1a9e..df949f7 100644
--- a/includes/pages/xray_groups.php
+++ b/includes/pages/xray_groups.php
@@ -1,19 +1,131 @@
query($query);
+// Pagination Logic
+$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
+$limit = 10;
+$offset = ($page - 1) * $limit;
+$search = isset($_GET['search']) ? trim($_GET['search']) : '';
+
+$where_clause = "";
+$params = [];
+
+if ($search) {
+ $where_clause = "WHERE name_en LIKE ? OR name_ar LIKE ?";
+ $params[] = "%$search%";
+ $params[] = "%$search%";
+}
+
+// Total count
+$count_query = "SELECT COUNT(*) FROM xray_groups $where_clause";
+$stmt = $db->prepare($count_query);
+$stmt->execute($params);
+$total_records = $stmt->fetchColumn();
+$total_pages = ceil($total_records / $limit);
+
+// Fetch data
+$query = "SELECT * FROM xray_groups $where_clause ORDER BY id DESC LIMIT $limit OFFSET $offset";
+$stmt = $db->prepare($query);
+$stmt->execute($params);
$groups = $stmt->fetchAll();
+
+// Handle AJAX Request
+if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
+ ob_start();
+?>
+
+
+
+
#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1): ?>
+
+
+
+
+
+
+
+ $html]);
+ exit;
+}
?>
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
@@ -28,7 +140,7 @@ $groups = $stmt->fetchAll();
- No groups found.
+
@@ -56,6 +168,145 @@ $groups = $stmt->fetchAll();
+
+
+ 1): ?>
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/includes/pages/xray_tests.php b/includes/pages/xray_tests.php
index d709cc9..0725768 100644
--- a/includes/pages/xray_tests.php
+++ b/includes/pages/xray_tests.php
@@ -1,36 +1,155 @@
prepare($countQuery);
+$stmt->execute($params);
+$totalTests = $stmt->fetchColumn();
+$totalPages = ceil($totalTests / $limit);
+
+// Fetch Data
+$query = "
+ SELECT t.*, g.name_$lang as group_name
+ FROM xray_tests t
+ LEFT JOIN xray_groups g ON t.group_id = g.id
+ $where
+ ORDER BY t.id DESC
+ LIMIT $limit OFFSET $offset";
+
$stmt = $db->prepare($query);
$stmt->execute($params);
$tests = $stmt->fetchAll();
// Fetch all xray groups for the dropdown
$all_xray_groups_list = $db->query("SELECT id, name_$lang as name FROM xray_groups ORDER BY name_$lang ASC")->fetchAll();
+
+// --- AJAX HANDLER ---
+if (isset($_GET['ajax_search'])) {
+ ob_start();
+ if (empty($tests)):
+ ?>
+