Changed Client-side Search to Server-side Search

This commit is contained in:
2025-09-05 12:40:38 -04:00
parent e05434137c
commit 38ae4802b8
6 changed files with 117 additions and 22 deletions

View File

@ -18,6 +18,7 @@ class DashboardController {
$sortDirection = isset($_GET['dir']) ? $_GET['dir'] : 'desc';
$category = isset($_GET['category']) ? $_GET['category'] : null;
$type = isset($_GET['type']) ? $_GET['type'] : null;
$search = isset($_GET['search']) ? trim($_GET['search']) : null; // ADD THIS LINE
// Handle status filtering
$status = null;
@ -29,8 +30,8 @@ class DashboardController {
}
// If $_GET['show_all'] exists or no status param with show_all, show all tickets (status = null)
// Get tickets with pagination and sorting
$result = $this->ticketModel->getAllTickets($page, $limit, $status, $sortColumn, $sortDirection, $category, $type);
// Get tickets with pagination, sorting, and search
$result = $this->ticketModel->getAllTickets($page, $limit, $status, $sortColumn, $sortDirection, $category, $type, $search);
// Get categories and types for filters
$categories = $this->getCategories();