Changed Client-side Search to Server-side Search
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user