fix(surveyor):perbaikkan alamat
This commit is contained in:
@@ -1551,7 +1551,7 @@ class SurveyorController extends Controller
|
||||
|
||||
// Jika alamat tidak sesuai, override dengan kode dari alamat
|
||||
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? null;
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? $forminspeksi['asset']['alamat']['sesuai'] ?? [];
|
||||
|
||||
if ($cekAlamat) {
|
||||
$provinceCode = $cekAlamat['province_code'] ?? $provinceCode;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province_code" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full" onchange="getCity(this.value)">
|
||||
|
||||
<option value="">Pilih Provinsi</option>
|
||||
@foreach ($provinces as $item)
|
||||
@@ -62,17 +62,12 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city_code" class="form-label max-w-56">Kota/Kabupaten</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full" onchange="getDistrict(this.value)">
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if(isset($cities))
|
||||
@foreach ($cities as $item)
|
||||
<option value="{{ $item->code }}" {{ $cekAlamat['city_code'] == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,13 +75,9 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full" onchange="getVillage(this.value)">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if(isset($districts))
|
||||
@foreach ($districts as $item)
|
||||
<option value="{{ $item->code }}" {{ ($cekAlamat['district_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,11 +87,7 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if(isset($villages))
|
||||
@foreach ($villages as $item)
|
||||
<option value="{{ $item->code }}" {{ ($cekAlamat['village_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user