Memperbaiki Label Jenis Kantor Pada Edit Create, ijin usaha dan jenis aset dari tombol switch menjadi multiple dropdown

This commit is contained in:
2024-09-27 09:26:32 +07:00
parent 2378791177
commit 04cecf97bd
2 changed files with 69 additions and 50 deletions

View File

@@ -49,11 +49,11 @@
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kantor Cabang</label> <label class="form-label max-w-56">Jenis Kantor</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('jenis_kantor') border-danger @enderror" <select class="input tomselect @error('jenis_kantor') border-danger @enderror"
name="jenis_kantor"> name="jenis_kantor">
<option value="">Pilih Kantor Cabang</option> <option value="">Pilih Jenis Kantor</option>
@if (isset($branch)) @if (isset($branch))
@if (isset($kjpp)) @if (isset($kjpp))
@foreach ($branch as $branches) @foreach ($branch as $branches)
@@ -345,46 +345,51 @@
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Ijin Usaha Ijin Usaha
</label> </label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5"> <div class="flex flex-wrap items-baseline w-full">
@foreach ($ijin_usaha as $row) <select name="ijin_usaha_id[]" multiple="multiple"
<label class="switch"> class="input tomselect w-full @error('ijin_usaha_id') border-danger @enderror">
<option value="">Pilih Ijin Usaha</option>
@foreach ($ijin_usaha as $row)
@if (isset($kjpp->ijin_usaha_id)) @if (isset($kjpp->ijin_usaha_id))
<input type="checkbox" <option value="{{ $row->code }}"
@if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif {{ in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '' }}>
value="{{ $row->code }}" name="ijin_usaha_id[]" /> {{ $row->name }}
</option>
@else @else
<input type="checkbox" <option value="{{ $row->code }}"
@if (in_array($row->code, old('ijin_usaha_id', []))) {{ 'checked' }} @endif {{ in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '' }}>
value="{{ $row->code }}" name="ijin_usaha_id[]" /> {{ $row->name }}
</option>
@endif @endif
<span class="switch-label"> @endforeach
{{ $row->name }} </select>
</span>
</label>
@endforeach
</div> </div>
@error('ijin_usaha_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Pengalaman (Jenis Aset) Pengalaman (Jenis Aset)
</label> </label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5"> <div class="flex flex-wrap items-baseline w-full">
@foreach ($jenis_aset as $row) <select name="jenis_aset_id[]" multiple="multiple"
<label class="switch"> class="input tomselect w-full @error('jenis_aset_id') border-danger @enderror">
<option value="">Pilih Jenis Aset</option>
@foreach ($jenis_aset as $row)
@if (isset($kjpp->jenis_aset_id)) @if (isset($kjpp->jenis_aset_id))
<input type="checkbox" <option value="{{ $row->code }}"
@if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif {{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true))) ? 'selected' : '' }}>
value="{{ $row->code }}" name="jenis_aset_id[]" /> {{ $row->name }}
</option>
@else @else
<input type="checkbox" <option value="{{ $row->code }}"
@if (in_array($row->code, old('jenis_aset_id', []))) {{ 'checked' }} @endif {{ in_array($row->code, old('jenis_aset_id', [])) ? 'selected' : '' }}>
value="{{ $row->code }}" name="jenis_aset_id[]" /> {{ $row->name }}
</option>
@endif @endif
<span class="switch-label"> @endforeach
{{ $row->name }} </select>
</span>
</label>
@endforeach
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">

View File

@@ -148,32 +148,46 @@
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Ijin Usaha Ijin Usaha
</label> </label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5"> <div class="flex flex-wrap items-baseline w-full">
@foreach ($ijin_usahas as $row) <select name="ijin_usaha_id[]" multiple="multiple" class="input tomselect w-full" disabled>
<label class="switch"> <option value="">Pilih Ijin Usaha</option>
<input type="checkbox" @if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif @foreach ($ijin_usahas as $row)
value="{{ $row->code }}" name="ijin_usaha_id[]" disabled="" /> @if (isset($kjpp->ijin_usaha_id))
<span class="switch-label"> <option value="{{ $row->code }}"
{{ $row->name }} {{ in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '' }}>
</span> {{ $row->name }}
</label> </option>
@endforeach @else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach
</select>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Pengalaman (Jenis Aset) Pengalaman (Jenis Aset)
</label> </label>
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5"> <div class="flex flex-wrap items-baseline w-full">
@foreach ($jenis_jaminan as $row) <select name="jenis_aset_id[]" multiple="multiple" class="input tomselect w-full" disabled>
<label class="switch"> <option value="">Pilih Jenis Aset</option>
<input type="checkbox" @if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif @foreach ($jenis_jaminan as $row)
value="{{ $row->code }}" name="jenis_aset_id[]" disabled="" /> @if (isset($kjpp->jenis_aset_id))
<span class="switch-label"> <option value="{{ $row->code }}"
{{ $row->name }} {{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true))) ? 'selected' : '' }}>
</span> {{ $row->name }}
</label> </option>
@endforeach @else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('jenis_aset_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach
</select>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">