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

@@ -1,3 +1,4 @@
<div class="no-break">
<table style="width: 100%; ">
<tr>
<td style="width: 100%; border: 1px solid #000; text-align: center;">
@@ -80,3 +81,4 @@
</td>
</tr>
</table>
</div>

View File

@@ -1,3 +1,4 @@
<div class="no-break">
<table style="width: 100%; ">
<tr>
<td style="width: 100%; border: 1px solid #000; text-align: center;">
@@ -143,3 +144,4 @@
</table>
</div>

View File

@@ -1,3 +1,4 @@
<div class="no-break">
<table class="judul" style="width: 100%; ">
<tr>
<td style="width: 100%; border: 1px solid #000; text-align: center;">
@@ -102,3 +103,4 @@
</table>
</div>

View File

@@ -1,3 +1,4 @@
<div class="no-break">
<table style="width: 100%">
<tr>
<td width="25%" style="vertical-align: top;">Informasi Dinas Tata Ruang
@@ -58,3 +59,4 @@
</tr>
@endif
</table>
</div>

View File

@@ -1,3 +1,4 @@
<div class="no-break">
<table style="width: 100%; ">
<tr>
<td style="width: 100%; border: 1px solid #000; text-align: center;">
@@ -127,3 +128,4 @@
</tr>
@endif
</table>
</div>

View File

@@ -1,3 +1,4 @@
<div class="no-break">
<table style="width: 100%; ">
<tr>
<td style="width: 100%; border: 1px solid #000; text-align: center;">
@@ -149,3 +150,4 @@
</tr>
</table>
</div>

View File

@@ -1,6 +1,110 @@
<div class="page-break"></div>
<div class="section">
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
<tr>
<td style="width:20%; padding: 2px; border: 1px solid #000">Nama Debitur</td>
<td style=" width: 1%; padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ $permohonan->debiture->name ?? '' }}</td>
</tr>
<tr>
<td style="padding: 2px; border: 1px solid #000">Nomor Laporan</td>
<td style="padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ $nomorLaporan }}</td>
</tr>
<tr>
<td style="padding: 2px; border: 1px solid #000">Tanggal Laporan</td>
<td style="padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
</td>
</tr>
</table>
<table style="width: 100%; ">
<tr>
<td style="border: 1px solid #000; text-align: center;">
PETA DAN BLAD TATA RUANG
</td>
</tr>
</table>
<div>
@php
$fotoTypes = [
'upload_gs',
'foto_sentuh_tanahku',
'foto_gistaru',
'foto_bhumi',
'foto_argis_region',
'foto_tempat',
];
$customLabels = [
'upload_gs' => 'Gambar Situasi',
'foto_sentuh_tanahku' => 'Sentuh Tanahku',
'foto_gistaru' => 'Gistaru',
'foto_bhumi' => 'Bhumi',
'foto_argis_region' => 'Blad Tata Ruang ',
'foto_tempat' => 'Tempat',
];
// Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
unset($fotoTypes[$key]);
array_unshift($fotoTypes, 'upload_gs');
}
// 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]));
});
@endphp
<table width="100%" border="0">
@foreach ($validPhotoTypes as $type)
@php
$imagePath = $forminspeksi[$type] ?? null;
@endphp
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
<tr>
<td style="width: 100%; vertical-align: top; text-align: center" class="photo-item border">
<p style="margin: 0; font-size: 10px; text-align: center;">
{{ $customLabels[$type] ?? '' }}
</p>
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
style="max-height: 400px; height: auto; max-width: 100%;">
</td>
</tr>
@endif
@endforeach
</table>
</div>
<div class="page-break"></div>
<table style="width: 100%; ">
<tr>
<td style="border: 1px solid #000; text-align: center;">
FOTO JAMINAN
</td>
</tr>
</table>
@include('lpj::penilai.components.foto-jaminan')
</div>
</div>
<footer id="footer">
Cabang : {{ $permohonan->debiture->branch->name ?? '' }}
</footer>
<script type="text/php">
if (isset($pdf)) {
$pdf->page_script('
$font = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "normal");
$size = 10;
$pageText = $PAGE_NUM;
$y = 800;
$x = 550;
$pdf->text($x, $y, $pageText, $font, $size);
');
}
</script>
<script>
const datas = @json($forminspeksi);
console.log(datas);

