Initial commit
This commit is contained in:
74
servicereport.php
Normal file
74
servicereport.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
defined(page_security_key) or exit;
|
||||
|
||||
if (debug && debug_id == $_SESSION['id']){
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('display_startup_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
include_once './assets/functions.php';
|
||||
include_once './settings/settings.php';
|
||||
|
||||
//Check if allowed
|
||||
if (isAllowed('servicereport',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
header('location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//GET Details from URL
|
||||
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||
//CALL TO API FOR History
|
||||
$api_url = '/v1/history/'.$GET_VALUES;
|
||||
$history = ioServer($api_url,'');
|
||||
|
||||
//Decode Payload
|
||||
if (!empty($history)){$history = decode_payload($history);}else{$history = null;}
|
||||
|
||||
template_header('Servicereport', 'servicereport','view');
|
||||
$view = '
|
||||
<div class="content-title">
|
||||
<div class="title">
|
||||
<i class="fa-solid fa-box-open"></i>
|
||||
<div class="txt">
|
||||
<h2>'.$servicereport_h2.'</h2>
|
||||
<p>'.$servicereport_p.'</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$view .= '
|
||||
<div class="content-header responsive-flex-column pad-top-5">
|
||||
<a href="index.php?page=equipment&equipmentID='.$_GET['equipmentID'].'" class="btn">'.$button_cancel.'</a>
|
||||
</div>
|
||||
';
|
||||
|
||||
//Get all related service events
|
||||
if (empty($history)){
|
||||
$service_events = '
|
||||
<tr>
|
||||
<td colspan="8" style="text-align:center;">'.$servicereport_no_history.'</td>
|
||||
</tr>';
|
||||
} else {
|
||||
$service_events = serviceReport($history[0], 'display');
|
||||
}
|
||||
|
||||
$view .= '<div class="content-block">
|
||||
<div class="block-header">
|
||||
<i class="fa-solid fa-bars fa-sm"></i>'.$servicereport_details.' - '.$_GET['historyID'].'
|
||||
</div>
|
||||
'.$service_events.'
|
||||
</div>
|
||||
';
|
||||
|
||||
$view .= '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$view .= '</div>';
|
||||
//OUTPUT
|
||||
echo $view;
|
||||
|
||||
template_footer();
|
||||
?>
|
||||
Reference in New Issue
Block a user