Refactor software version update logic into a reusable function; enhance UI for file uploads and table responsiveness

This commit is contained in:
“VeLiTi”
2025-12-16 16:18:24 +01:00
parent a9f623cf22
commit 3693b52886
7 changed files with 243 additions and 72 deletions

View File

@@ -143,7 +143,6 @@ $view = '
<th>Currency</th>
<th>Description</th>
<th>Active</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@@ -151,18 +150,17 @@ $view = '
$all_paths = array_merge($upgrade_paths_from ?: [], $upgrade_paths_to ?: []);
if (empty($all_paths)){
$view .= '<tr><td colspan="7">No upgrade paths found.</td></tr>';
$view .= '<tr><td colspan="6">No upgrade paths found.</td></tr>';
} else {
foreach ($all_paths as $path){
$view .= '
<tr>
<tr onclick="window.location.href=\'index.php?page=products_software_upgrade_paths_manage&id='.$path->rowID.'\'" style="cursor: pointer;">
<td>' . ($version_map[$path->from_version_id] ?? $path->from_version_id) . '</td>
<td>' . ($version_map[$path->to_version_id] ?? $path->to_version_id) . '</td>
<td>'.$path->price.'</td>
<td>'.$path->currency.'</td>
<td>'.$path->description.'</td>
<td>'.($path->is_active ? 'Yes' : 'No').'</td>
<td><a href="index.php?page=products_software_upgrade_paths_manage&id='.$path->rowID.'" class="btn_link">Edit</a></td>
</tr>
';
}