View File

@@ -59,7 +59,7 @@
}
.photo-image {
width: auto;
width: 100;
height: 400px;
max-height: 400px;
}

View File

@@ -52,7 +52,7 @@
text-align: center;
border-top: 1px solid #ddd;
padding-top: 10px;
font-size: 9px;
font-size: 12px;
}
.page-number:after {

View File

@@ -96,58 +96,7 @@
<td style="width: 79%; padding: 2px;">{{ $data ?? '' }}</td>
</tr>
@if (@isset($dokumen))
@foreach ($dokumen->detail as $detail)
<tr>
@if (isset($detail->dokumen_jaminan))
<td style=" padding: 2px;">
{{ $detail->name ?? '' }}
</td>
<td style=" padding: 2px;">:</td>
<td style=" padding: 2px;">
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->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
@endif
</td>
@endif
</tr>
@if (isset($detail->details))
@if (json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '')
<tr>
<td style="padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
<td style=" padding: 2px;">:</td>
<td style="">{{ $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')
<tr>
@@ -157,31 +106,31 @@
</tr>
@if (!empty($memo['lokasi']['address']))
<tr>
<td width="20%">Terletak di</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td> {{ $alamat['address'] ?? '' }}</td>
</tr>
<tr>
<td>Desa/Kelurahan</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['village_code'] ?? '' }}</td>
</tr>
<tr>
<td>Kecamatan</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['district_code'] ?? '' }}</td>
</tr>
<tr>
<td>Kabupaten/Kota</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td> {{ $alamat['city_code'] ?? '' }}</td>
</tr>
<tr>
<td>Provinsi</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['province_code'] ?? '' }}</td>
</tr>
<tr>
<td width="20%">Terletak di</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td> {{ $alamat['address'] ?? '' }}</td>
</tr>
<tr>
<td>Desa/Kelurahan</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['village_code'] ?? '' }}</td>
</tr>
<tr>
<td>Kecamatan</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['district_code'] ?? '' }}</td>
</tr>
<tr>
<td>Kabupaten/Kota</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td> {{ $alamat['city_code'] ?? '' }}</td>
</tr>
<tr>
<td>Provinsi</td>
<td style="width: 1%; vertical-align: top;">:</td>
<td>{{ $alamat['province_code'] ?? '' }}</td>
</tr>
@endif
</table>
@@ -259,7 +208,9 @@
use Modules\Usermanagement\Models\User;
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
$imagePathPenilai = storage_path('app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign);
$imagePathPenilai = storage_path(
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
);
$soUser = User::where('id', $senior_officer->id)->first();
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
@@ -342,17 +293,21 @@
</table>
</tr>
</table>
<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>
<div class="page-break"></div>
<table width="100%" border="0" style="align-content: center; text-align: center; margin-bottom: 20px">
@foreach ($memo['foto'] as $item)
@php
$cleanedPath = str_replace('/storage/', '', $item);
$imagePath = storage_path('app/public/' . $cleanedPath);
@endphp
<tr>
<td style="width: 100%; padding: 10px;" class="photo-item border">
<img src="{{ $imagePath }}" alt="{{ $item }}" class="photo-image">
</td>
</tr>
@endforeach
</table>
@include('lpj::penilai.components.footer')

View File

@@ -100,58 +100,7 @@
</tr>
@endif
@if (@isset($dokumen))
@foreach ($dokumen->detail as $detail)
<tr>
@if (isset($detail->dokumen_jaminan))
<td style=" padding: 2px;">
{{ $detail->name ?? '' }}
</td>
<td style=" padding: 2px;">:</td>
<td style=" padding: 2px;">
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->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
@endif
</td>
@endif
</tr>
@if (isset($detail->details))
@if (json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '')
<tr>
<td style="padding: 2px;"> {{formatLabel($key)}}</td>
<td style=" padding: 2px;">:</td>
<td style="">{{ $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')
<tr>
<td style="width: 20%; padding: 2px;">Tanggal Penilaian</td>
@@ -369,16 +318,6 @@
</tr>
</table>
<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')

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')

View File

@@ -164,55 +164,7 @@
<td style=" padding: 2px; vertical-align: top;">{{ $alamat['province_code'] ?? '' }}</td>
</tr>
@if (@isset($dokumen))
@foreach ($dokumen->detail as $detail)
@if (isset($detail->dokumen_jaminan))
<tr>
<td style="padding: 2px; vertical-align: top;">{{ $detail->name ?? '' }}</td>
<td style="padding: 2px; vertical-align: top;">:</td>
<td style="padding: 2px; vertical-align: top;">
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->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) && json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '')
<tr>
<td style="padding: 2px; vertical-align: top;">
{{formatLabel($key)}}
</td>
<td style="padding: 2px; vertical-align: top;">:</td>
<td style="padding: 2px; vertical-align: top;">
{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
<sup>m2</sup>
@endif
</td>
</tr>
@endif
@endforeach
@endif
@endforeach
@endif
@include('lpj::component.print-out-dokument')
@if (isset($forminspeksi['asset']['nomor_nib']))
<tr>
@@ -1087,88 +1039,5 @@
</td>
</tr>
</table>
<div class="section">
<div class="judul">
<h6 class="border" style="text-align: center;">
PETA
</h6>
</div>
<div class="photo-container">
@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');
}
// 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]));
});
@endphp
<table width="100%" border="0">
<tr>
@if (count($validPhotoTypes) === 1)
@php
$type = reset($validPhotoTypes);
$imagePath = $forminspeksi[$type] ?? null;
@endphp
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
class="photo-item border">
<p style="margin: 0; font-size: 10px; text-align: center;">
{{ Str::title(str_replace('_', ' ', $type)) }}
</p>
@if ($imagePath)
<img src="{{ storage_path('app/public/' . $imagePath) }}"
alt="{{ $imagePath }}" class="photo-image"
style="width: 100%; max-width: 300px;">
@endif
</td>
@else
@foreach ($fotoTypes as $index => $type)
@php
$imagePath = $forminspeksi[$type] ?? null;
@endphp
@isset($imagePath)
<td style="width: 50%; vertical-align: top; text-align: center" class="photo-item border">
<p style="margin: 0; font-size: 10px; text-align: center;">
{{ Str::title(str_replace('_', ' ', $type)) }}
</p>
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
<img src="{{ storage_path('app/public/' . $imagePath) }}"
alt="{{ $imagePath }}" class="photo-image"
style="width: 100%; max-width: 300px;">
@endif
</td>
@endisset
@if (($index + 1) % 2 == 0)
</tr>
<tr>
@endif
@endforeach
@if (count($fotoTypes) % 2 != 0)
<td style="width: 50%;"></td>
@endif
@endif
</tr>
</table>
</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>
</div>
</main>
@include('lpj::penilai.components.footer')

