feat: Enhance software tool with country selection and tax calculation

- Added a helper function to generate country select options in software tool.
- Updated user info modal and payment modal to use country dropdowns instead of text inputs.
- Implemented tax calculation based on selected country in payment modal.
- Improved software options loading behavior in debug mode.
- Enhanced description formatting in payment modal.
- Added log modal for equipment updates with a link to view logs.
- Introduced a new countries settings file with tax rates for various countries.
- Minor adjustments to various PHP files for better handling of equipment and payment processes.
This commit is contained in:
“VeLiTi”
2026-01-16 16:01:31 +01:00
parent 7aebb762d3
commit 3db13b9ebf
27 changed files with 652 additions and 114 deletions

View File

@@ -9,6 +9,7 @@ $lang = in_array($lang, $supportedLanguages) ? $lang : 'US';
//INCLUDE THE TRANSLATION
include_once './settings/translations/translations_'.$lang.'.php';
include_once './settings/countries.php';
//=========================================
//GET DOMAIN FOR CORRECT STYLING AND SETTINGS
@@ -537,7 +538,18 @@ echo'
<input type="text" name="city" form="regForm" placeholder="'.$register_3_city.'" value="'.$register['city'].'" required="" class="form-field">
<label for="country" class="form-label">'.$register_3_country.' *</label>
<input type="text" name="country" form="regForm" placeholder="'.$register_3_country.'" value="'.$register['country'].'" required="" class="form-field">
<select name="country" form="regForm" required="" class="form-field">';
// Sort countries alphabetically
usort($countries, function($a, $b) {
return strcmp($a['country'], $b['country']);
});
foreach ($countries as $id => $data) {
$selected = ($register['country'] == $data['country']) ? 'selected' : '';
echo '<option value="' . $data['country'] . '" ' . $selected . '>' . $data['country'] . '</option>';
}
echo '
</select>
<div style="margin-bottom: 15px;">
<input type="checkbox" name="email_consent" form="regForm" checked required/>'.$register_3_email_consent.'<br>