CIM77 - Update

This commit is contained in:
“VeLiTi”
2024-05-17 10:51:45 +02:00
parent 448c08fec3
commit 2036869663
6 changed files with 33 additions and 22 deletions

View File

@@ -9,8 +9,9 @@ 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';
$_SESSION['prev_origin_servicereport'] = $_SERVER['REQUEST_URI'];
$prev_page = (isset($_SESSION['prev_origin_equipment'])) ? $_SESSION['prev_origin_equipment'] : $_SESSION['prev_origin'];
$page = $_SESSION['origin'] = 'servicereports';
//create backbutton to prev_origin
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
@@ -25,20 +26,20 @@ if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
$pagination_page = isset($_GET['p']) ? $_GET['p'] : 1;
$status = isset($_GET['status']) ? '&status='.$_GET['status'] : '';
$search = isset($_GET['search']) ? '&search='.$_GET['search'] : '';
$equipmentid = isset($_GET['equipmentid']) ? '&equipmentid='.$_GET['equipmentid'] : '';
// Determine the URL
$url = 'index.php?page=servicereports'.$status.$search;
$url = 'index.php?page=servicereports'.$status.$search.$equipmentid;
//GET Details from URL
$GET_VALUES = urlGETdetails($_GET) ?? '';
//CALL TO API FOR History
$api_url = '/v1/equipments/type=ServiceReport&'.$GET_VALUES.'&history=0';
$api_url = '/v1/history/type=ServiceReport&'.$GET_VALUES.'';
$history = ioServer($api_url,'');
//Decode Payload
if (!empty($history)){$history = decode_payload($history);}else{$history = null;}
//Return QueryTotal from API
$api_url = '/v1/equipments/type=ServiceReport&'.$GET_VALUES.'&totals=';
$api_url = '/v1/history/type=ServiceReport&'.$GET_VALUES.'&totals=';
$query_total = ioServer($api_url,'');
//Decode Payload
if (!empty($query_total)){$query_total = decode_payload($query_total);}else{$query_total = null;}
@@ -76,7 +77,7 @@ if (empty($history)){
<td colspan="8" style="text-align:center;">'.$servicereports_no_history.'</td>
</tr>';
} else {
$service_events = serviceEvents($history);
$service_events = serviceEvents($history,$page);
}
$view .= '<div class="content-block">