Updated TheTool Frontend Framework & Table

This commit is contained in:
Luca Haid
2024-05-08 12:54:26 +00:00
parent 1e57d983b7
commit 58e124a461
46 changed files with 1364 additions and 2535 deletions
@@ -54,19 +54,22 @@ class HistoricTicketController extends mfBaseController {
$json = json_decode(file_get_contents('php://input'), true);
$filters = $json['filters'] ?? [];
$order = $json['order'] ?? [];
$page = $json['pagination']['page'] ?? 1;
$perPage = $json['pagination']['per_page'] ?? 10;
$historicTickets = HistoricTicketModel::getAllHistoricTickets($filters, $perPage, ($page - 1) * $perPage);
$total = HistoricTicketModel::countHistoricTickets($filters);
$historicTickets = HistoricTicketModel::getAllHistoricTickets($filters, $perPage, ($page - 1) * $perPage, $order);
$filtered_available = HistoricTicketModel::countHistoricTickets($filters);
$totalRows = HistoricTicketModel::countHistoricTickets([]);
return [
"rows" => $historicTickets,
"pagination" => [
"page" => $page,
"total_pages" => ceil($total / $perPage),
"total_pages" => ceil($totalRows / $perPage),
"per_page" => $perPage,
"total_rows" => intval($total)
"filtered_available" => intval($filtered_available),
"total_rows" => intval($totalRows)
]
];
}
@@ -88,16 +91,6 @@ class HistoricTicketController extends mfBaseController {
];
}
$rows = HistoricTicketModel::findTicket($query);
return [
"rows" => $rows,
"pagination" => [
"page" => 1,
"total_pages" => 1,
"per_page" => count($rows),
"total_rows" => count($rows)
]
];
return HistoricTicketModel::findTicket($query);
}
}