perbaikan form inspeksi dan
This commit is contained in:
@@ -50,15 +50,30 @@
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||
value="{{ old('debitur_perwakilan', isset($forminspeksi['asset']['debitur_perwakilan']) ? implode(', ', $forminspeksi['asset']['debitur_perwakilan']) : '') }}"
|
||||
placeholder="Masukkan Debitur/Perwakilan" />
|
||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn"
|
||||
style="display: none">Hapus</button>
|
||||
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
|
||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||
value="{{ old('debitur_perwakilan.' . $key, $item) }}"
|
||||
placeholder="Masukkan Debitur/Perwakilan" />
|
||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn">Hapus</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||
value="{{ old('debitur_perwakilan') }}" placeholder="Masukkan Debitur/Perwakilan" />
|
||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn"
|
||||
style="display: none">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<button onclick="addClonableItem('perwakilan', 'perwakilan')" type="button" class="btn-md btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
@@ -69,11 +84,11 @@
|
||||
|
||||
|
||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
|
||||
<div class="card-header">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nama Cadeb/Debitur</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="py-4">
|
||||
<h1 class="text-md font-medium text-gray-900">Nama Cadeb/Debitur</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -90,11 +105,10 @@
|
||||
|
||||
|
||||
<div class="card w-full bg-white rounded-lg shadow-md ">
|
||||
<div class="card-header">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Deskripsi Aset jaminan</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Deskripsi Aset jaminan</h1>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Aset</label>
|
||||
@@ -123,7 +137,9 @@
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<div id="jenis_asset" class="flex items-baseline gap-2"
|
||||
@@ -153,11 +169,11 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Alamat</label>
|
||||
<div class="w-full">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ formatAlamat($dokumen) }}
|
||||
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
|
||||
</span>
|
||||
@endforeach
|
||||
|
||||
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
@@ -205,16 +221,15 @@
|
||||
<select id="province_code" name="province_code" class="input w-full">
|
||||
<option value="">Select Province</option>
|
||||
@foreach ($provinces as $province)
|
||||
@if (isset($debitur))
|
||||
<option value="{{ $province->code }}"
|
||||
{{ isset($debitur->province_code) && $debitur->province_code == $province->code ? 'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $province->code }}">
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $province->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['province_code']) && $cekAlamat['province_code'] == $province->code) ||
|
||||
(!isset($cekAlamat['province_code']) && isset($debitur->province_code) && $debitur->province_code == $province->code)
|
||||
)
|
||||
selected
|
||||
@endif>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -227,16 +242,16 @@
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if (isset($cities))
|
||||
@foreach ($cities as $city)
|
||||
@if (isset($debitur))
|
||||
<option value="{{ $city->code }}"
|
||||
{{ isset($debitur->city_code) && $debitur->city_code == $city->code ? 'selected' : '' }}>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $city->code }}">
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $city->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['city_code']) && $cekAlamat['city_code'] == $city->code) ||
|
||||
(!isset($cekAlamat['city_code']) && isset($debitur->city_code) && $debitur->city_code == $city->code)
|
||||
)
|
||||
selected
|
||||
@endif>
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -245,21 +260,23 @@
|
||||
|
||||
<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">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if (isset($data['districts']))
|
||||
@if (isset($districts))
|
||||
@foreach ($districts as $district)
|
||||
@if (isset($debitur))
|
||||
<option value="{{ $district->code }}"
|
||||
{{ isset($debitur->district_code) && $debitur->district_code == $district->code ? 'selected' : '' }}>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $district->code }}">
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $district->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['district_code']) && $cekAlamat['district_code'] == $district->code) ||
|
||||
(!isset($cekAlamat['district_code']) && isset($debitur->district_code) && $debitur->district_code == $district->code)
|
||||
)
|
||||
selected
|
||||
@endif>
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
@@ -274,16 +291,16 @@
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if (isset($villages))
|
||||
@foreach ($villages as $village)
|
||||
@if (isset($debitur))
|
||||
<option value="{{ $village->code }}"
|
||||
{{ isset($debitur->village_code) && $debitur->village_code == $village->code ? 'selected' : '' }}>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $village->code }}">
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $village->code }}"
|
||||
@if (
|
||||
(isset($cekAlamat['village_code']) && $cekAlamat['village_code'] == $village->code) ||
|
||||
(!isset($cekAlamat['village_code']) && isset($debitur->village_code) && $debitur->village_code == $village->code)
|
||||
)
|
||||
selected
|
||||
@endif>
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
@@ -301,10 +318,10 @@
|
||||
|
||||
|
||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Titik Koordinat Google Maps</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Titik Koordinat Google Maps</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kordinat</label>
|
||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||
@@ -326,6 +343,9 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div data-accordion="true">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@@ -334,7 +354,7 @@
|
||||
<button class="accordion-toggle py-4 group "
|
||||
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
|
||||
<span class="text-base text-gray-900 font-medium">
|
||||
Status Kepemilikan
|
||||
Dokument Kepemilikan
|
||||
</span>
|
||||
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
||||
</i>
|
||||
@@ -455,20 +475,20 @@
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<select id="hub_cadeb_tidak_sesuai"
|
||||
class="input w-full
|
||||
name="hub_cadeb_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb', $selectedData ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
|
||||
<select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubCadeb']))
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ old('hub_cadeb_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<em id="error-hub_cadeb" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@@ -487,7 +507,7 @@
|
||||
<div class="flex flex-wrap items-baseline w-full text-sm">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
{{ $dokumen->penghuni->hubungan_penghuni->name ?? 'N/A' }}
|
||||
<input type="hidden" name="hub_cadeb_penguhuni_sesuai"
|
||||
<input type="hidden" name="hub_cadeb_penghuni_sesuai"
|
||||
value="{{ isset($dokumen->penghuni->hubungan_penghuni->name) ?? '' }}"
|
||||
id="">
|
||||
@endforeach
|
||||
@@ -496,17 +516,20 @@
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_cadeb_Penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb_penghuni" value="sesuai"
|
||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'])) ? 'checked' : '' }}>
|
||||
|
||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni'])) ? 'checked' : '' }}>
|
||||
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni', 'hub_cadeb_Penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb_penghuni" value="tidak sesuai"
|
||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
{{ old('hub_cadeb_penghuni', $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'] ?? false) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@@ -516,15 +539,15 @@
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<select id="hub_cadeb_Penghuni_tidak_sesuai"
|
||||
<select id="hub_penghuni_tidak_sesuai"
|
||||
class="input w-full
|
||||
name="hub_cadeb_Penghuni_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb', $selectedData) ? '' : 'display: none;' }}">
|
||||
name="hub_penghuni_tidak_sesuai"
|
||||
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubPenghuni']))
|
||||
@foreach ($basicData['hubPenghuni'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_Penghuni_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_Penghuni_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ old('hub_penghuni_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user