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