Address: changed country to country_id with Country table

This commit is contained in:
Frank Schubert
2024-02-20 20:20:48 +01:00
parent c83fc9bcca
commit 20163e6008
20 changed files with 455 additions and 54 deletions
+6 -1
View File
@@ -89,7 +89,11 @@
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="country">Land</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="country" id="country" value="<?=$address->country?>">
<select name="country_id" id="country_id" class="form-control">
<?php foreach(CountryModel::getAll() as $country): ?>
<option value="<?=$country->id?>" <?=(($address && $address->country_id == $country->id) || ((!$address || !$address->country_id) && $country->name == "Österreich")) ? "selected='selected'" : ""?>><?=$country->name?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group row">
@@ -449,6 +453,7 @@
placeholder: ""
});
$("#addresstypes").select2();
$("#country_id").select2();
function validateIbanFormat(iban) {