←':''; //Check if allowed if (isAllowed($page,$_SESSION['authorization']['permissions'],$_SESSION['authorization']['permission'],'R') === 0){ header('location: index.php'); exit; } //GET PARAMETERS && STORE in SESSION for FURTHER USE/NAVIGATION $pagination_page = $_SESSION['p'] = isset($_GET['p']) ? $_GET['p'] : 1; $status = $_SESSION['status'] = isset($_GET['status']) ? '&status='.$_GET['status'] : ''; $sort = $_SESSION['sort'] = isset($_GET['sort']) ? '&sort='.$_GET['sort'] : ''; $search = $_SESSION['search'] = isset($_GET['search']) ? '&search='.$_GET['search'] : ''; $software = $_SESSION['firmware'] = isset($_GET['firmware']) ? '&firmware='.$_GET['firmware'] : ''; $servicedate = $_SESSION['servicedate'] = isset($_GET['servicedate']) ? '&servicedate='.$_GET['servicedate'] : ''; $warrantydate = $_SESSION['warrantydate'] = isset($_GET['warrantydate']) ? '&warrantydate='.$_GET['warrantydate'] : ''; $partnerid = $_SESSION['partnerid'] = isset($_GET['partnerid']) ? '&partnerid='.$_GET['partnerid'] : ''; $productselected = $_SESSION['productcode'] = isset($_GET['productcode']) ? '&productcode='.$_GET['productcode'] : ''; $serialnumber_input = $_SESSION['serialnumber'] = isset($_GET['serialnumber']) ? '&serialnumber='.$_GET['serialnumber'] : ''; //GET PARAMETERS FOR FILTERS $filter = urlGETdetailsFilter($_GET) ?? ''; // Determine the URL $url = 'index.php?page=report_healthindex'.$status.$search.$software.$servicedate.$warrantydate.$partnerid.$sort.$productselected.$serialnumber_input; //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API $api_url = '/v2/equipment_healthindex/'.$GET_VALUES; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = json_decode($responses);}else{$responses = null;} //Return QueryTotal from API $api_url = '/v2/equipment_healthindex/'.$GET_VALUES.'&totals='; $query_total = ioServer($api_url,''); //Decode Payload if (!empty($query_total)){$query_total = $query_total;}else{$query_total = null;} //Get Products related to assets $api_url = '/v1/equipments/'.$GET_VALUES.'&products='; $query_products = ioServer($api_url,''); //Decode Payload if (!empty($query_products)){$query_products = decode_payload($query_products);}else{$query_products = null;} //BUILD LIST OF PRODUCTS $product_list = ''; if ($query_products != null){ $product_list = ' '; } if (isset($_GET['download'])){ downloadToExcel('equipment_healthindex',$responses); } template_header('Healthindex', 'healthindex','view'); $view = '
| '.$view_asset_data_ranking.' | '.$equipment_label1.' | '.$equipment_label2.' | '.$equipment_label3.' | '.$equipment_label4.' | '.$general_soldto.' | '.$general_shipto.' | |
|---|---|---|---|---|---|---|---|
| '.$message_no_assets.' | |||||||
| '.$response->healthindex.' | '.$indicators.' | '.$response->serialnumber.' | '.$$status_text.' | '.$response->productcode.'-'.(${$response->productname} ?? $response->productname).' | '; $view .= '';
if (!empty($picture)){
$view .='
|
'.$soldto.' | '.$shipto.' |