fix(print-out): perbaikan foto

This commit is contained in:
majid
2025-02-04 13:33:16 +07:00
parent 075567f84c
commit 165042db38
5 changed files with 143 additions and 50 deletions

View File

@@ -1299,8 +1299,7 @@
PETA
</h6>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
<div class="photo-container">
@php
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
// Memindahkan foto_tempat ke depan jika ada
@@ -1309,28 +1308,36 @@
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)))
<div style="border: 1px solid #ddd; padding: 10px; text-align: center;">
@if ($counter % 2 == 0)
<div class="photo-row clearfix">
@endif
<div class="photo-items" style="float: left; width: 48%; margin-right: 2%; padding: 5px; text-align: center; border: 1px solid #ddd; page-break-inside: avoid;">
<img src="{{ storage_path('app/public/' . $imagePath) }}"
alt="{{ $type }}"
style="max-width: 100%; height: auto; margin-bottom: 10px;">
style="width: 50%; height: 40%; object-fit: contain; margin-bottom: 10px;">
<p style="margin: 0; font-size: 14px;">
{{ 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">