implementovane zobrazenie archivu,

TODO: dorobit load dalsich stran,
zmena FullScreenLoader namiesto zatmavenia na rozmazanie,
pridana podmienka na editable pre zobrazenie BUG, pouzitelne ked sa otvara archivovany bug
This commit is contained in:
2025-05-17 21:21:42 +02:00
parent 506e847b5d
commit e6f3ef4ab2
7 changed files with 157 additions and 20 deletions

View File

@ -235,19 +235,21 @@ function reportGet($report_id)
]);
}
function reportGetAll($status = null)
function reportGetAll($status = null, $page = null)
{
global $db;
if ($status === null) $status = array(0, 1, 2, 3);
return $db->select('reports', '*', [
$params = [
'ORDER' => ['report_priority' => 'DESC', 'ordnum' => 'ASC'],
'report_status' => $status
]);
];
if ($page !== null) $params['LIMIT'] = [$page * 10, 10];
return $db->select('reports', '*', $params);
}
function reportGetAllGrouped($status = null)
function reportGetAllGrouped($status = null, $page = null)
{
$all = reportGetAll($status);
$all = reportGetAll($status, $page);
$groups = [];
foreach ($all as $report) {
$groups[$report['report_status']][] = $report;
@ -255,6 +257,17 @@ function reportGetAllGrouped($status = null)
return $groups;
}
function reportGetArchived($page = null)
{
global $db;
$params = [
'ORDER' => ['created_dt' => 'DESC'],
'report_status' => '4'
];
if ($page !== null) $params['LIMIT'] = [$page * 10, 10];
return $db->select('reports', '*', $params);
}
/**
* Attachments
*/