Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized function calls.
This commit is contained in:
@@ -157,13 +157,6 @@ if ($update_allowed === 1 || $equipment_owner === 1){
|
||||
|
||||
$view .= '</div>';
|
||||
|
||||
$view .= '<div class="tabs">
|
||||
<a href="#" class="active">'.$tab1.'</a>
|
||||
<a href="#">'.$tab2.'</a>
|
||||
<a href="#">'.$tab3.'</a>
|
||||
</div>
|
||||
';
|
||||
|
||||
//create product option list
|
||||
$product_option_list ='';
|
||||
foreach ($products as $product){
|
||||
@@ -188,7 +181,10 @@ if (isset($products_software) && $products_software !=''){
|
||||
$product_software_list .= '</select>';
|
||||
}
|
||||
|
||||
$view .= '<div class="content-block tab-content active">
|
||||
$view .= '<div class="tabs">
|
||||
<a href="#" class="active">'.$tab1.'</a>
|
||||
</div>
|
||||
<div class="content-block tab-content active">
|
||||
<div class="form responsive-width-100">
|
||||
<label for="status">'.$equipment_label3.'</label>
|
||||
<select id="status" name="status" '.($update_allowed_special==0? 'disabled':'').'>
|
||||
@@ -232,8 +228,11 @@ $location_dropdown = listPartner('location',$_SESSION['permission'],$partner_dat
|
||||
if (isset($partner_data->section)){$section = getPartnerName($partner_data->section) ?? 'Not specified';} else {$section = 'Not specified';}
|
||||
|
||||
|
||||
//DISPLAY
|
||||
$view .= '<div class="content-block tab-content">
|
||||
//DISPLAY TAB 2
|
||||
$view .= '<div class="tabs">
|
||||
<a href="#">'.$tab2.'</a>
|
||||
</div>
|
||||
<div class="content-block tab-content">
|
||||
<div class="form responsive-width-100">
|
||||
';
|
||||
$view .= '<label for="status">'.$general_salesid.'</label>';
|
||||
@@ -266,24 +265,28 @@ if (is_array($geo_details)) {
|
||||
$geodetails_lon = '';
|
||||
}
|
||||
|
||||
$view .= '<div class="content-block tab-content">
|
||||
<div class="form responsive-width-100">
|
||||
<label for="productcode">'.$general_created.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$equipment['created'].'" readonly>
|
||||
<label for="productcode">'.$general_createdby.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$equipment['createdby'].'" readonly>
|
||||
<label for="productcode">'.$general_updated.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_updated.'" value="'.$equipment['updated'].'" readonly>
|
||||
<label for="productcode">'.$general_updatedby.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_updatedby.'" value="'.$equipment['updatedby'].'" readonly>
|
||||
<label for="productcode">'.$equipment_label11.'</label>
|
||||
<input id="name" type="text" name="order_ref" placeholder="'.$equipment_label11.'" value="'.$equipment['order_ref'].'">
|
||||
<label for="productcode">'.$equipment_label12.'</label>
|
||||
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lat.'">
|
||||
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lon.'">
|
||||
'.($update_allowed_special==1? $changelog:'').'
|
||||
</div>
|
||||
</div>';
|
||||
//DISPLAY TAB 3
|
||||
$view .= '<div class="tabs">
|
||||
<a href="#">'.$tab3.'</a>
|
||||
</div>
|
||||
<div class="content-block tab-content">
|
||||
<div class="form responsive-width-100">
|
||||
<label for="productcode">'.$general_created.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$equipment['created'].'" readonly>
|
||||
<label for="productcode">'.$general_createdby.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$equipment['createdby'].'" readonly>
|
||||
<label for="productcode">'.$general_updated.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_updated.'" value="'.$equipment['updated'].'" readonly>
|
||||
<label for="productcode">'.$general_updatedby.'</label>
|
||||
<input id="name" type="text" name="" placeholder="'.$general_updatedby.'" value="'.$equipment['updatedby'].'" readonly>
|
||||
<label for="productcode">'.$equipment_label11.'</label>
|
||||
<input id="name" type="text" name="order_ref" placeholder="'.$equipment_label11.'" value="'.$equipment['order_ref'].'">
|
||||
<label for="productcode">'.$equipment_label12.'</label>
|
||||
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lat.'">
|
||||
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lon.'">
|
||||
'.($update_allowed_special==1? $changelog:'').'
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
$view .= '</form>';
|
||||
|
||||
Reference in New Issue
Block a user