View File

@@ -163,60 +163,8 @@
</tr>
</table>
<table style="width: 100%; ">
@if (@isset($dokumen))
@foreach ($dokumen->detail as $detail)
<tr>
@if (isset($detail->dokumen_jaminan))
<td style="width:25%; padding: 2px; vertical-align: top;">
{{ $detail->name ?? '' }}
</td>
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
<td style=" padding: 2px; vertical-align: top;">
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->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
@endif
</td>
@endif
</tr>
<tr>
@if (isset($detail->details))
@if (json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '')
<td style="width:25%; padding: 2px; vertical-align: top;">
{{formatLabel($key)}}</td>
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
<td style=" padding: 2px; vertical-align: top;">{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
<sup>m2</sup>
@endif
</td>
@endif
@endforeach
@endif
@endif
</tr>
@endforeach
@endif
</table>
@include('lpj::component.print-out-dokument')
</table>
</div>
<div class="no-break">
@@ -264,7 +212,7 @@
</table>
</div>
<div class="no-break">
@foreach ($permohonan->documents as $dokumen)
@if ($dokumen->jenisJaminan)
@php
@@ -284,7 +232,7 @@
@endif
@endif
@endforeach
</div>
<div class="no-break">
<table style="width: 100%; ">
<tr>
@@ -532,106 +480,5 @@
</div>
</table>
<div class="page-break"></div>
<div class="section">
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
<tr>
<td style="width:20%; padding: 2px; border: 1px solid #000">Nama Debitur</td>
<td style=" width: 1%; padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ $permohonan->debiture->name ?? '' }}</td>
</tr>
<tr>
<td style="padding: 2px; border: 1px solid #000">Nomor Laporan</td>
<td style="padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ $nomorLaporan }}</td>
</tr>
<tr>
<td style="padding: 2px; border: 1px solid #000">Tanggal Laporan</td>
<td style="padding: 2px; border: 1px solid #000">:</td>
<td style="padding: 2px; border: 1px solid #000">{{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
</td>
</tr>
</table>
<table style="width: 100%; ">
<tr>
<td style="border: 1px solid #000; text-align: center;">
PETA
</td>
</tr>
</table>
<div class="photo-container">
@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');
}
// 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]));
});
@endphp
<table width="100%" border="0">
<tr>
@if (count($validPhotoTypes) === 1)
@php
$type = reset($validPhotoTypes); // Ambil elemen pertama
$imagePath = $forminspeksi[$type] ?? null;
@endphp
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
class="photo-item border">
<p style="margin: 0; font-size: 10px; text-align: center;">
{{ Str::title(str_replace('_', ' ', $type)) }}
</p>
@if ($imagePath)
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
class="photo-image" style="width: 100%; max-width: 300px;">
@endif
</td>
@else
@foreach ($fotoTypes as $index => $type)
@php
$imagePath = $forminspeksi[$type] ?? null;
@endphp
@isset($imagePath)
<td style="width: 50%; vertical-align: top; text-align: center" class="photo-item border">
<p style="margin: 0; font-size: 10px; text-align: center;">
{{ Str::title(str_replace('_', ' ', $type)) }}
</p>
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
<img src="{{ storage_path('app/public/' . $imagePath) }}"
alt="{{ $imagePath }}" class="photo-image"
style="width: 100%; max-width: 300px;">
@endif
</td>
@endisset
@if (($index + 1) % 2 == 0)
</tr>
<tr>
@endif
@endforeach
@if (count($fotoTypes) % 2 != 0)
<td style="width: 50%;"></td>
@endif
@endif
</tr>
</table>
</div>
<div class="page-break"></div>
<table style="width: 100%; ">
<tr>
<td style="border: 1px solid #000; text-align: center;">
FOTO JAMINAN
</td>
</tr>
</table>
@include('lpj::penilai.components.foto-jaminan')
</div>
</div>
</main>
@include('lpj::penilai.components.footer')

