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
@@ -88,11 +88,13 @@ class HistoricTicketModel {
return $sql;
}
public static function getAllHistoricTickets($filters, $limit = null, $offset = 0): array {
public static function getAllHistoricTickets($filters, $limit = null, $offset = 0, $order = null): array {
$db = FronkDB::singleton();
$sql = "SELECT * FROM `HistoricTicket` WHERE 1 " . self::getSqlFilter($filters) . " ORDER BY `ticket_number` DESC";
$sql = "SELECT * FROM `HistoricTicket` WHERE 1 " . self::getSqlFilter($filters);
$sql .= $order === null || $order['key'] === null ? " ORDER BY `ticket_number` DESC " : " ORDER BY `" . $order['key'] . "` " . $order['order'];
$sql .= $limit === null ? "" : " LIMIT " . $limit . " OFFSET " . $offset;
// die($sql);
$result = $db->query($sql);
$rows = [];
while ($row = $result->fetch_assoc()) {
@@ -162,7 +164,7 @@ class HistoricTicketModel {
"table_entry" => "ticket",
"ticket_id" => $ticket["id"],
"ticket_number" => $ticket["ticket_number"],
"ctime" => $ticket["ctime"],
"ctime" => intval($ticket["ctime"]),
"ticket_subject" => $ticket["subject"],
];
}
@@ -173,7 +175,7 @@ class HistoricTicketModel {
"ticket_id" => $message["ticket_id"],
"ticket_number" => $message["ticket_number"],
"ticket_subject" => $message["subject"],
"ctime" => $message["ctime"],
"ctime" => intval($message["ctime"]),
"ticket_message" => $message["content"],
];
}