Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized function calls.

This commit is contained in:
“VeLiTi”
2025-12-16 13:04:50 +01:00
parent fc13fec9c9
commit a329cec1a6
102 changed files with 190 additions and 110 deletions

View File

@@ -147,12 +147,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$view_account_information.'</a>
<a href="#">'.$view_account_contact.'</a>
<a href="#">'.$account_billing.'</a>
<a href="#">'.$account_shipping.'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
//Define Permission & Profile
$view .= '<div class="content-block tab-content active">
@@ -186,8 +181,10 @@ $view .= '<div class="content-block tab-content active">
</div>
</div>';
$view .= '<div class="content-block tab-content">
$view .= '<div class="tabs">
<a href="#">'.$view_account_contact.'</a>
</div>
<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$account_contactfirstname.'</label>
<input name="accountdetails[contactfirstname]" type="text" value="'.$accountdetails->contactfirstname.'">
@@ -206,8 +203,10 @@ $view .= '<div class="content-block tab-content">
</div>
</div>';
$view .= '<div class="content-block tab-content">
$view .= '<div class="tabs">
<a href="#">'.$account_billing.'</a>
</div>
<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$account_billstreetadress.'</label>
<input name="accountdetails[billstreetadress]" type="text" value="'.$accountdetails->billstreetadress.'">
@@ -231,7 +230,10 @@ $view .= '<div class="content-block tab-content">
</div>
</div>';
$view .= '<div class="content-block tab-content">
$view .= '<div class="tabs">
<a href="#">'.$account_shipping.'</a>
</div>
<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$account_streetadress.'</label>
<input name="accountdetails[streetadress]" type="text" value="'.$accountdetails->streetadress.'">
@@ -272,8 +274,10 @@ $view .= '<div class="content-block tab-content">
$partner_data = json_decode($_SESSION['partnerhierarchy']);
$soldto_dropdown = listPartner('soldto',$_SESSION['permission'],$accounthierarchy->soldto,'');
$view .= '<div class="content-block tab-content">
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>
<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$general_salesid.'</label>
<input name="salesid" type="text" value="'.$partner_data->salesid.'">

View File

