better filtering and searching
This commit is contained in:
@@ -48,9 +48,20 @@ class DashboardController {
|
||||
}
|
||||
}
|
||||
// If $_GET['show_all'] exists or no status param with show_all, show all tickets (status = null)
|
||||
|
||||
// Get tickets with pagination, sorting, and search
|
||||
$result = $this->ticketModel->getAllTickets($page, $limit, $status, $sortColumn, $sortDirection, $category, $type, $search);
|
||||
|
||||
// Build advanced search filters array
|
||||
$filters = [];
|
||||
if (isset($_GET['created_from'])) $filters['created_from'] = $_GET['created_from'];
|
||||
if (isset($_GET['created_to'])) $filters['created_to'] = $_GET['created_to'];
|
||||
if (isset($_GET['updated_from'])) $filters['updated_from'] = $_GET['updated_from'];
|
||||
if (isset($_GET['updated_to'])) $filters['updated_to'] = $_GET['updated_to'];
|
||||
if (isset($_GET['priority_min'])) $filters['priority_min'] = $_GET['priority_min'];
|
||||
if (isset($_GET['priority_max'])) $filters['priority_max'] = $_GET['priority_max'];
|
||||
if (isset($_GET['created_by'])) $filters['created_by'] = $_GET['created_by'];
|
||||
if (isset($_GET['assigned_to'])) $filters['assigned_to'] = $_GET['assigned_to'];
|
||||
|
||||
// Get tickets with pagination, sorting, search, and advanced filters
|
||||
$result = $this->ticketModel->getAllTickets($page, $limit, $status, $sortColumn, $sortDirection, $category, $type, $search, $filters);
|
||||
|
||||
// Get categories and types for filters
|
||||
$categories = $this->getCategories();
|
||||
|
||||
Reference in New Issue
Block a user