perbaikan laporan belum bayar lansung mengarah ke resume dan urutan tampilan foto

This commit is contained in:
majid
2025-01-16 14:32:14 +07:00
parent 1e2b6f21ae
commit e6adcd8185
11 changed files with 433 additions and 241 deletions

View File

@@ -1,113 +1,134 @@
<div>
@php
$photoSections = [
'rute_menuju_lokasi' => [
'key' => 'rute_menuju_lokasi',
'name_prefix' => '',
'nested' => true
],
'foto_rute_lainnya' => [
'key' => 'name_rute_lainnya',
'name_prefix' => '',
'nested' => false
],
'object_jaminan' => [
'key' => 'name_objek',
'name_prefix' => '',
'nested' => false
],
'foto_lantai_unit' => [
'key' => 'name',
'name_prefix' => 'Foto Lantai',
'nested' => true
],
'foto_lingkungan' => [
'key' => 'foto_lingkungan',
'name_prefix' => '',
'nested' => true
],
'single_photos' => [
'foto_basement' => 'Basement',
'foto_gerbang' => 'Gerbang',
'pendamping' => 'Pendamping'
]
];
$photoSections = [
'rute_menuju_lokasi' => [
'key' => 'rute_menuju_lokasi',
'name_prefix' => '',
'nested' => true,
],
'foto_rute_lainnya' => [
'key' => 'name_rute_lainnya',
'name_prefix' => '',
'nested' => false,
],
'foto_lingkungan' => [
'key' => 'foto_lingkungan',
'name_prefix' => '',
'nested' => true,
],
'single_photos' => [
'foto_basement' => 'Basement',
'foto_gerbang' => 'Gerbang',
'pendamping' => 'Pendamping',
],
'object_jaminan' => [
'key' => 'name_objek',
'name_prefix' => '',
'nested' => false,
],
'foto_lantai_unit' => [
'key' => 'name',
'name_prefix' => 'Foto Lantai',
'nested' => true,
],
];
$hasPhotos = false;
$hasPhotos = false;
@endphp
<style>
.photo-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 20px;
}
.photo-item {
width: 100%; /* Adjust to fit two photos per row */
margin-bottom: 10px;
}
.photo-item img {
width: 80%;
height: auto;
border-radius: 5px;
}
</style>
@foreach ($photoSections as $sectionKey => $sectionConfig)
@if ($sectionKey === 'single_photos')
@foreach ($sectionConfig as $photoKey => $photoName)
@if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
@php
$imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
$hasPhotos = true;
@endphp
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $photoName }}
</h2>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $photoName }}" class="photo-image">
@endif
</div>
@endif
@endforeach
<div class="photo-container">
@foreach ($sectionConfig as $photoKey => $photoName)
@if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
@php
$imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
$hasPhotos = true;
@endphp
<div class="photo-item border">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $photoName }}
</h2>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $photoName }}" class="photo-image">
@endif
</div>
@endif
@endforeach
</div>
@else
@php
$sectionData = $formFoto[$sectionKey] ?? null;
$sectionData = $formFoto[$sectionKey] ?? null;
@endphp
@if (!empty($sectionData))
@if ($sectionConfig['nested'])
@if (isset($sectionData[$sectionConfig['key']][0]))
@foreach ($sectionData[$sectionConfig['key']][0] as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
$hasPhotos = true;
@endphp
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $sectionConfig['name_prefix'] ?
($sectionConfig['name_prefix'] . ' ' . ($index + 1)) :
($item['name'] ?? 'Foto ' . ($index + 1))
}}
</h2>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@endif
</div>
@endforeach
<div class="photo-container">
@foreach ($sectionData[$sectionConfig['key']][0] as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
$hasPhotos = true;
@endphp
<div class="photo-item border">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $sectionConfig['name_prefix']
? $sectionConfig['name_prefix'] . ' ' . ($index + 1)
: $item['name'] ?? 'Foto ' . ($index + 1) }}
</h2>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@endif
</div>
@endforeach
</div>
@endif
@else
@foreach ($sectionData as $index => $item)
@php
$name = $item[$sectionConfig['key']] ?? '';
$photoPath = $sectionKey === 'object_jaminan' ?
($item['foto_objek'] ?? '') :
($item['foto_rute_lainnya'] ?? '');
<div class="photo-container">
@foreach ($sectionData as $index => $item)
@php
$name = $item[$sectionConfig['key']] ?? '';
$photoPath =
$sectionKey === 'object_jaminan'
? $item['foto_objek'] ?? ''
: $item['foto_rute_lainnya'] ?? '';
$imagePath = storage_path('app/public/' . $photoPath);
@endphp
$imagePath = storage_path('app/public/' . $photoPath);
@endphp
@if (!empty($name) || !empty($photoPath))
@php $hasPhotos = true; @endphp
<div class="border photo-item">
@if (!empty($name))
<h2 class="text-gray-600 font-semibold text-xl">
{{ $name }}
</h2>
@endif
@if ($statusLpj || (file_exists($imagePath) && !empty($photoPath)))
<img src="{{ $imagePath }}" alt="{{ $name ?: 'Foto' }}" class="photo-image">
@endif
</div>
@endif
@endforeach
@if (!empty($name) || !empty($photoPath))
@php $hasPhotos = true; @endphp
<div class="photo-item border">
@if (!empty($name))
<h2 class="text-gray-600 font-semibold text-xl">
{{ $name }}
</h2>
@endif
@if ($statusLpj || (file_exists($imagePath) && !empty($photoPath)))
<img src="{{ $imagePath }}" alt="{{ $name ?: 'Foto' }}" class="photo-image">
@endif
</div>
@endif
@endforeach
</div>
@endif
@endif
@endif