CIM77 - Service reports alleen laatste 5

This commit is contained in:
“VeLiTi”
2024-05-16 15:56:20 +02:00
parent 7612073a5f
commit e4cc9f4ef3
6 changed files with 50 additions and 11 deletions

View File

@@ -8,8 +8,15 @@ defined(page_security_key) or exit;
include_once './assets/functions.php';
include_once './settings/settings.php';
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
$prev_page = $_SESSION['prev_origin_equipment'] ?? '';
$page = 'servicereports';
//create backbutton to prev_origin
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
//Check if allowed
if (isAllowed('servicereports',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
header('location: index.php');
exit;
}
@@ -24,7 +31,7 @@ $url = 'index.php?page=servicereports'.$status.$search;
//GET Details from URL
$GET_VALUES = urlGETdetails($_GET) ?? '';
//CALL TO API FOR History
$api_url = '/v1/equipments/type=ServiceReport&'.$GET_VALUES.'&history=';
$api_url = '/v1/equipments/type=ServiceReport&'.$GET_VALUES.'&history=0';
$history = ioServer($api_url,'');
//Decode Payload
@@ -46,6 +53,7 @@ $view = '
<p>'.$servicereports_p.'</p>
</div>
</div>
'.$back_btn_orgin.'
</div>';
$view .= '