diff --git a/account_manage.php b/account_manage.php index 23e2cc2..9af1788 100644 --- a/account_manage.php +++ b/account_manage.php @@ -147,12 +147,7 @@ $view .= ''; $view .= '
'.$view_account_information.' - '.$view_account_contact.' - '.$account_billing.' - '.$account_shipping.' - '.$tab3.' -
- '; + '; //Define Permission & Profile $view .= '
@@ -186,8 +181,10 @@ $view .= '
'; -$view .= '
- +$view .= '
+ '.$view_account_contact.' +
+
@@ -206,8 +203,10 @@ $view .= '
'; -$view .= '
- +$view .= ' +
@@ -231,7 +230,10 @@ $view .= '
'; -$view .= '
+$view .= ' +
@@ -272,8 +274,10 @@ $view .= '
$partner_data = json_decode($_SESSION['partnerhierarchy']); $soldto_dropdown = listPartner('soldto',$_SESSION['permission'],$accounthierarchy->soldto,''); -$view .= '
- +$view .= '
+ '.$tab3.' +
+
diff --git a/api/v2/get/equipments.php b/api/v2/get/equipments.php index 9b0005d..ff797aa 100644 --- a/api/v2/get/equipments.php +++ b/api/v2/get/equipments.php @@ -161,25 +161,8 @@ if ($sw_version_latest_update == 1){ //------------------------------------------ //UPDATE SW_STATUS //------------------------------------------ - //UPDATE ASSETS-> SW_LATEST_VERSION WITH NO PRODUCT_SOFTWARE TO 2 - $sql = 'UPDATE equipment e LEFT JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 2 WHERE ps.rowID IS NULL'; - $stmt = $pdo->prepare($sql); - $stmt->execute(); - - //UPDATE ASSETS-> SW_LATEST_VERSION WITH PRODUCT_SOFTWARE FROM 2 TO 0 - $sql = 'UPDATE equipment e LEFT JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 0 WHERE ps.rowID IS NOT NULL AND sw_version_latest = 2'; - $stmt = $pdo->prepare($sql); - $stmt->execute(); - - //UPDATE LATEST TO NO IN CASE HW_VERSION ARE EQUAL AND SW_VERSIONS NOT AND NOT LATEST - $sql = 'UPDATE equipment e JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 0 WHERE ps.latest = 1 AND lower(e.sw_version) <> lower(ps.version) AND lower(e.hw_version) = lower(ps.hw_version) AND e.sw_version_latest = 1'; - $stmt = $pdo->prepare($sql); - $stmt->execute(); - - //UPDATE LATEST TO YES IN CASE HW_VERSION ARE EQUAL AND SW_VERSIONS ARE EQUAL - $sql = 'UPDATE equipment e JOIN products_software ps ON e.productrowid = ps.productrowid SET e.sw_version_latest = 1 WHERE ps.latest = 1 AND lower(e.sw_version) = lower(ps.version) AND lower(e.hw_version) = lower(ps.hw_version) AND e.sw_version_latest = 0'; - $stmt = $pdo->prepare($sql); - $stmt->execute(); + // Use the reusable function to update software version status for all equipment + updateSoftwareVersionStatus($pdo); //------------------------------------------ //------------------------------------------ } diff --git a/api/v2/get/software_available.php b/api/v2/get/software_available.php new file mode 100644 index 0000000..118a914 --- /dev/null +++ b/api/v2/get/software_available.php @@ -0,0 +1,196 @@ +prepare($sql); + $stmt->execute([$criterias['version'],$username,$criterias['sn']]); + } + + //check if current hw_version is send and update the equipment record + if(isset($criterias['hw_version']) && $criterias['hw_version'] !=''){ + $sql = 'UPDATE equipment SET hw_version = ?, updatedby = ? WHERE serialnumber = ? '; + $stmt = $pdo->prepare($sql); + $stmt->execute([$criterias['hw_version'],$username,$criterias['sn']]); + } + + //GET EQUIPMENT AND PRODUCT DATA BASED ON SERIAL NUMBER + $sql = 'SELECT + p.rowID as product_rowid, + p.productcode, + e.sw_version as current_sw_version, + e.hw_version, + e.sw_version_license, + e.rowID as equipment_rowid + FROM equipment e + JOIN products p ON e.productrowid = p.rowID + WHERE e.serialnumber = ?'; + $stmt = $pdo->prepare($sql); + $stmt->execute([$criterias['sn']]); + $equipment_data = $stmt->fetch(PDO::FETCH_ASSOC); + + if (!$equipment_data) { + $messages = ["error" => "No equipment found for serialnumber"]; + } else { + $product_rowid = $equipment_data['product_rowid']; + $productcode = $equipment_data['productcode']; + $current_sw_version = $equipment_data['current_sw_version']; + $hw_version = $equipment_data['hw_version']; + $sw_version_license = $equipment_data['sw_version_license']; + $equipment_rowid = $equipment_data['equipment_rowid']; + + //GET ALL DATA: active assignments, version details, and upgrade paths + //Filter on active status, hw_version compatibility, and exclude current version + $sql = 'SELECT + psv.rowID as version_id, + psv.version, + psv.name, + psv.description, + psv.mandatory, + psv.latest, + psv.hw_version, + psv.file_path, + pup.price, + pup.currency, + pup.from_version_id, + from_ver.version as from_version + FROM products_software_assignment psa + JOIN products_software_versions psv ON psa.software_version_id = psv.rowID + LEFT JOIN products_software_upgrade_paths pup ON pup.to_version_id = psv.rowID AND pup.is_active = 1 + LEFT JOIN products_software_versions from_ver ON pup.from_version_id = from_ver.rowID + WHERE psa.product_id = ? + AND psa.status = 1 + AND (psv.hw_version = ? OR psv.hw_version IS NULL OR psv.hw_version = "") + AND psv.version != ?'; + + $stmt = $pdo->prepare($sql); + $stmt->execute([$product_rowid, $hw_version, $current_sw_version ?? '']); + $versions = $stmt->fetchAll(PDO::FETCH_ASSOC); + + if (empty($versions)) { + // No versions available + $software_available = "no"; + } else { + $has_priced_options = false; + $has_latest_version_different = false; + + foreach ($versions as $version) { + //Check if this version should be shown (same logic as software_update) + $show_version = false; + if (!$current_sw_version || $current_sw_version == '') { + //No current version - show all + $show_version = true; + } elseif ($version['from_version'] == $current_sw_version) { + //Upgrade path exists from current version + $show_version = true; + } else { + //Check if any upgrade paths exist for this version + $sql = 'SELECT COUNT(*) as path_count + FROM products_software_upgrade_paths + WHERE to_version_id = ? AND is_active = 1'; + $stmt = $pdo->prepare($sql); + $stmt->execute([$version['version_id']]); + $path_check = $stmt->fetch(PDO::FETCH_ASSOC); + + if ($path_check['path_count'] == 0) { + //No paths exist at all - show as free upgrade + $show_version = true; + } + } + + if ($show_version) { + //Check if there's a valid license for this upgrade + $final_price = $version['price'] ?? '0.00'; + + if ($final_price > 0 && $sw_version_license) { + //Check if the license is valid + $sql = 'SELECT status, start_at, expires_at + FROM products_software_licenses + WHERE license_key = ? AND equipment_id = ?'; + $stmt = $pdo->prepare($sql); + $stmt->execute([$sw_version_license, $equipment_rowid]); + $license = $stmt->fetch(PDO::FETCH_ASSOC); + + if ($license && $license['status'] == 1) { + $now = date('Y-m-d H:i:s'); + $start_at = $license['start_at']; + $expires_at = $license['expires_at']; + + //Check if license is within valid date range + if ((!$start_at || $start_at <= $now) && (!$expires_at || $expires_at >= $now)) { + $final_price = '0.00'; + } + } + } + + // Check for priced options + if ($final_price > 0) { + $has_priced_options = true; + } + + // Check if there's a "latest" flagged version that's different from current + if ($version['latest'] == 1 && $version['version'] != $current_sw_version) { + $has_latest_version_different = true; + } + } + } + + // Apply the logic: + // 1. If there are priced options -> "yes" + // 2. If no priced options but current version != latest flagged version -> "yes" + // 3. Default -> "no" + if ($has_priced_options) { + $software_available = "yes"; + } elseif ($has_latest_version_different) { + $software_available = "yes"; + } else { + $software_available = "no"; + } + } + + $messages = ["software_available" => $software_available]; + } +} else { + $messages = ["error" => "No serialnumber found"]; +} + +//Encrypt results +$messages = json_encode($messages, JSON_UNESCAPED_UNICODE); + +//Send results +echo $messages; + +?> \ No newline at end of file diff --git a/assets/admin.js b/assets/admin.js index 15f2a49..b3869a2 100644 --- a/assets/admin.js +++ b/assets/admin.js @@ -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); diff --git a/assets/functions.php b/assets/functions.php index 32c5d57..608a441 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -1490,6 +1490,7 @@ function getProfile($profile, $permission){ 'com_log' => 'U', 'software_update' => 'R', 'software_download' => 'R', + 'software_available' => 'R' ]; // Group permissions: [granting_page => [collection => allowed_actions_string]] @@ -5110,4 +5111,84 @@ function checkAndInsertIdentityDealer($pdo, $identityUserkey) { error_log('Database error in checkAndInsertIdentityDealer: ' . $e->getMessage()); return false; } +} + +//------------------------------------------ +// Update software version status for equipment +// Parameters: +// $pdo - PDO database connection +// $serialnumber - Optional serial number. If null, updates all equipment +// Returns: boolean - true on success, false on error +//------------------------------------------ +function updateSoftwareVersionStatus($pdo, $serialnumber = null) { + try { + // Build WHERE clause for serial number filtering if provided + $sn_clause = ''; + $bind_params = []; + + if ($serialnumber !== null) { + $sn_clause = ' AND e.serialnumber = ?'; + $bind_params = [$serialnumber]; + } + + //------------------------------------------ + // STEP 1: Set sw_version_latest = 2 for equipment with NO software assignments + //------------------------------------------ + $sql = 'UPDATE equipment e + LEFT JOIN products_software_assignment psa ON e.productrowid = psa.product_id AND psa.status = 1 + SET e.sw_version_latest = 2 + WHERE psa.product_id IS NULL' . $sn_clause; + + $stmt = $pdo->prepare($sql); + $stmt->execute($bind_params); + + //------------------------------------------ + // STEP 2: Set sw_version_latest = 0 for equipment WITH software assignments (from previous 2) + //------------------------------------------ + $sql = 'UPDATE equipment e + JOIN products_software_assignment psa ON e.productrowid = psa.product_id AND psa.status = 1 + SET e.sw_version_latest = 0 + WHERE e.sw_version_latest = 2' . $sn_clause; + + $stmt = $pdo->prepare($sql); + $stmt->execute($bind_params); + + //------------------------------------------ + // STEP 3: Set sw_version_latest = 0 for equipment NOT matching latest version + //------------------------------------------ + $sql = 'UPDATE equipment e + JOIN products_software_assignment psa ON e.productrowid = psa.product_id AND psa.status = 1 + JOIN products_software_versions psv ON psa.software_version_id = psv.rowID + SET e.sw_version_latest = 0 + WHERE psv.latest = 1 + AND psv.status = 1 + AND lower(e.sw_version) <> lower(psv.version) + AND (psv.hw_version = e.hw_version OR psv.hw_version IS NULL OR psv.hw_version = "") + AND e.sw_version_latest = 1' . $sn_clause; + + $stmt = $pdo->prepare($sql); + $stmt->execute($bind_params); + + //------------------------------------------ + // STEP 4: Set sw_version_latest = 1 for equipment matching latest version + //------------------------------------------ + $sql = 'UPDATE equipment e + JOIN products_software_assignment psa ON e.productrowid = psa.product_id AND psa.status = 1 + JOIN products_software_versions psv ON psa.software_version_id = psv.rowID + SET e.sw_version_latest = 1 + WHERE psv.latest = 1 + AND psv.status = 1 + AND lower(e.sw_version) = lower(psv.version) + AND (psv.hw_version = e.hw_version OR psv.hw_version IS NULL OR psv.hw_version = "") + AND e.sw_version_latest = 0' . $sn_clause; + + $stmt = $pdo->prepare($sql); + $stmt->execute($bind_params); + + return true; + + } catch (PDOException $e) { + error_log('Database error in updateSoftwareVersionStatus: ' . $e->getMessage()); + return false; + } } \ No newline at end of file diff --git a/assets/images/media/1-Morval-Watches2024-V1-Blue-Black-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Blue-Black-Date normaal.png new file mode 100644 index 0000000..e63de24 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Blue-Black-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Blue-Brown-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Blue-Brown-Date normaal.png new file mode 100644 index 0000000..e3df3c2 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Blue-Brown-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Blue-Calf-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Blue-Calf-Date normaal.png new file mode 100644 index 0000000..4347d7f Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Blue-Calf-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png new file mode 100644 index 0000000..ca628e6 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Blue-Steel-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Blue-Steel-Date normaal.png new file mode 100644 index 0000000..234da73 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Blue-Steel-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png new file mode 100644 index 0000000..d8943a1 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png new file mode 100644 index 0000000..b94e1df Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png new file mode 100644 index 0000000..d10832d Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png new file mode 100644 index 0000000..cbdf9f7 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png new file mode 100644 index 0000000..189713a Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png new file mode 100644 index 0000000..3c6e8d7 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png new file mode 100644 index 0000000..260f28e Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png differ diff --git a/assets/images/media/1-Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png b/assets/images/media/1-Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png new file mode 100644 index 0000000..edeb083 Binary files /dev/null and b/assets/images/media/1-Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png differ diff --git a/assets/images/media/67fbcc9ac57a5_Swim-Spas-Image-1.jpg b/assets/images/media/67fbcc9ac57a5_Swim-Spas-Image-1.jpg new file mode 100644 index 0000000..6d7584a Binary files /dev/null and b/assets/images/media/67fbcc9ac57a5_Swim-Spas-Image-1.jpg differ diff --git a/assets/images/media/67fbcda135a98_hotspringworld-42.webp b/assets/images/media/67fbcda135a98_hotspringworld-42.webp new file mode 100644 index 0000000..ba91a01 Binary files /dev/null and b/assets/images/media/67fbcda135a98_hotspringworld-42.webp differ diff --git a/assets/images/media/Band_0000_Layer-1-copy normaal.png b/assets/images/media/Band_0000_Layer-1-copy normaal.png new file mode 100644 index 0000000..28ff691 Binary files /dev/null and b/assets/images/media/Band_0000_Layer-1-copy normaal.png differ diff --git a/assets/images/media/Band_0001_Layer-2-copy normaal.png b/assets/images/media/Band_0001_Layer-2-copy normaal.png new file mode 100644 index 0000000..e9320f0 Binary files /dev/null and b/assets/images/media/Band_0001_Layer-2-copy normaal.png differ diff --git a/assets/images/media/Band_0002_Layer-3-copy normaal.png b/assets/images/media/Band_0002_Layer-3-copy normaal.png new file mode 100644 index 0000000..88198a4 Binary files /dev/null and b/assets/images/media/Band_0002_Layer-3-copy normaal.png differ diff --git a/assets/images/media/Band_0003_Layer-4-copy normaal.png b/assets/images/media/Band_0003_Layer-4-copy normaal.png new file mode 100644 index 0000000..b9a20bb Binary files /dev/null and b/assets/images/media/Band_0003_Layer-4-copy normaal.png differ diff --git a/assets/images/media/Band_0004_Layer-1 normaal.png b/assets/images/media/Band_0004_Layer-1 normaal.png new file mode 100644 index 0000000..f5f9ab1 Binary files /dev/null and b/assets/images/media/Band_0004_Layer-1 normaal.png differ diff --git a/assets/images/media/Band_0005_Layer-2 normaal.png b/assets/images/media/Band_0005_Layer-2 normaal.png new file mode 100644 index 0000000..a585050 Binary files /dev/null and b/assets/images/media/Band_0005_Layer-2 normaal.png differ diff --git a/assets/images/media/Band_0006_Layer-4 normaal.png b/assets/images/media/Band_0006_Layer-4 normaal.png new file mode 100644 index 0000000..9cbd799 Binary files /dev/null and b/assets/images/media/Band_0006_Layer-4 normaal.png differ diff --git a/assets/images/media/Band_0007_Layer-3 normaal.png b/assets/images/media/Band_0007_Layer-3 normaal.png new file mode 100644 index 0000000..f37c994 Binary files /dev/null and b/assets/images/media/Band_0007_Layer-3 normaal.png differ diff --git a/assets/images/media/EPH2NA1.png b/assets/images/media/EPH2NA1.png new file mode 100644 index 0000000..c21df08 Binary files /dev/null and b/assets/images/media/EPH2NA1.png differ diff --git a/assets/images/media/EPSK01.jpg b/assets/images/media/EPSK01.jpg new file mode 100644 index 0000000..1f0d38d Binary files /dev/null and b/assets/images/media/EPSK01.jpg differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Black normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Black normaal.png new file mode 100644 index 0000000..ff77427 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Black normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Black-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Black-Date normaal.png new file mode 100644 index 0000000..e63de24 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Black-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Brown normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Brown normaal.png new file mode 100644 index 0000000..620f56f Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Brown normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Brown-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Brown-Date normaal.png new file mode 100644 index 0000000..e3df3c2 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Brown-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Calf normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Calf normaal.png new file mode 100644 index 0000000..c0d2845 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Calf normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Calf-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Calf-Date normaal.png new file mode 100644 index 0000000..4347d7f Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Calf-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue normaal.png new file mode 100644 index 0000000..668d797 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png new file mode 100644 index 0000000..ca628e6 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Steel normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Steel normaal.png new file mode 100644 index 0000000..ff6788b Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Steel normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Blue-Steel-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Blue-Steel-Date normaal.png new file mode 100644 index 0000000..234da73 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Blue-Steel-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png new file mode 100644 index 0000000..d8943a1 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown normaal.png new file mode 100644 index 0000000..8fd2e79 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png new file mode 100644 index 0000000..b94e1df Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf normaal.png new file mode 100644 index 0000000..f3ef1ad Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png new file mode 100644 index 0000000..d10832d Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-DarkGrey-Steel normaal.png b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Steel normaal.png new file mode 100644 index 0000000..dc0d6c6 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-DarkGrey-Steel normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png new file mode 100644 index 0000000..cbdf9f7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png b/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png new file mode 100644 index 0000000..189713a Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png new file mode 100644 index 0000000..3c6e8d7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png new file mode 100644 index 0000000..260f28e Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-Black normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-Black normaal.png new file mode 100644 index 0000000..9b0d748 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-Black normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-Black-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-Black-Date normaal.png new file mode 100644 index 0000000..b424ba1 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-Black-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-Brown-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-Brown-Date normaal.png new file mode 100644 index 0000000..fa82b71 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-Brown-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-Calf-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-Calf-Date normaal.png new file mode 100644 index 0000000..c081792 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-Calf-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue normaal.png new file mode 100644 index 0000000..79c195e Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue-Date normaal.png new file mode 100644 index 0000000..b09c59d Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Green-Steel-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Green-Steel-Date normaal.png new file mode 100644 index 0000000..4815362 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Green-Steel-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-Black normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-Black normaal.png new file mode 100644 index 0000000..deee56f Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-Black normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-Black-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-Black-Date normaal.png new file mode 100644 index 0000000..6c09695 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-Black-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-Brown-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-Brown-Date normaal.png new file mode 100644 index 0000000..2789db1 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-Brown-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-Calf-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-Calf-Date normaal.png new file mode 100644 index 0000000..57b817c Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-Calf-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue normaal.png new file mode 100644 index 0000000..a38d0a7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue-Date normaal.png new file mode 100644 index 0000000..d3065f7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Grey-Steel-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Grey-Steel-Date normaal.png new file mode 100644 index 0000000..0a85be8 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Grey-Steel-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-LighBlue-Steel-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-LighBlue-Steel-Date normaal.png new file mode 100644 index 0000000..594ea33 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-LighBlue-Steel-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-LightBlue-Black normaal.png b/assets/images/media/Morval-Watches2024-V1-LightBlue-Black normaal.png new file mode 100644 index 0000000..9085101 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-LightBlue-Black normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-LightBlue-Calf-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-LightBlue-Calf-Date normaal.png new file mode 100644 index 0000000..e4cce5c Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-LightBlue-Calf-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png b/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png new file mode 100644 index 0000000..edeb083 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue-Date normaal.png new file mode 100644 index 0000000..a4a5ae7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-LightBlue-DarkBlue-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Lightblue-Black-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Lightblue-Black-Date normaal.png new file mode 100644 index 0000000..70ddd78 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Lightblue-Black-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-V1-Lightblue-Brown-Date normaal.png b/assets/images/media/Morval-Watches2024-V1-Lightblue-Brown-Date normaal.png new file mode 100644 index 0000000..cb77fb7 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-V1-Lightblue-Brown-Date normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0010_Grey-Steel normaal.png b/assets/images/media/Morval-Watches2024-_0010_Grey-Steel normaal.png new file mode 100644 index 0000000..cf23bb5 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0010_Grey-Steel normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0011_Grey-Calf normaal.png b/assets/images/media/Morval-Watches2024-_0011_Grey-Calf normaal.png new file mode 100644 index 0000000..f27dc60 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0011_Grey-Calf normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0012_Grey-Brown normaal.png b/assets/images/media/Morval-Watches2024-_0012_Grey-Brown normaal.png new file mode 100644 index 0000000..8693c7e Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0012_Grey-Brown normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0015_Blue-Steel normaal.png b/assets/images/media/Morval-Watches2024-_0015_Blue-Steel normaal.png new file mode 100644 index 0000000..d5d87fe Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0015_Blue-Steel normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0016_Blue-Calf normaal.png b/assets/images/media/Morval-Watches2024-_0016_Blue-Calf normaal.png new file mode 100644 index 0000000..77afdda Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0016_Blue-Calf normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0017_Blue-Brown normaal.png b/assets/images/media/Morval-Watches2024-_0017_Blue-Brown normaal.png new file mode 100644 index 0000000..dd790eb Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0017_Blue-Brown normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0020_Green-Steel normaal.png b/assets/images/media/Morval-Watches2024-_0020_Green-Steel normaal.png new file mode 100644 index 0000000..bc16af0 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0020_Green-Steel normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0021_Green-Calf normaal.png b/assets/images/media/Morval-Watches2024-_0021_Green-Calf normaal.png new file mode 100644 index 0000000..0117c40 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0021_Green-Calf normaal.png differ diff --git a/assets/images/media/Morval-Watches2024-_0022_Green-Brown normaal.png b/assets/images/media/Morval-Watches2024-_0022_Green-Brown normaal.png new file mode 100644 index 0000000..2511a89 Binary files /dev/null and b/assets/images/media/Morval-Watches2024-_0022_Green-Brown normaal.png differ diff --git a/assets/images/media/Morval_achterkant.png b/assets/images/media/Morval_achterkant.png new file mode 100644 index 0000000..4f72459 Binary files /dev/null and b/assets/images/media/Morval_achterkant.png differ diff --git a/assets/images/media/SP1.jpg b/assets/images/media/SP1.jpg new file mode 100644 index 0000000..ebb548d Binary files /dev/null and b/assets/images/media/SP1.jpg differ diff --git a/assets/images/media/band_black.png b/assets/images/media/band_black.png new file mode 100644 index 0000000..da12733 Binary files /dev/null and b/assets/images/media/band_black.png differ diff --git a/assets/images/media/band_black_croc.png b/assets/images/media/band_black_croc.png new file mode 100644 index 0000000..f16ddef Binary files /dev/null and b/assets/images/media/band_black_croc.png differ diff --git a/assets/images/media/band_blue.png b/assets/images/media/band_blue.png new file mode 100644 index 0000000..482a3cb Binary files /dev/null and b/assets/images/media/band_blue.png differ diff --git a/assets/images/media/band_dark_brown.png b/assets/images/media/band_dark_brown.png new file mode 100644 index 0000000..9cd738f Binary files /dev/null and b/assets/images/media/band_dark_brown.png differ diff --git a/assets/images/media/band_light_brown.png b/assets/images/media/band_light_brown.png new file mode 100644 index 0000000..2fc5545 Binary files /dev/null and b/assets/images/media/band_light_brown.png differ diff --git a/assets/images/media/band_steel.png b/assets/images/media/band_steel.png new file mode 100644 index 0000000..2501ebc Binary files /dev/null and b/assets/images/media/band_steel.png differ diff --git a/assets/images/media/morval-crown.jpg b/assets/images/media/morval-crown.jpg new file mode 100644 index 0000000..ac92362 Binary files /dev/null and b/assets/images/media/morval-crown.jpg differ diff --git a/assets/images/media/morval_band_connect1.jpg b/assets/images/media/morval_band_connect1.jpg new file mode 100644 index 0000000..1d5c2c5 Binary files /dev/null and b/assets/images/media/morval_band_connect1.jpg differ diff --git a/assets/images/media/morval_band_connect2.jpg b/assets/images/media/morval_band_connect2.jpg new file mode 100644 index 0000000..6ede1a2 Binary files /dev/null and b/assets/images/media/morval_band_connect2.jpg differ diff --git a/assets/images/media/morval_box.jpg b/assets/images/media/morval_box.jpg new file mode 100644 index 0000000..2acddc2 Binary files /dev/null and b/assets/images/media/morval_box.jpg differ diff --git a/assets/images/media/morval_closure.jpg b/assets/images/media/morval_closure.jpg new file mode 100644 index 0000000..299eba1 Binary files /dev/null and b/assets/images/media/morval_closure.jpg differ diff --git a/cartest_manage.php b/cartest_manage.php index b58f819..6a7c375 100644 --- a/cartest_manage.php +++ b/cartest_manage.php @@ -251,14 +251,20 @@ foreach($arrayQuestions_cartest as $group){ $view .= ''.$group['Group'].''; } } -$view .= '
'; - +$view .= '
'; + foreach($arrayQuestions_cartest as $group){ if ($group['Group_sequence'] == 1){ + $view .= ''; $view .= '
'; } else { + $view .= ''; $view .= '
'; } diff --git a/contract_manage.php b/contract_manage.php index c097f9c..f2a6042 100644 --- a/contract_manage.php +++ b/contract_manage.php @@ -127,11 +127,8 @@ if ($update_allowed === 1){ $view .= '
'; $view .= ' - '; + '.$tab1.' +
'; $view .='
@@ -257,6 +254,10 @@ $shipto_dropdown = listPartner('shipto',$_SESSION['permission'],$partner_data->s $location_dropdown = listPartner('location',$_SESSION['permission'],$partner_data->location,''); //DISPLAY +$view .= '
+ '.$tab2.' +
'; + $view .= '
'; @@ -273,6 +274,10 @@ $view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/dealer_manage.php b/dealer_manage.php index 7a4170d..395e7f2 100644 --- a/dealer_manage.php +++ b/dealer_manage.php @@ -155,13 +155,7 @@ $view .= '
'; $view .= ' - '; +
'; $view .= '
@@ -190,6 +184,10 @@ $view .= '
$view .= ''; } +$view .= ''; + $view .= '
@@ -325,6 +323,10 @@ $view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/equipment_manage.php b/equipment_manage.php index 3b23636..a44a706 100644 --- a/equipment_manage.php +++ b/equipment_manage.php @@ -157,13 +157,6 @@ if ($update_allowed === 1 || $equipment_owner === 1){ $view .= '
'; -$view .= ' - '; - //create product option list $product_option_list =''; foreach ($products as $product){ @@ -188,7 +181,10 @@ if (isset($products_software) && $products_software !=''){ $product_software_list .= ''; } -$view .= '
+$view .= '
+ '.$tab1.' +
+
- - - - - - - - - - - - '.($update_allowed_special==1? $changelog:'').' -
-
'; +//DISPLAY TAB 3 +$view .= '
+ '.$tab3.' +
+
+
+ + + + + + + + + + + + + + '.($update_allowed_special==1? $changelog:'').' +
+
'; $view .= ''; diff --git a/history_manage.php b/history_manage.php index 536912f..54a97e3 100644 --- a/history_manage.php +++ b/history_manage.php @@ -115,9 +115,7 @@ $view .= '
'; $view .= ' - '; +
'; $view .= '
@@ -152,6 +150,10 @@ $view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/logfile.php b/logfile.php index 5d11d38..39786a1 100644 --- a/logfile.php +++ b/logfile.php @@ -7,12 +7,14 @@ if (isAllowed('logfile',$_SESSION['profile'],$_SESSION['permission'],'R') === 0) exit; } +// Define logs directory path +$logs_dir = __DIR__ . '/log/'; + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // POST HANDLER - Delete all logs //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $delete_message = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_all_logs'])) { - $logs_dir = __DIR__ . '/log/'; $deleted_count = 0; if (is_dir($logs_dir)) { @@ -37,6 +39,28 @@ if (isset($_GET['deleted'])) { $delete_message = "Successfully deleted " . intval($_GET['deleted']) . " log file(s)."; } +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// DOWNLOAD HANDLER +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +if (isset($_GET['download']) && $_GET['download']) { + $filename = $_GET['download']; + $filepath = $logs_dir . $filename; + + // Security check: ensure file exists and is within logs directory + if (file_exists($filepath) && strpos(realpath($filepath), realpath($logs_dir)) === 0) { + // Set headers for file download + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename="' . $filename . '"'); + header('Content-Length: ' . filesize($filepath)); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + + // Output file content + readfile($filepath); + exit; + } +} + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // GET HANDLER //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -45,7 +69,6 @@ if (isset($_GET['deleted'])) { $selected_log = $_GET['log'] ?? ''; // Scan logs directory for all log files -$logs_dir = __DIR__ . '/log/'; $log_files = []; if (is_dir($logs_dir)) { @@ -113,6 +136,9 @@ if (file_exists($filelocation_webserver)){ + @@ -165,6 +191,20 @@ function loadLogFile(filename) { } } +// Download current log file +function downloadLogFile() { + const selector = document.getElementById('log-file-selector'); + const selectedFile = selector.value; + + if (selectedFile) { + const url = new URL(window.location.href); + url.searchParams.set('download', selectedFile); + window.location.href = url.toString(); + } else { + alert('No log file selected to download.'); + } +} + // Refresh log functionality function refreshLog() { const button = event.target.closest('button'); diff --git a/media_manage.php b/media_manage.php index dd3efb4..04945fa 100644 --- a/media_manage.php +++ b/media_manage.php @@ -123,9 +123,7 @@ $view .= '
'; $view .= ' - '; +
'; //Define Service and User enabled $view .= '
@@ -141,6 +139,10 @@ $view .= '
$view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/pricelists_manage.php b/pricelists_manage.php index d0d18a1..ce6c2d4 100644 --- a/pricelists_manage.php +++ b/pricelists_manage.php @@ -179,9 +179,7 @@ $view .= '
'; $view .= ' - '; +
'; //Define Service and User enabled $view .= '
@@ -215,6 +213,10 @@ $view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/product_manage.php b/product_manage.php index 832d21a..b6a5dd6 100644 --- a/product_manage.php +++ b/product_manage.php @@ -159,10 +159,7 @@ $view .= '
'; $view .= ' - '; +
'; $view .= '
@@ -218,7 +215,10 @@ $view .= '
'; -$view .= '
+$view .= '
+ '.$tab4.' +
+
- - +$view .= '
+ '.$tab3.' +
+
+
+ + + + diff --git a/products_attributes_manage.php b/products_attributes_manage.php index 8767555..a73de78 100644 --- a/products_attributes_manage.php +++ b/products_attributes_manage.php @@ -176,9 +176,7 @@ $view .= '
'; $view .= ' - '; +
'; $view .='
@@ -216,6 +214,10 @@ $view .='
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '
diff --git a/products_software_upgrade_paths_manage.php b/products_software_upgrade_paths_manage.php index 46f3ca8..0b2380d 100644 --- a/products_software_upgrade_paths_manage.php +++ b/products_software_upgrade_paths_manage.php @@ -44,7 +44,7 @@ $filter_version_id = $_GET['from_version_id'] ?? $_GET['to_version_id'] ?? $_GET if (isset($_GET['id']) && $_GET['id'] != '') { $api_url = '/v2/products_software_upgrade_paths/rowID=' . $_GET['id']; $response = ioServer($api_url, ''); - var_dump($response); + if (!empty($response)) { $existing = json_decode($response); if (!empty($existing)) { @@ -145,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $api_url = '/v2/products_software_upgrade_paths/'; $result = ioServer($api_url, json_encode($data)); - if ($result) { + if ($result !== 'NOK') { $success = isset($_POST['delete']) ? 3 : (isset($_POST['rowID']) && $_POST['rowID'] != '' ? 2 : 1); header('Location: ' . $url . '&success_msg=' . $success); exit; diff --git a/products_software_version.php b/products_software_version.php index b4da2e4..eb00750 100644 --- a/products_software_version.php +++ b/products_software_version.php @@ -143,7 +143,6 @@ $view = ' Currency Description Active - Actions @@ -151,18 +150,17 @@ $view = ' $all_paths = array_merge($upgrade_paths_from ?: [], $upgrade_paths_to ?: []); if (empty($all_paths)){ - $view .= 'No upgrade paths found.'; + $view .= 'No upgrade paths found.'; } else { foreach ($all_paths as $path){ $view .= ' - + ' . ($version_map[$path->from_version_id] ?? $path->from_version_id) . ' ' . ($version_map[$path->to_version_id] ?? $path->to_version_id) . ' '.$path->price.' '.$path->currency.' '.$path->description.' '.($path->is_active ? 'Yes' : 'No').' - Edit '; } diff --git a/products_software_version_manage.php b/products_software_version_manage.php index 02cb4da..ae22fc7 100644 --- a/products_software_version_manage.php +++ b/products_software_version_manage.php @@ -104,7 +104,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $api_url = '/v2/products_software_versions/'; $result = ioServer($api_url, json_encode($data)); - if ($result) { + if ($result !== 'NOK') { $success = isset($_POST['delete']) ? 3 : (isset($_POST['rowID']) && $_POST['rowID'] != '' ? 2 : 1); header('Location: ' . $url . '&success_msg=' . $success); exit; @@ -147,7 +147,14 @@ $view .= '
- +
+ + + No file selected +
@@ -121,16 +124,6 @@ $view .= '
-
-
-
- -
'; @@ -146,7 +139,6 @@ $view .= ' Mandatory Latest Status - Actions @@ -163,14 +155,13 @@ $view .= ' foreach ($responses as $response){ $view .= ' - + '.$response->name.' '.$response->version.' '.$response->hw_version.' '.($response->mandatory ? 'Yes' : 'No').' '.($response->latest ? 'Yes' : 'No').' '.($response->status ? 'Active' : 'Inactive').' - View '; } diff --git a/profiles.php b/profiles.php index e2ddf85..1d3e377 100644 --- a/profiles.php +++ b/profiles.php @@ -7,6 +7,9 @@ defined(page_security_key) or exit; $domain = getDomainName($_SERVER['SERVER_NAME']); $file = ((file_exists(dirname(__FILE__).'/custom/'.$domain.'/settings/settingsprofiles.php')) ? dirname(__FILE__).'/custom/'.$domain.'/settings/settingsprofiles.php' : dirname(__FILE__).'/settings/settingsprofiles.php'); +// Include settings views globally +include dirname(__FILE__).'/settings/settingsviews.php'; + $page = 'profiles'; //Check if allowed if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){ @@ -20,6 +23,71 @@ $contents = file_get_contents($file); //empty view $view = ''; +// Function to scan for new views and update settingsviews.php +function scan_and_update_views() { + global $all_views; + $new_views = []; + + // Scan root PHP files + $root_files = glob(dirname(__FILE__) . '/*.php'); + foreach ($root_files as $file) { + $filename = basename($file, '.php'); + if ($filename !== 'index' && $filename !== 'login' && $filename !== 'logout') { + $new_views[] = $filename; + } + } + + // Scan API v2 get folder + $get_files = glob(dirname(__FILE__) . '/api/v2/get/*.php'); + foreach ($get_files as $file) { + $filename = basename($file, '.php'); + $new_views[] = $filename; + } + + // Scan API v2 post folder + $post_files = glob(dirname(__FILE__) . '/api/v2/post/*.php'); + foreach ($post_files as $file) { + $filename = basename($file, '.php'); + $new_views[] = $filename; + } + + // Remove duplicates and filter out existing views + $new_views = array_unique($new_views); + $views_to_add = array_diff($new_views, $all_views); + + if (!empty($views_to_add)) { + // Update the all_views array + $all_views = array_merge($all_views, $views_to_add); + sort($all_views); + + // Update settingsviews.php file + $views_file = dirname(__FILE__) . '/settings/settingsviews.php'; + $new_content = ""; + + file_put_contents($views_file, $new_content); + + return count($views_to_add); + } + + return 0; +} + +// Handle view scanning +if (isset($_POST['scan_views'])) { + $added_count = scan_and_update_views(); + header('Location: index.php?page=profiles&views_added=' . $added_count); + exit; +} + // Format key function function format_key($key) { $key = str_replace( @@ -31,57 +99,138 @@ function format_key($key) { } // Format HTML output function function format_var_html($key, $value) { - - include dirname(__FILE__).'/settings/settingsviews.php'; + global $all_views; + + // Ensure all_views is loaded + if (!isset($all_views) || !is_array($all_views)) { + include dirname(__FILE__).'/settings/settingsviews.php'; + } $html = ''; $value = htmlspecialchars(trim($value, '\''), ENT_QUOTES); $profile_contents = explode(',',$value); - - foreach ($all_views as $view){ - $html .= '
'; - if (in_array($view, $profile_contents)){ - $html .= ' '.$view; - } else { - $html .= ' '.$view; - } - $html .= '
'; - } - return $html; + + // Add profile header with bulk select options + $checked_count = count(array_intersect($profile_contents, $all_views)); + $total_count = count($all_views); + + $html .= '
'; + $html .= '

Profile: ' . ucwords(str_replace('_', ' ', $key)) . ' (' . $checked_count . '/' . $total_count . ' selected)

'; + $html .= '
'; + $html .= ' '; + $html .= ''; + $html .= '
'; + + // Create a container for the checkboxes with data attributes for filtering + $html .= '
'; + + // Group views by category for better organization + $grouped_views = []; + foreach ($all_views as $view) { + $category = 'Other'; + if (strpos($view, 'equipment') === 0) $category = 'Equipment'; + elseif (strpos($view, 'product') === 0) $category = 'Products'; + elseif (strpos($view, 'account') === 0) $category = 'Accounts'; + elseif (strpos($view, 'user') === 0) $category = 'Users'; + elseif (strpos($view, 'report') === 0) $category = 'Reports'; + elseif (strpos($view, 'contract') === 0) $category = 'Contracts'; + elseif (strpos($view, 'dealer') === 0) $category = 'Dealers'; + elseif (strpos($view, 'rma') === 0) $category = 'RMA'; + elseif (in_array($view, ['dashboard', 'profile', 'admin', 'settings', 'config'])) $category = 'Core'; + + $grouped_views[$category][] = $view; + } + + // Output grouped checkboxes + foreach ($grouped_views as $category => $views) { + $html .= '
'; + $html .= '
' . $category . '
'; + + foreach ($views as $view) { + $checked = in_array($view, $profile_contents) ? 'checked' : ''; + $html .= '
'; + $html .= ''; + $html .= '
'; + } + + $html .= '
'; + } + + $html .= '
'; + + return $html; } -// Format tabs -function format_tabs($contents) { +// Format tabs and content together (interleaved for collapsible functionality) +function format_tabs_and_content($contents) { + global $all_views; + + // Ensure all_views is loaded + if (!isset($all_views) || !is_array($all_views)) { + include dirname(__FILE__).'/settings/settingsviews.php'; + } + $rows = explode("\n", $contents); - $tab = '
'; - $tab .= 'General'; - for ($i = 0; $i < count($rows); $i++) { - preg_match('/\/\*(.*?)\*\//', $rows[$i], $match); - if ($match) { - $tab .= '' . $match[1] . ''; + $output = ''; + $profile_count = 0; + + // Count profiles for performance warning + foreach ($rows as $row) { + if (preg_match('/\/\*(.*?)\*\//', $row)) { + $profile_count++; } } - $tab .= '
'; - return $tab; -} -// Format form -function format_form($contents) { - $rows = explode("\n", $contents); - $form = '
Each tab represents a profile. Each element in a profile represents a view and or API access.'; + + // Add performance notice for large numbers of profiles + if ($profile_count > 10) { + $output .= '
'; + $output .= ''; + $output .= '

Managing ' . $profile_count . ' profiles.

'; + $output .= ''; + $output .= '
'; + } + + // Start with General tab and its content + $output .= ''; + $output .= ''; + $current_profile = strtolower(str_replace(' ', '_', $tab_match[1])); + $output .= ''; + $output .= '
'; + + return $output; } if (isset($_POST['submit']) && !empty($_POST)) { //remove submit from POST @@ -115,6 +264,16 @@ if (isset($_GET['success_msg'])) { } } +// Handle views added message +if (isset($_GET['views_added'])) { + $added_count = (int)$_GET['views_added']; + if ($added_count > 0) { + $success_msg = $added_count . ' new views added!'; + } else { + $success_msg = 'No new views found. All views are up to date.'; + } +} + template_header('Profiles', 'profiles'); $view .= ' @@ -123,28 +282,81 @@ $view .= '

Profiles

-
-'; +
'; if (isset($success_msg)){ - $view .= '
+ $view .= '

'.$success_msg.'

- +
'; } -$view .= format_tabs($contents); -$view .= '
-
- '; -$view .= format_form($contents); +$view .= format_tabs_and_content($contents); +$view .= ''; +// Add basic JavaScript functionality $view .= ' -
-
- -'; + +'; //Output echo $view; diff --git a/rma_manage.php b/rma_manage.php index b092fe0..4fa7b8d 100644 --- a/rma_manage.php +++ b/rma_manage.php @@ -337,7 +337,11 @@ if($rma['header']['servicereport_available'] == 0 ){ $view .=''.($rma_return_tab2 ?? 'Questions').''; } -$view .= '
'; +$view .= '
'; + +$view .= '
+ '.$tab1.' +
'; $view .= '
@@ -356,6 +360,10 @@ $view .= '
'; +$view .= '
+ '.$tab2.' +
'; + $view .= '
'; if($rma['header']['servicereport_available'] == 0 ){ diff --git a/settings/settingsprofiles.php b/settings/settingsprofiles.php index 5a5768a..a819374 100644 --- a/settings/settingsprofiles.php +++ b/settings/settingsprofiles.php @@ -1,27 +1,27 @@ \ No newline at end of file diff --git a/settings/settingsviews.php b/settings/settingsviews.php index eb78661..014f3a9 100644 --- a/settings/settingsviews.php +++ b/settings/settingsviews.php @@ -4,117 +4,138 @@ // All individual views and APIs - Profile ++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ $all_views = [ - "dashboard", - "profile", - "buildtool", - "sales", - "accounts", "account", - "contracts", - "contract", - "contract_manage", + "account_manage", + "accounts", + "admin", + "api", + "application", + "appointment", + "assets", "billing", - "cartests", + "buildtool", + "buildtool", "cartest", "cartest_manage", - "dealers", - "dealers_media", - "dealer", - "dealer_manage", - "assets", - "equipments", - "equipment", - "equipment_healthindex", - "equipment_data", - "equipment_manage", - "equipment_manage_edit", - "equipments_mass_update", - "histories", - "history", - "history_manage", - "firmwaretool", - "rmas", - "rma", - "rma_manage", - "rma_history", - "rma_history_manage", - "buildtool", - "products", - "products_versions", - "products_software", - "products_software_versions", - "products_software_assignments", - "products_software_version", - "products_software_version_manage", - "products_software_version_access_rules_manage", - "products_software_upgrade_paths_manage", - "products_software_assignments", - "products_attributes", - "products_attributes_items", - "products_attributes_manage", - "products_configurations", - "products_categories", - "products_media", - "product", - "product_manage", - "pricelists", - "pricelists_items", - "pricelists_manage", + "cartests", "catalog", "categories", "category", - "discounts", - "discount", - "shipping", - "shipping_manage", - "servicereports", - "servicereport", - "admin", - "partners", - "partner", - "upgrades", - "users", - "user", - "user_manage", - "communications", + "changelog", + "checkout", + "com_log", "communication", "communication_send", + "communications", + "config", + "contract", + "contract_manage", + "contracts", + "cronjob", + "dashboard", + "dealer", + "dealer_manage", + "dealers", + "dealers_media", + "debug", + "dev", + "discount", + "discounts", + "equipment", + "equipment_data", + "equipment_healthindex", + "equipment_manage", + "equipment_manage_edit", + "equipments", + "equipments_mass_update", + "firmwaretool", + "generate_download_token", + "histories", + "history", + "history_manage", + "identity", + "identity_dealers", + "invoice", + "language", + "logfile", + "mailer", + "maintenance", "marketing", - "reporting", + "media", + "media_manage", + "media_scanner", + "media_upload", + "order", + "orders", + "partner", + "partners", + "placeorder", + "pricelists", + "pricelists_items", + "pricelists_manage", + "product", + "product_manage", + "products", + "products_attributes", + "products_attributes_items", + "products_attributes_manage", + "products_categories", + "products_configurations", + "products_media", + "products_software", + "products_software_assignment", + "products_software_assignments", + "products_software_assignments", + "products_software_licenses", + "products_software_upgrade_paths", + "products_software_upgrade_paths_manage", + "products_software_version", + "products_software_version_access_rules_manage", + "products_software_version_manage", + "products_software_versions", + "products_versions", + "profile", + "profiles", + "register", + "render_service_report", "report_build", "report_contracts_billing", "report_healthindex", "report_usage", - "config", + "reporting", + "reset", + "rma", + "rma_history", + "rma_history_manage", + "rma_manage", + "rmas", + "sales", + "security", + "servicereport", + "servicereports", "settings", - "logfile", - "changelog", - "language", - "translations", - "translations_details", - "translation_manage", - "media", - "media_upload", - "media_manage", - "media_scanner", - "mailer", - "application", - "maintenance", - "uploader", - "profiles", - "vin", + "shipping", + "shipping_manage", "shopping_cart", - "checkout", - "placeorder", + "software_available", + "software_download", + "software_update", + "tax", "taxes", + "test", "transactions", "transactions_items", - "invoice", - "order", - "orders", - "identity", - "identity_dealers", - "appointment" + "translation_manage", + "translations", + "translations_details", + "unscribe", + "upgrades", + "uploader", + "user", + "user_credentials", + "user_manage", + "users", + "vin", ]; ?> \ No newline at end of file diff --git a/style/admin.css b/style/admin.css index 64d6df1..c05d66f 100644 --- a/style/admin.css +++ b/style/admin.css @@ -4,6 +4,7 @@ --color-green: #005655; --color-red: #a75151; --color-gray: #f9fafb; + --color-gray-extra:#6b788c; --text-color: #555555; --text-color-accent: #4a5361; --text-color-accent-2:#606c7e; @@ -521,7 +522,6 @@ main .content-block { box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06); overflow: hidden; border-radius: 4px; - border: 1px solid #e2e8f0; } main .content-block:has(.sortable) { @@ -531,7 +531,7 @@ main .content-block:has(.sortable) { main .content-block .block-header { position: relative; border-bottom: 1px solid #f0f1f2; - margin-bottom: 20px; + margin-bottom: 10px; padding: 0 15px 15px 15px; margin-left: -15px; margin-right: -15px; @@ -555,7 +555,7 @@ main .content-block .block-header i { main .content-block-wrapper { display: flex; width: 100%; - padding-top: 25px; + padding-top: 5px; } main .content-block-wrapper .content-block { @@ -573,7 +573,7 @@ main .content-block-wrapper .content-block:last-child { } main .tabs { - display: flex; + display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; background-color: #dedfe1; @@ -584,21 +584,36 @@ main .tabs { main .tabs a { display: flex; + justify-content: space-between; + align-items: center; text-decoration: none; - padding: 12px 15px; - border: 0; - color: #6b788c; + padding: 5px; + border: 1px solid #ddd; + color: var(--text-color); font-weight: 500; - font-size: 14px; -} - -main .tabs a:hover { - background-color: #d8dadc; + font-size: 12px; + background-color: #e9e9e9; + cursor: pointer; + position: relative; + transition: background-color 0.3s ease; } main .tabs a.active { - color: var(--text-color-accent); - background-color: var(--color-white); + color: var(--color-white); + background-color: var(--color-green); +} + +main .tabs a::after { + content: "â–¶"; + font-size: 16px; + transition: transform 0.3s ease; + color:var(--color-indicator-1); +} + +main .tabs a.active::after { + content: "â–¼"; + transform: rotate(0deg); + color:var(--color-white); } main .tabs ~ .content-block { @@ -608,6 +623,9 @@ main .tabs ~ .content-block { main .tab-content { display: none; + border-top: none; + overflow: hidden; + transition: max-height 0.3s ease; } main .tab-content.active { @@ -910,7 +928,7 @@ main .media-page .media .image:hover .title { main .order-details .order-detail { display: flex; justify-content: space-between; - padding-bottom: 15px; + padding-bottom: 10px; word-break: break-all; } @@ -997,8 +1015,8 @@ main .manage-order-table .delete-item:hover { .table table thead th, .table table thead td { font-weight: 600; - font-size: 13px; - padding: 16px 20px; + font-size: 12px; + padding: 10px 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; @@ -1032,9 +1050,8 @@ main .manage-order-table .delete-item:hover { } .table table tbody td { - padding: 16px 20px; - font-size: 14px; - color: #334155; + padding: 10px 10px; + font-size: 12px; vertical-align: middle; } @@ -1084,8 +1101,8 @@ main .manage-order-table .delete-item:hover { .status { - padding: 6px 12px; - border-radius: 6px; + padding: 3px 6px; + border-radius: 4px; background-color: #10b981; font-weight: 500; font-size: 12px; @@ -2989,4 +3006,83 @@ main .products .product .price, main .products .products-wrapper .product .price .filter-actions { justify-content: center; } + + /* Fix table scrolling on smaller screens */ + main .content-block { + overflow: visible !important; + padding: 5px; + } + + main .content-block .table { + overflow-x: auto !important; + overflow-y: visible !important; + -webkit-overflow-scrolling: touch; + max-width: 100%; + margin: 0 -10px; /* Extend to container edges */ + padding: 0 10px; + } + + main .content-block .table table { + min-width: 700px; /* Ensure table maintains minimum width */ + width: max-content; /* Allow table to expand naturally */ + } + + /* Ensure table cells don't wrap */ + main .content-block .table table td, + main .content-block .table table th { + white-space: nowrap; + min-width: 80px; + } + + /* Make version columns wider as they contain longer text */ + main .content-block .table table th:first-child, + main .content-block .table table td:first-child, + main .content-block .table table th:nth-child(2), + main .content-block .table table td:nth-child(2) { + min-width: 120px; + } +} + +/* File Upload Button Styles */ +.file-upload-wrapper { + display: flex; + align-items: center; + gap: 15px; + margin-bottom: 15px; +} + +.file-upload-btn { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 10px 10px; + color: white; + border: none; + border-radius: 6px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); +} + +.file-upload-btn:hover { + background: linear-gradient(135deg, #0056b3, #004085); + transform: translateY(-1px); + box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3); +} + +.file-upload-btn:active { + transform: translateY(0); + box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2); +} + +.file-upload-btn i { + font-size: 12px; +} + +.file-upload-info { + font-size: 12px; + color: #6c757d; + font-style: italic; } \ No newline at end of file diff --git a/translation_manage.php b/translation_manage.php index d2a41ec..d780ec4 100644 --- a/translation_manage.php +++ b/translation_manage.php @@ -181,9 +181,7 @@ $view .= '
'; $view .= ' - '; +
'; //Define Service and User enabled $view .= '
@@ -196,6 +194,10 @@ $view .= '
$view .= '
'; +$view .= '
+ '.$tab3.' +
'; + $view .= '