View File

@@ -62,69 +62,9 @@
</tr>
<tr>
<td style="vertical-align: top;">Legalitas</td>
<td style="vertical-align: top;">:</td>
<td style="vertical-align: top;">
<table style="margin: 0; padding: 0;">
@if (isset($dokumen))
@foreach ($dokumen->detail as $detail)
<tr>
@if (isset($detail->dokumen_jaminan))
<td style="padding: 0; margin: 0;">
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->dokumen_nomor
? [$detail->dokumen_nomor]
: []);
@endphp
@include('lpj::component.print-out-dokument')
@foreach ($dokumen_jaminan as $index => $dokumen)
@if (!empty($dokumen_nomor[$index]))
<span>{{ $dokumen_nomor[$index] }}</span>
@endif
@endforeach
</td>
@endif
</tr>
@endforeach
@endif
</table>
</td>
</tr>
<tr>
@if (isset($permohonan->documents))
@foreach ($permohonan->documents as $document)
@foreach ($document->detail as $detail)
@if (isset($detail->details))
@php
$details = json_decode($detail->details, true);
@endphp
@if ($details)
@foreach ($details as $key => $value)
@if (!is_null($value) && $value !== '')
<tr>
<td style=""> {{formatLabel($key)}}</td>
<td style=" padding: 2px;">:</td>
<td style="">{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
<sup>m2</sup>
@endif
</td>
</tr>
@endif
@endforeach
@endif
@endif
@endforeach
@endforeach
@endif
</tr>
<tr>
<td width="25%">Terletak di</td>
<td style="width: 1%; vertical-align: top;">:</td>
@@ -335,16 +275,6 @@
<td>Resume ini sudah di setujui</td>
</tr>
</table>
<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')