fix(surveyor/penilai):perbaikkan pengambilan key luas unit dan handle foto di informasi
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
$total_luas_unit = 0;
|
||||
$jenis_legalitas_jaminan_id = 0;
|
||||
if (isset($item->detail)) {
|
||||
$total_luas_unit = calculateTotalLuas($item->detail, 'luas_tanah', 1, 27, 3);
|
||||
$total_luas_unit = calculateTotalLuas($item->detail, 'luas_bangunan', 1, 27, 3);
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" id="jenis_legalistas_jaminan_unit_id" name="jenis_legalistas_jaminan_unit_id"
|
||||
|
||||
@@ -128,9 +128,9 @@
|
||||
onchange="uploadFile(this, 'upload-gs-preview', 'upload_gs')">
|
||||
|
||||
<img id="upload-gs-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['upload_gs']) && is_string($forminspeksi['upload_gs']) && !empty($forminspeksi['upload_gs']) ? asset('storage/' . $forminspeksi['upload_gs']) : '' }}"
|
||||
alt="Foto Gs" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ isset($forminspeksi['upload_gs']) && is_string($forminspeksi['upload_gs']) && !empty($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,9 +150,9 @@
|
||||
>
|
||||
|
||||
<img id="sentuh_tanahku-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['foto_sentuh_tanahku']) && is_string($forminspeksi['foto_sentuh_tanahku']) && !empty($forminspeksi['foto_sentuh_tanahku']) ? asset('storage/' . $forminspeksi['foto_sentuh_tanahku']) : '' }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) && is_string($forminspeksi['foto_sentuh_tanahku']) && !empty($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -173,9 +173,9 @@
|
||||
onchange="uploadFile(this, 'gistaru-preview', 'foto_gistaru')">
|
||||
|
||||
<img id="gistaru-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['foto_gistaru']) && is_string($forminspeksi['foto_gistaru']) && !empty($forminspeksi['foto_gistaru']) ? asset('storage/' . $forminspeksi['foto_gistaru']) : '' }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) && is_string($forminspeksi['foto_gistaru']) && !empty($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
|
||||
</div>
|
||||
@@ -199,10 +199,15 @@
|
||||
class="file-input file-input-bordered w-full "
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="uploadFile(this, 'bhumi-preview', 'foto_bhumi')">
|
||||
@php
|
||||
$bhumiPath = isset($forminspeksi['foto_bhumi']) && is_string($forminspeksi['foto_bhumi']) && !empty($forminspeksi['foto_bhumi'])
|
||||
? asset('storage/' . $forminspeksi['foto_bhumi'])
|
||||
: '';
|
||||
@endphp
|
||||
<img id="bhumi-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
||||
src="{{ $bhumiPath }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_bhumi']) ? ' ' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ $bhumiPath ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
</div>
|
||||
<a href="https://bhumi.atrbpn.go.id/peta" type="button" class="btn btn-light" target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Bhumi
|
||||
@@ -222,10 +227,16 @@
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="uploadFile(this, 'argis-region-preview', 'foto_argis_region')">
|
||||
@php
|
||||
$argisRegionPath = isset($forminspeksi['foto_argis_region']) && is_string($forminspeksi['foto_argis_region']) && !empty($forminspeksi['foto_argis_region'])
|
||||
? asset('storage/' . $forminspeksi['foto_argis_region'])
|
||||
: '';
|
||||
@endphp
|
||||
|
||||
<img id="argis-region-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
||||
src="{{ $argisRegionPath }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }} max-width: 30rem;">
|
||||
style="{{ $argisRegionPath ? '' : 'display: none;' }} max-width: 30rem;">
|
||||
</div>
|
||||
< </div>
|
||||
</div>
|
||||
@@ -247,19 +258,14 @@
|
||||
</button>
|
||||
</div>
|
||||
@php
|
||||
$fotoTempat = $forminspeksi['foto_tempat'] ?? null;
|
||||
$fotoSrc = '';
|
||||
|
||||
if (is_array($fotoTempat)) {
|
||||
$fotoSrc = asset('storage/' . $fotoTempat[0]);
|
||||
} elseif (!empty($fotoTempat)) {
|
||||
$fotoSrc = asset('storage/' . $fotoTempat);
|
||||
}
|
||||
$fotoTempat = isset($forminspeksi['foto_tempat']) && is_string($forminspeksi['foto_tempat']) && !empty($forminspeksi['foto_tempat'])
|
||||
? asset('storage/' . $forminspeksi['foto_tempat'])
|
||||
: '';
|
||||
@endphp
|
||||
|
||||
<img id="foto_tempat-preview" src="{{ $fotoSrc ?: '' }}" alt="Foto Tempat"
|
||||
<img id="foto_tempat-preview" src="{{ $fotoTempat ?: '' }}" alt="Foto Tempat"
|
||||
class="mt-2 max-w-full h-auto"
|
||||
style="max-width: 30rem; {{ $fotoSrc ? '' : 'display: none;' }}">
|
||||
style="max-width: 30rem; {{ $fotoTempat ? '' : 'display: none;' }}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -67,19 +67,21 @@
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) && file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
return isset($forminspeksi[$type]) && !empty($forminspeksi[$type]) && is_string($forminspeksi[$type]);
|
||||
});
|
||||
@endphp
|
||||
@foreach ($validPhotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
$imageUrl = is_string($imagePath) ? asset('storage/' . $imagePath) : null;
|
||||
|
||||
@endphp
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<tr>
|
||||
<td style="20%"> {{ $customLabels[$type] ?? '' }}</td>
|
||||
<td width="1%" style="vertical-align: top;"></td>
|
||||
<td style="width: 79%">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imageUrl }}"
|
||||
style="max-height: 400px; height: auto; max-width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user