mengubah dropdown multiple ijin usaha dan jenis aset menjadi bisa klik silang ketika tidak mau dipilih di menu kjpp

This commit is contained in:
2024-09-27 17:33:18 +07:00
parent 03562a5d3e
commit fde570f8d6

View File

@@ -347,20 +347,14 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select name="ijin_usaha_id[]" multiple="multiple" <select name="ijin_usaha_id[]" multiple="multiple"
class="input tomselect w-full @error('ijin_usaha_id') border-danger @enderror"> class="input tomselect w-full @error('ijin_usaha_id') border-danger @enderror"
id="ijin_usaha_select">
<option value="">Pilih Ijin Usaha</option> <option value="">Pilih Ijin Usaha</option>
@foreach ($ijin_usaha as $row) @foreach ($ijin_usaha as $row)
@if (isset($kjpp->ijin_usaha_id)) <option value="{{ $row->code }}"
<option value="{{ $row->code }}" {{ isset($kjpp->ijin_usaha_id) ? (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '') : (in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '') }}>
{{ in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '' }}> {{ $row->name }}
{{ $row->name }} </option>
</option>
@else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach @endforeach
</select> </select>
</div> </div>
@@ -374,20 +368,14 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select name="jenis_aset_id[]" multiple="multiple" <select name="jenis_aset_id[]" multiple="multiple"
class="input tomselect w-full @error('jenis_aset_id') border-danger @enderror"> class="input tomselect w-full @error('jenis_aset_id') border-danger @enderror"
id="jenis_aset_select">
<option value="">Pilih Jenis Aset</option> <option value="">Pilih Jenis Aset</option>
@foreach ($jenis_aset as $row) @foreach ($jenis_aset as $row)
@if (isset($kjpp->jenis_aset_id)) <option value="{{ $row->code }}"
<option value="{{ $row->code }}" {{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id ?? '[]', true))) ? 'selected' : '' }}>
{{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true))) ? 'selected' : '' }}> {{ $row->name }}
{{ $row->name }} </option>
</option>
@else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('jenis_aset_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach @endforeach
</select> </select>
</div> </div>