@@ -23,17 +23,37 @@ document.querySelector('.responsive-toggle').onclick = event => {
document.querySelectorAll('.tabs a').forEach((element, index) => {
element.onclick = event => {
event.preventDefault();
document.querySelectorAll('.tabs a').forEach(element => element.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach((element2, index2) => {
if (index == index2) {
element.classList.add('active');
element2.style.display = 'block';
} else {
element2.style.display = 'none';
}
// Toggle the clicked tab
const isActive = element.classList.contains('active');
const tabContent = document.querySelectorAll('.tab-content')[index];
// Remove active class from all tabs and contents
document.querySelectorAll('.tabs a').forEach(el => el.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(content => {
content.classList.remove('active');
content.style.display = 'none';
});
// If it wasn't active, make it active (collapsible behavior)
if (!isActive && tabContent) {
element.classList.add('active');
tabContent.classList.add('active');
tabContent.style.display = 'block';
}
};
});
// Initialize first tab as open by default
if (document.querySelectorAll('.tabs a').length > 0) {
const firstTab = document.querySelectorAll('.tabs a')[0];
const firstContent = document.querySelectorAll('.tab-content')[0];
if (firstTab && firstContent) {
firstTab.classList.add('active');
firstContent.classList.add('active');
firstContent.style.display = 'block';
}
}
if (document.querySelector('.filters a')) {
let filtersList = document.querySelector('.filters .list');
let filtersListStyle = window.getComputedStyle(filtersList);

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

BIN
assets/images/media/SP1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@@ -256,9 +256,15 @@ $view .= '</div>';
foreach($arrayQuestions_cartest as $group){
if ($group['Group_sequence'] == 1){
$view .= '<div class="tabs">
<a href="#" class="active">'.$group['Group'].'</a>
</div>';
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">';
} else {
$view .= '<div class="tabs">
<a href="#">'.$group['Group'].'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">';
}

View File

@@ -127,11 +127,8 @@ if ($update_allowed === 1){
$view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1 .'</a>
<a href="#">'.$tab2.'</a>
<a href="#">'.$tab3.'</a>
</div>
';
<a href="#" class="active">'.$tab1.'</a>
</div>';
$view .='<div class="content-block tab-content active">
<div class="form responsive-width-100">
@@ -257,6 +254,10 @@ $shipto_dropdown = listPartner('shipto',$_SESSION['permission'],$partner_data->s
$location_dropdown = listPartner('location',$_SESSION['permission'],$partner_data->location,'');
//DISPLAY
$view .= '<div class="tabs">
<a href="#">'.$tab2.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
';
@@ -273,6 +274,10 @@ $view .= '
</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$general_created.'</label>

View File

@@ -155,13 +155,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.($view_dealers_information ?? 'Dealer information').'</a>
<a href="#">'.($view_dealer_details_1 ?? 'Descriptions').'</a>
<a href="#">'.($view_dealer_details_3 ?? 'Location').'</a>
<a href="#">'.($dealers_openinghours ?? 'opening_hours').'</a>
<a href="#">'.($view_dealer_details_2 ?? 'Settings').'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">
@@ -190,6 +184,10 @@ $view .= '<div class="content-block tab-content active">
$view .= '<input type="hidden" name="rowID" value="'.($responses['rowID'] ?? '').'">';
}
$view .= '<div class="tabs">
<a href="#">'.($view_dealers_descriptions ?? 'Description').'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="dealerdescription">'.($dealers_short_description ?? 'short').'</label>
@@ -325,6 +323,10 @@ $view .= '
</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="dealercode">'.$general_created.'</label>

View File

@@ -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>';

View File

@@ -115,9 +115,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1.'</a>
<a href="#" class="">'.$tab3.'</a>
</div>
';
</div>';
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">
@@ -152,6 +150,10 @@ $view .= '<div class="content-block tab-content active">
</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">

View File

@@ -123,9 +123,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1 .'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
//Define Service and User enabled
$view .= '<div class="content-block tab-content active">
@@ -141,6 +139,10 @@ $view .= '<div class="content-block tab-content active">
$view .= '</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$general_created.'</label>

View File

@@ -179,9 +179,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1 .'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
//Define Service and User enabled
$view .= '<div class="content-block tab-content active">
@@ -215,6 +213,10 @@ $view .= '<div class="content-block tab-content active">
</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$general_created.'</label>

View File

@@ -159,10 +159,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1.'</a>
<a href="#">'.$tab4.'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">
@@ -218,7 +215,10 @@ $view .= ' </div>
</div>
</div>';
$view .= '<div class="content-block tab-content">
$view .= '<div class="tabs">
<a href="#">'.$tab4.'</a>
</div>
<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="serialized">'.($product_configurable ?? 'Configurable').'</label>
<select id="status" name="configurable">
@@ -248,12 +248,15 @@ $view .= '<div class="content-block tab-content">
</div>
</div>';
$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="'.$product['created'].'" readonly>
<label for="productcode">'.$general_createdby.'</label>
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$product['createdby'].'" readonly>
$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="'.$product['created'].'" readonly>
<label for="productcode">'.$general_createdby.'</label>
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$product['createdby'].'" readonly>
<label for="productcode">'.$general_updated.'</label>
<input id="name" type="text" name="" placeholder="'.$general_updated.'" value="'.$product['updated'].'" readonly>
<label for="productcode">'.$general_updatedby.'</label>

View File

@@ -176,9 +176,7 @@ $view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1 .'</a>
<a href="#">'.$tab3.'</a>
</div>
';
</div>';
$view .='<div class="content-block tab-content active">
@@ -216,6 +214,10 @@ $view .='<div class="content-block tab-content active">
</div>
';
$view .= '<div class="tabs">
<a href="#">'.$tab3.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="">'.$general_created.'</label>

View File

@@ -339,6 +339,10 @@ if($rma['header']['servicereport_available'] == 0 ){
$view .= '</div>';
$view .= '<div class="tabs">
<a href="#" class="active">'.$tab1.'</a>
</div>';
$view .= '<div class="content-block tab-content active">
<div class="form responsive-width-100">
<div class="order-detail">
@@ -356,6 +360,10 @@ $view .= '<div class="content-block tab-content active">
</div>
</div>';
$view .= '<div class="tabs">
<a href="#">'.$tab2.'</a>
</div>';
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">';
if($rma['header']['servicereport_available'] == 0 ){

Some files were not shown because too many files have changed in this diff Show More