CIM79 - Filter on productname in asset view
This commit is contained in:
@@ -36,13 +36,13 @@ $software = $_SESSION['firmware'] = isset($_GET['firmware']) ? '&firmware='.$_GE
|
||||
$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'] : '';
|
||||
|
||||
//GET PARAMETERS FOR FILTERS
|
||||
$filter = urlGETdetailsFilter($_GET) ?? '';
|
||||
|
||||
// Determine the URL
|
||||
$url = 'index.php?page=equipments'.$status.$search.$software.$servicedate.$warrantydate.$partnerid.$sort;
|
||||
$url = 'index.php?page=equipments'.$status.$search.$software.$servicedate.$warrantydate.$partnerid.$sort.$productselected;
|
||||
//GET Details from URL
|
||||
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||
//CALL TO API
|
||||
@@ -57,6 +57,25 @@ $query_total = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($query_total)){$query_total = decode_payload($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 = '
|
||||
<select name="productcode">
|
||||
<option value="" disabled selected>'.$equipment_label4.'</option>';
|
||||
foreach ($query_products as $product){
|
||||
$product_list .= '<option value="'.$product->productcode.'">'.$product->productname.'</option>';
|
||||
}
|
||||
$product_list .= '</select>';
|
||||
}
|
||||
|
||||
// Handle success messages
|
||||
if (isset($_GET['success_msg'])) {
|
||||
if ($_GET['success_msg'] == 1) {
|
||||
@@ -110,7 +129,7 @@ $view .= '
|
||||
<div class="filters">
|
||||
<a href="#"><i class="fa-solid fa-filter"></i>'.$general_filters.'</a>
|
||||
<div class="list">
|
||||
<select name="status">
|
||||
<select name="status">
|
||||
<option value="" disabled selected>'.$equipment_label3.'</option>
|
||||
<option value="0"'.($status==0?' selected':'').'>'.$status0_text.'</option>
|
||||
<option value="1"'.($status==1?' selected':'').'>'.$status1_text.'</option>
|
||||
@@ -119,7 +138,9 @@ $view .= '
|
||||
<option value="4"'.($status==4?' selected':'').'>'.$status4_text.'</option>
|
||||
<option value="5"'.($status==5?' selected':'').'>'.$status5_text.'</option>
|
||||
</select>
|
||||
'.$product_list.'
|
||||
<button type="submit">'.$button_apply.'</button>
|
||||
<a class="cancel_link" style="color: #FFFFFF;text-decoration: none;" href="index.php?page=equipments">'.$general_filters_clear.'</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sort">
|
||||
|
||||
Reference in New Issue
Block a user