update kertas kerja dan column name table inspeksi
This commit is contained in:
@@ -141,8 +141,8 @@
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
<button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('jenis_asset')">Save</button>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('jenis_asset')">Save</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<em id="error-jenis_asset" class="alert text-danger text-sm"></em>
|
||||
@@ -162,133 +162,90 @@
|
||||
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<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="toggleAlamatVisibility('alamat_sesuai', 'alamat_tidak_sesuai', 'sesuai')"
|
||||
type="radio" class="radio" name="alamat_sesuai" value="sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="toggleAlamatVisibility('alamat_sesuai', 'alamat_tidak_sesuai', 'tidak sesuai')"
|
||||
type="radio" class="radio" name="alamat_sesuai" value="tidak sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="updateAlamatFields('sesuai')"
|
||||
type="radio"
|
||||
class="radio"
|
||||
name="alamat_sesuai"
|
||||
value="sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="updateAlamatFields('tidak sesuai')"
|
||||
type="radio"
|
||||
class="radio"
|
||||
name="alamat_sesuai"
|
||||
value="tidak sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
<em id="error-alamat" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
{{-- Alamat Sesuai --}}
|
||||
<div id="alamat_sesuai" class="grid gap-2 mt-5" style="{{ isset($forminspeksi['asset']['alamat']['sesuai']) ? '' : 'display: none;' }}">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@php
|
||||
$fields = [
|
||||
[
|
||||
'label' => 'Jl.',
|
||||
'value' => $dokumen->address ?? '',
|
||||
'name' => 'nama_jalan',
|
||||
'readonly' => false,
|
||||
],
|
||||
[
|
||||
'label' => 'Provinsi',
|
||||
'value' => $dokumen->province->name ?? '',
|
||||
'name' => 'provinsi',
|
||||
'readonly' => true,
|
||||
],
|
||||
[
|
||||
'label' => 'Kota/Kabupaten',
|
||||
'value' => $dokumen->city->name ?? '',
|
||||
'name' => 'kota_kabupaten',
|
||||
'readonly' => true,
|
||||
],
|
||||
[
|
||||
'label' => 'Kecamatan',
|
||||
'value' => $dokumen->district->name ?? '',
|
||||
'name' => 'kecamatan',
|
||||
'readonly' => true,
|
||||
],
|
||||
[
|
||||
'label' => 'Kelurahan',
|
||||
'value' => $dokumen->village->name ?? '',
|
||||
'name' => 'desa_kelurahan',
|
||||
'readonly' => true,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@foreach ($fields as $field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $field['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" class="input" name="{{ $field['name'] }}"
|
||||
value="{{ $field['value'] }}" {{ $field['readonly'] ? 'readonly' : '' }}>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
{{-- Alamat Tidak Sesuai --}}
|
||||
<div id="alamat_tidak_sesuai" class="grid gap-2 mt-5" style="{{ isset($forminspeksi['asset']['alamat']['tidak sesuai']) ? '' : 'display: none;' }}"">
|
||||
<div id="alamat_form" class="grid gap-2 mt-5">
|
||||
@php
|
||||
$inputDataLokasi = [
|
||||
['label' => 'Jl.', 'id' => 'address', 'name' => 'address', 'type' => 'text'],
|
||||
$fields = [
|
||||
[
|
||||
'label' => 'Jl.',
|
||||
'name' => 'nama_jalan',
|
||||
'id' => 'nama_jalan',
|
||||
'readonly' => false,
|
||||
],
|
||||
[
|
||||
'label' => 'Provinsi',
|
||||
'id' => 'province_code',
|
||||
'name' => 'provinsi',
|
||||
'id' => 'provinsi',
|
||||
'type' => 'select',
|
||||
'options' => $provinces,
|
||||
],
|
||||
[
|
||||
'label' => 'Kota/Kabupaten',
|
||||
'id' => 'city_code',
|
||||
'name' => 'kota_kabupaten',
|
||||
'id' => 'kota_kabupaten',
|
||||
'type' => 'select',
|
||||
'options' => $provinces,
|
||||
],
|
||||
[
|
||||
'label' => 'Kecamatan',
|
||||
'id' => 'district_code',
|
||||
'name' => 'kecamatan',
|
||||
'id' => 'kecamatan',
|
||||
'type' => 'select',
|
||||
'options' => $provinces,
|
||||
],
|
||||
[
|
||||
'label' => 'Desa/Kelurahan',
|
||||
'id' => 'village_code',
|
||||
'label' => 'Kelurahan',
|
||||
'name' => 'desa_kelurahan',
|
||||
'id' => 'desa_kelurahan',
|
||||
'type' => 'select',
|
||||
'options' => $provinces,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($inputDataLokasi as $item)
|
||||
@foreach ($fields as $field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<label class="form-label max-w-56">{{ $field['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if ($item['type'] === 'text')
|
||||
<input id="{{ $item['id'] }}" name="{{ $item['name'] }}" class="input">
|
||||
@else
|
||||
<select id="{{ $item['id'] }}" name="{{ $item['name'] }}"
|
||||
class="select w-full">
|
||||
<option value="">{{ $item['label'] }}</option>
|
||||
@if ($item['id'] === 'province_code')
|
||||
@foreach ($item['options'] as $option)
|
||||
<option value="{{ $option->code }}">{{ $option->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($field['type']) && $field['type'] === 'select')
|
||||
<select id="{{ $field['id'] }}" name="{{ $field['name'] }}" class="select w-full">
|
||||
<option value="">{{ $field['label'] }}</option>
|
||||
@foreach ($field['options'] as $option)
|
||||
<option value="{{ $option->code }}">{{ $option->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input type="text" id="{{ $field['id'] }}" name="{{ $field['name'] }}" class="input"
|
||||
{{ $field['readonly'] ? 'readonly' : '' }}>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user