fix(penilai/surveyor): perbaikkan print out dokument jaminan

This commit is contained in:
majid
2025-03-08 01:12:52 +07:00
committed by Daeng Deni Mardaeni
parent d52edb9481
commit 340dce7ed7
26 changed files with 1480 additions and 1478 deletions

View File

@@ -132,65 +132,7 @@
<h2 style="text-transform: uppercase;">DOKUMEN TERLAMPIR</h2>
<table style="width: 100%;">
@if (@isset($dokumen))
@foreach ($dokumen->detail as $detail)
@if (isset($detail->dokumen_jaminan))
<tr>
<td style="width: 20%; padding: 2px;">
{{ $detail->name ?? '' }}
</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">
@php
$dokumen_jaminan = is_string($detail->dokumen_jaminan)
? json_decode($detail->dokumen_jaminan, true)
: [];
$dokumen_jaminan = is_array($dokumen_jaminan)
? $dokumen_jaminan
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_string($detail->dokumen_nomor)
? json_decode($detail->dokumen_nomor, true)
: [];
$dokumen_nomor = is_array($dokumen_nomor) ? $dokumen_nomor : [$detail->dokumen_nomor];
@endphp
@foreach ($dokumen_jaminan as $index => $dokumen)
<div>
@if (!empty($dokumen_nomor[$index]))
<span>{{ $dokumen_nomor[$index] }}</span>
@endif
</div>
@endforeach
</td>
</tr>
@endif
@if (isset($detail->details))
@php
$detailItems = json_decode($detail->details, true);
@endphp
@if (is_array($detailItems))
@foreach ($detailItems as $key => $value)
@if (!is_null($value) && $value !== '')
<tr>
<td style="width: 20%; padding: 2px;">
{{formatLabel($key)}}
</td>
<td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;">
{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
<sup>m2</sup>
@endif
</td>
</tr>
@endif
@endforeach
@endif
@endif
@endforeach
@endif
@include('lpj::component.print-out-dokument')
@if (isset($forminspeksi['perizinan']) && is_array($forminspeksi['perizinan']) && count($forminspeksi['perizinan']) > 0)
@@ -562,60 +504,5 @@
@endif
</tr>
</table>
<div class="page-break"></div>
<div class="section">
<div class="judul">
<h6 class="border" style="text-align: center;">
PETA
</h6>
</div>
<div style="text-align: center">
@php
$fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
// Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
unset($fotoTypes[$key]);
array_unshift($fotoTypes, 'foto_tempat');
}
@endphp
@if (isset($forminspeksi))
@php $counter = 0; @endphp
@foreach ($fotoTypes as $type)
@php
$imagePath = $forminspeksi[$type] ?? null;
@endphp
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
@if ($counter % 2 == 0)
<div class="photo-row clearfix">
@endif
<div class="photo-item border">
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $type }}"
class="photo-image">
<p style="margin: 0; font-size: 12px;">
{{ Str::title(str_replace('_', ' ', $type)) }}
</p>
</div>
@if ($counter % 2 == 1 || $loop->last)
</div>
@endif
@php $counter++; @endphp
@endif
@endforeach
@endif
</div>
</div>
<div class="page-break"></div>
<div class="section">
<div class="judul">
<h6 class="border" style="text-align: center">
FOTO JAMINAN
</h6>
</div>
@include('lpj::penilai.components.foto-jaminan')
</div>
</main>
@include('lpj::penilai.components.footer')