Mengubah tampilan show KJPP dan Create/Edit KJPP

This commit is contained in:
2024-09-30 13:04:50 +07:00
parent fde570f8d6
commit 6558d8348b
5 changed files with 85 additions and 46 deletions

View File

@@ -51,7 +51,7 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Jenis Kantor</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('jenis_kantor') border-danger @enderror"
<select id="jenis_kantor" class="select w-full @error('jenis_kantor') border-danger @enderror"
name="jenis_kantor">
<option value="">Pilih Jenis Kantor</option>
@if (isset($branch))
@@ -78,7 +78,8 @@
</div>
<label class="form-label max-w-56">Nomor Ijin Usaha</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect @error('nomor_ijin_usaha') border-danger @enderror"
<select id="nomor_ijin_usaha"
class="select w-full @error('nomor_ijin_usaha') border-danger @enderror"
name="nomor_ijin_usaha">
<option value="">Pilih Nomor Ijin Usaha</option>
@if (isset($ijin_usaha))
@@ -357,10 +358,10 @@
</option>
@endforeach
</select>
@error('ijin_usaha_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@error('ijin_usaha_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
@@ -378,6 +379,9 @@
</option>
@endforeach
</select>
@error('jenis_aset_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">

View File

@@ -149,45 +149,49 @@
Ijin Usaha
</label>
<div class="flex flex-wrap items-baseline w-full">
<select name="ijin_usaha_id[]" multiple="multiple" class="input tomselect w-full" disabled>
<option value="">Pilih Ijin Usaha</option>
@foreach ($ijin_usahas as $row)
@if (isset($kjpp->ijin_usaha_id))
<option value="{{ $row->code }}"
{{ in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true))) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('ijin_usaha_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@endif
@endforeach
</select>
@if (isset($kjpp->ijin_usaha_id))
<div class="flex flex-row space-x-4 text-gray-600 font-medium text-sm gap-1">
@foreach (json_decode($kjpp->ijin_usaha_id, true) as $ijin_code)
@php
$ijin_usaha = $ijin_usahas->firstWhere('code', $ijin_code);
@endphp
@if ($ijin_usaha)
<div
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
{{ $ijin_usaha->name }}
</div>
@endif
@endforeach
</div>
@else
<div class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">No
business license
selected.</div>
@endif
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Pengalaman (Jenis Aset)
</label>
<div class="flex flex-wrap items-baseline w-full">
<select name="jenis_aset_id[]" multiple="multiple" class="input tomselect w-full" disabled>
<option value="">Pilih Jenis Aset</option>
@foreach ($jenis_jaminan as $row)
@if (isset($kjpp->jenis_aset_id))
<option value="{{ $row->code }}"
{{ in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true))) ? 'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->code }}"
{{ in_array($row->code, old('jenis_aset_id', [])) ? 'selected' : '' }}>
{{ $row->name }}
</option>
<div class="flex flex-wrap items-baseline w-full gap-1">
@if (isset($kjpp->jenis_aset_id))
@foreach (json_decode($kjpp->jenis_aset_id, true) as $aset_code)
@php
$jenis_aset = $jenis_jaminan->firstWhere('code', $aset_code);
@endphp
@if ($jenis_aset)
<span
class="flex flex-row space-x-4 text-white font-medium text-sm badge badge-dark dark-mode:badge dark-mode:text-gray-600">
{{ $jenis_aset->name }}
</span>
@endif
@endforeach
</select>
@else
<span class="flex flex-row space-x-4 text-white font-medium text-sm dark-mode:text-gray-600">
No asset type selected.
</span>
@endif
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">