461 lines
23 KiB
PHP
461 lines
23 KiB
PHP
|
|
<div class="card-header bg-agi-50">
|
|
<h3 class="card-title">Data Pembanding</h3>
|
|
<div class="flex items-center gap-2">
|
|
<a href="{{ route('surveyor.show', ['id' => $permohonan->id]) }}"
|
|
class="btn btn-xs btn-info">
|
|
<i class="ki-filled ki-exit-left"></i> Kembali
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-header bg-agi-50 py-5 flex-wrap flex justify-end">
|
|
<button type="button" id="addColumnBtn" class="btn btn-primary btn-sm">
|
|
<i class="ki-filled ki-plus"></i> Tambah Pembanding
|
|
</button>
|
|
<button type="button" id="removeColumnBtn" class="btn btn-danger btn-sm ml-2"
|
|
style="display: none;">
|
|
<i class="ki-filled ki-minus"></i> Hapus Pembanding
|
|
</button>
|
|
</div>
|
|
|
|
{{-- @php
|
|
print_r($inspectionData);
|
|
@endphp --}}
|
|
|
|
<div class="card-body">
|
|
<div class="scrollable-x-auto">
|
|
<table id="dataTable"
|
|
class="table table-auto table-border align-middle text-gray-700 font-medium text-sm">
|
|
<thead class="bg-gray-50 sticky top-0">
|
|
<tr>
|
|
<th class="px-4 py-3 min-w-[200px]">Parameter</th>
|
|
<th class="px-4 py-3 min-w-[250px]">Objek Penilaian</th>
|
|
<th class="px-4 py-3 min-w-[250px]">Data Pembanding 1</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- Informasi Dasar -->
|
|
<tr class="bg-gray-100">
|
|
<td colspan="3" class="px-4 py-2 font-semibold">Informasi Dasar</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Foto</td>
|
|
<td class="px-4 py-2">
|
|
<div class="flex flex-col gap-2">
|
|
<img id="uploadedImage1"
|
|
src="{{ isset($fotoForm['object_jaminan'][0]['foto_objek']) ? asset('storage/' . $fotoForm['object_jaminan'][0]['foto_objek']) : '' }}"
|
|
class="max-w-[200px] {{ isset($fotoForm['object_jaminan'][0]['foto_objek']) ? '' : 'hidden' }}"
|
|
alt="Uploaded Image">
|
|
<input type="file" name="foto_objek" class="file-input"
|
|
accept="image/*" onchange="previewImage(this, 'uploadedImage1')">
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-4 py-2">
|
|
<div class="flex flex-col gap-2">
|
|
<img id="uploadedImage2" class="max-w-[200px] hidden"
|
|
alt="Pembanding Image">
|
|
<input type="file" name="foto_objek_pembanding[]" class="file-input"
|
|
accept="image/*" onchange="previewImage(this, 'uploadedImage2')">
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
|
|
<!-- Data Properti -->
|
|
<tr class="bg-gray-100">
|
|
<td colspan="3" class="px-4 py-2 font-semibold">Data Properti</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Jenis Aset</td>
|
|
<td class="px-4 py-2">
|
|
<select name="jenis_aset" class="select">
|
|
<option value="">Pilih Jenis Aset</option>
|
|
@foreach ($data['jenisJaminan'] as $item)
|
|
<option value="{{ $item->name }}"
|
|
{{ ($inspectionData['asset']['jenis_asset']['sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
|
{{ $item->name }}</option>
|
|
@endforeach
|
|
|
|
</select>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<select name="jenis_aset_pembanding[]" class="select">
|
|
<option value="">Pilih Jenis Aset</option>
|
|
@foreach ($data['jenisJaminan'] as $item)
|
|
<option value="{{ $item->name }}"
|
|
{{ ($inspectionData['jenis_aset'] ?? '') == $item->name ? 'selected' : '' }}>
|
|
{{ $item->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Luas Tanah (m²)</td>
|
|
@php
|
|
$cekLuas =
|
|
isset($inspectionData['tanah']['luas_tanah']) == 'sesuai'
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
|
|
@endphp
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="luas_tanah" class="input number-format"
|
|
value="{{ $inspectionData['tanah']['luas_tanah']['sesuai'] ?? ($inspectionData['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
|
|
<input type="text" name="luas_tanah_pembanding[]"
|
|
class="input number-format">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Luas Bangunan (m²)</td>
|
|
<td class="px-4 py-2">
|
|
@php
|
|
$luasTanahData = $inspectionData['bangunan']['luas_tanah_bagunan'];
|
|
$nilai = 'N/A';
|
|
|
|
if (!empty($luasTanahData['sesuai'])) {
|
|
$nilai = $luasTanahData['sesuai'];
|
|
} elseif (!empty($luasTanahData['tidak sesuai'])) {
|
|
$nilai = $luasTanahData['tidak sesuai'];
|
|
}
|
|
@endphp
|
|
<input type="text"
|
|
name="luas_tanah_bagunan"
|
|
class="input number-format"
|
|
value="{{ $nilai }}">
|
|
</td>
|
|
|
|
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="luas_bangunan_pembanding[]"
|
|
class="input number-format">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<!-- Informasi Harga -->
|
|
<tr class="bg-gray-100">
|
|
<td colspan="3" class="px-4 py-2 font-semibold">Informasi</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Hak atas properti yang dialihkan</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="hak_properti" class="input"
|
|
value="{{ $inspectionData['asset']['hak_properti'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="hak_properti_pembanding[]"
|
|
class="input">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Penawaran/ Transaksi</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="penawaran" class="input"
|
|
value="{{ $inspectionData['asset']['penawaran'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="penawaran_pembanding[]"
|
|
class="input">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Telepon Contact Person</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="telepon" class="input"
|
|
value="{{ $inspectionData['asset']['telepon'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="telepon_pembanding[]"
|
|
class="input">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Status Narasumber</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="status_nara_sumber" class="input"
|
|
value="{{ $inspectionData['asset']['status_nara_sumber'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="status_nara_sumber_pembanding[]"
|
|
class="input">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Nama Narasumber</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="nama_nara_sumber" class="input"
|
|
value="{{ $inspectionData['asset']['nama_nara_sumber'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="nama_nara_sumber_pembanding[]"
|
|
class="input">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<!-- Lokasi -->
|
|
<tr class="bg-gray-100">
|
|
<td colspan="3" class="px-4 py-2 font-semibold">Lokasi</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Koordinat</td>
|
|
<td class="px-4 py-2">
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<input type="text" name="kordinat_lat" class="input"
|
|
placeholder="Latitude"
|
|
value="{{ $inspectionData['asset']['kordinat_lat'] ?? '' }}">
|
|
<input type="text" name="kordinat_lng" class="input"
|
|
placeholder="Longitude"
|
|
value="{{ $inspectionData['asset']['kordinat_lng'] ?? '' }}">
|
|
</div>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<input type="text" name="kordinat_lat_pembanding[]" class="input"
|
|
placeholder="Latitude">
|
|
<input type="text" name="kordinat_lng_pembanding[]" class="input"
|
|
placeholder="Longitude">
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Alamat</td>
|
|
<td class="px-4 py-2">
|
|
@php
|
|
$statusAlamat = isset($inspectionData['asset']['alamat']['sesuai'])
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$address =
|
|
$inspectionData['asset']['alamat'][$statusAlamat]['address'] ??
|
|
null;
|
|
@endphp
|
|
<textarea name="address" class="input py-2" rows="2">{{ $address }}</textarea>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<textarea name="address_pembanding[]" class="input py-2" rows="2"></textarea>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Provinsi</td>
|
|
<td class="px-4 py-2">
|
|
<select id="province_code" name="province_code" class="input w-full">
|
|
@php
|
|
$statusKey = isset($inspectionData['asset']['alamat']['sesuai'])
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$address =
|
|
$inspectionData['asset']['alamat'][$statusKey][
|
|
'province_code'
|
|
] ?? null;
|
|
@endphp
|
|
<option value="">Select Province</option>
|
|
@foreach ($provinces as $province)
|
|
@php
|
|
$statusKey = isset(
|
|
$inspectionData['asset']['alamat']['sesuai'],
|
|
)
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$selectedProvince =
|
|
$inspectionData['asset']['alamat'][$statusKey][
|
|
'province_code'
|
|
] ?? null;
|
|
@endphp
|
|
|
|
<option value="{{ $province->code }}"
|
|
{{ $selectedProvince == $province->code ? 'selected' : '' }}>
|
|
{{ $province->name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<select id="province_code_pembanding" name="province_code_pembanding[]"
|
|
onchange="handleProvinceChange(this)" class="input w-full">
|
|
<option value="">Pilih Provinsi</option>
|
|
@foreach ($provinces as $province)
|
|
<option value="{{ $province->code }}">{{ $province->name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Kabupaten/Kota</td>
|
|
<td class="px-4 py-2">
|
|
<select id="city_code" name="city_code" class="select w-full">
|
|
@php
|
|
|
|
$statusKey = isset($inspectionData['asset']['alamat']['sesuai'])
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$selectedCity =
|
|
$inspectionData['asset']['alamat'][$statusKey][
|
|
'city_code'
|
|
] ?? null;
|
|
@endphp
|
|
<option value="">Pilih Kota/Kabupaten</option>
|
|
@if (isset($selectedCity))
|
|
@foreach ($cities as $city)
|
|
<option value="{{ $city->code }}"
|
|
{{ $selectedCity == $city->code ? 'selected' : '' }}>
|
|
{{ $city->name }}
|
|
</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<select id="city_code_pembanding" name="city_code_pembanding[]"
|
|
onchange="handleCityChange(this)" class="input w-full">
|
|
<option value="">Pilih Kota/Kabupaten</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Kecamatan</td>
|
|
<td class="px-4 py-2">
|
|
<select id="district_code" name="district_code" class="select w-full">
|
|
@php
|
|
|
|
$statusKey = isset($inspectionData['asset']['alamat']['sesuai'])
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$selectedDisrict =
|
|
$inspectionData['asset']['alamat'][$statusKey][
|
|
'district_code'
|
|
] ?? null;
|
|
@endphp
|
|
<option value="">Pilih Kecamatan</option>
|
|
@if (isset($selectedDisrict))
|
|
@foreach ($districts as $district)
|
|
<option value="{{ $district->code }}"
|
|
{{ $selectedDisrict == $district->code ? 'selected' : '' }}>
|
|
{{ $district->name }}
|
|
</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
|
|
<select id="district_code_pembanding" name="district_code_pembanding[]"
|
|
onchange="handleDistrictChange(this)" class="input w-full">
|
|
<option value="">Pilih Kecamatan</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Desa/Kelurahan</td>
|
|
<td class="px-4 py-2">
|
|
<select id="village_code" name="village_code" class="select w-full">
|
|
@php
|
|
$statusKey = isset($inspectionData['asset']['alamat']['sesuai'])
|
|
? 'sesuai'
|
|
: 'tidak sesuai';
|
|
$selectedDesa =
|
|
$inspectionData['asset']['alamat'][$statusKey][
|
|
'village_code'
|
|
] ?? null;
|
|
@endphp
|
|
<option value="">Pilih Kecamatan</option>
|
|
@if (isset($selectedDesa))
|
|
@foreach ($villages as $village)
|
|
<option value="{{ $village->code }}"
|
|
{{ $selectedDesa == $village->code ? 'selected' : '' }}>
|
|
{{ $village->name }}
|
|
</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<select id="village_code_pembanding" name="village_code_pembanding[]"
|
|
class="input w-full">
|
|
<option value="">Pilih Desa/Kelurahan</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="bg-gray-100">
|
|
<td colspan="3" class="px-4 py-2 font-semibold">Harga Per Meter</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="px-4 py-2">Harga</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="harga" class="input currency-format"
|
|
value="{{ $inspectionData['asset']['harga'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="harga_pembanding[]"
|
|
class="input currency">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Diskon</td>
|
|
<td class="px-4 py-2">
|
|
<div class="input">
|
|
<input type="text" name="diskon" class=" currency"
|
|
value="{{ $inspectionData['asset']['diskon'] ?? '' }}">
|
|
<span class="btn btn-icon">
|
|
<i class="ki-outline ki-percentage"></i>
|
|
</span>
|
|
</div>
|
|
|
|
</td>
|
|
<td class=" px-4 py-2">
|
|
<div class="input">
|
|
<input type="text" name="diskon_pembanding[]"
|
|
class="currency">
|
|
<span class="btn btn-icon">
|
|
<i class="ki-outline ki-percentage"></i>
|
|
</i>
|
|
</span>
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr style="display: none;">
|
|
<td class="px-4 py-2">Total</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="total" class="input currency"
|
|
value="{{ $inspectionData['asset']['total'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="total_pembanding[]"
|
|
class="input currency-format">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="px-4 py-2">Harga Setelah Diskon</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="harga_diskon" class="input currency-format" readonly
|
|
value="{{ $inspectionData['asset']['harga_diskon'] ?? '' }}">
|
|
</td>
|
|
<td class="px-4 py-2">
|
|
<input type="text" name="harga_diskon_pembanding[]" readonly
|
|
class="input currency-format">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|