'.$button_back.'':''; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['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; //PAGE Security $page_manage = 'product_manage'; $update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U'); $update_allowed_edit = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'U'); $delete_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'D'); $create_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'C'); //GET Details from URL $GET_VALUES = urlGETdetails($_GET) ?? ''; //CALL TO API FOR General information $api_url = '/v1/products/'.$GET_VALUES; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;} $responses = $responses[0]; //CALL TO API FOR Product_versions $api_url = '/v1/products_versions/productrowid='.$_GET['rowID']; $product_versions = ioServer($api_url,''); //Decode Payload if (!empty($product_versions)){$product_versions = decode_payload($product_versions);}else{$product_versions = null;} //CALL TO API FOR Product_software $api_url = '/v1/products_software/productrowid='.$_GET['rowID']; $product_software = ioServer($api_url,''); //Decode Payload if (!empty($product_software)){$product_software = decode_payload($product_software);}else{$product_software = null;} //CALL TO API FOR Product_configuration $api_url = '/v2/products_configurations/productrowid='.$_GET['rowID']; $products_configurations = ioServer($api_url,''); //Decode Payload if (!empty($products_configurations)){$products_configurations = json_decode($products_configurations,true);}else{$products_configurations = null;} //------------------------------ //Variables //------------------------------ $status_text = 'prod_status_'.$responses->status ?? ''; $product_category_text = 'product_category'.$responses->product_category ?? ''; $parttype_text = 'part_type'.$responses->parttype ?? ''; // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = $message_pr_1; } if ($_GET['success_msg'] == 2) { $success_msg = $message_pr_2; } if ($_GET['success_msg'] == 3) { $success_msg = $message_pr_3; } } template_header('Product', 'product', 'view'); $view = '
'.$success_msg.'
'.$$status_text.'
'.$$product_category_text.'
'.$$parttype_text.'
'.$responses->productcode.'
'.(${$responses->productname} ?? $responses->productname).'
| '.($product_configuration_version ?? 'Config-version').' | '.$general_actions.' |
|---|---|
| '.$product_version_number.' | '.$product_status.' | '.$product_version_version.' | '.($product_version_config ?? 'Config').' | '.$general_actions.' |
|---|---|---|---|---|
| '.$version->rowID.' | '.(($version->status == 1)? ''.$prod_status_1:''.$prod_status_0).' | '.$version->version.' | '.(!empty($version->config) ? ($general_yes ?? 'Y') : ($general_no ?? 'N')).' | '.$general_view.' |
| # | '.$product_status.' | '.$product_version_version.' | '.$equipment_label5.' | '.$product_version_software .' | '.ucfirst($register_mandatory).' | '.ucfirst($general_sort_type_3).' | '.$general_actions.' |
|---|---|---|---|---|---|---|---|
| '.$version->rowID.' | '.(($version->status == 1)? ''.$prod_status_1:''.$prod_status_0).' | '.$version->version.' | '.$version->hw_version.' | '.$version->software.' | '.(($version->mandatory == 1)? $general_yes: $general_no).' | '.(($version->latest == 1)? $general_yes: $general_no).' | '.$general_view.' |
| '.($product_configurable ?? 'Configurable').' | '.(($responses->configurable == 1)? $enabled : $disabled).' |
| '.$product_serialized.' | '.(($responses->sn == 1)? $enabled : $disabled).' |
| '.$product_sales.' | '.(($responses->salesflag == 1)? $enabled : $disabled).' |
| '.$product_build.' | '.(($responses->build == 1)? $enabled : $disabled).' |
| '.$view_asset_data_ranking.' | '.(($responses->healthindex == 1)? $enabled : $disabled).' |
| '.$general_created.' | '.getRelativeTime($responses->created).' |
| '.$general_createdby.' | '.$responses->createdby.' |
| '.$general_updated.' | '.getRelativeTime($responses->updated).' |
| '.$general_updatedby.' | '.$responses->updatedby.' |