perabaikan team activity, form inspeksi rap,laporan memo, rap, resume dan penambahan basic data perizinan

This commit is contained in:
majid
2025-01-03 16:49:20 +07:00
parent 64ba6cf71e
commit b7767fbc92
26 changed files with 2401 additions and 478 deletions

View File

@@ -1,154 +1,121 @@
<div>
@if (isset($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi']))
@foreach ($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi'][0] as $index => $item)
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $item['name'] . ' ' . $loop->index + 1 }}
</h2>
@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'
]
];
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $item['path'])))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@endif
</div>
@endforeach
@endif
@if (isset($formFoto['foto_rute_lainnya']))
@foreach ($formFoto['foto_rute_lainnya'] as $index => $item)
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $item['name_rute_lainnya'] }}
</h2>
@php
$imagePath = storage_path('app/public/' . $item['foto_rute_lainnya']);
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_rute_lainnya'])))
<img src="{{ $imagePath }}" alt="{{ $item['foto_rute_lainnya'] }}" class="photo-image">
@endif
</div>
@endforeach
@endif
@if (!empty($formFoto['object_jaminan']))
@foreach ($formFoto['object_jaminan'] as $item)
@php
$nameObjek = trim($item['name_objek'] ?? '');
$fotoObjek = trim($item['foto_objek'] ?? '');
$imagePath = storage_path('app/public/' . $fotoObjek);
@endphp
@if (!empty($nameObjek) || !empty($fotoObjek))
<div class="border photo-item">
@if (!empty($nameObjek))
<h2 class="text-gray-600 font-semibold text-xl">
{{ $nameObjek }}
</h2>
@endif
@if ($statusLpj || (!empty($fotoObjek) && file_exists($imagePath)))
<img src="{{ $imagePath }}" alt="{{ $nameObjek ?: 'Objek Foto' }}" class="photo-image">
@else
<p class="text-gray-500 italic">Foto tidak tersedia</p>
@endif
</div>
@endif
@endforeach
@else
<p class="text-gray-500 text-center italic">Tidak ada objek jaminan yang ditemukan</p>
@endif
@if (isset($formFoto['foto_lantai_unit']))
@foreach ($formFoto['foto_lantai_unit'] as $index => $floorPhotos)
@foreach ($floorPhotos as $index => $item)
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $item['name'] ?? 'Foto Lantai ' . $floorNumber . ' - ' . ($index + 1) }}
</h2>
$hasPhotos = false;
@endphp
@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/' . $item['path']);
$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(storage_path('app/public/' . $item['path'])))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@endif
</div>
@endforeach
@endforeach
@endif
@if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))
@foreach ($formFoto['foto_lingkungan']['foto_lingkungan'][0] as $index => $item)
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
{{ $item['name'] . ' ' . $loop->index + 1 }}
</h2>
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $item['path'])))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $photoName }}" class="photo-image">
@endif
</div>
@endif
</div>
@endforeach
@endif
@if (isset($formFoto['foto_basement']))
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
Basement
</h2>
@endforeach
@else
@php
$imagePath = storage_path('app/public/' . $formFoto['foto_basement']);
$sectionData = $formFoto[$sectionKey] ?? null;
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_basement'])))
<img src="{{ $imagePath }}" alt="{{ $formFoto['foto_basement'] }}" class="photo-image">
@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
@endif
@else
@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
@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
@endif
@endif
</div>
@endif
@endif
@endforeach
@if (isset($formFoto['foto_gerbang']))
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
Gerbang
</h2>
@php
$imagePath = storage_path('app/public/' . $formFoto['foto_gerbang']);
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_gerbang'])))
<img src="{{ $imagePath }}" alt="{{ $formFoto['foto_gerbang'] }}" class="photo-image">
@endif
</div>
@endif
@if (isset($formFoto['pendamping']))
<div class="border photo-item">
<h2 class="text-gray-600 font-semibold text-xl">
Pendamping
</h2>
@php
$imagePath = storage_path('app/public/' . $formFoto['pendamping']);
@endphp
@if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['pendamping'])))
<img src="{{ $imagePath }}" alt="{{ $formFoto['pendamping'] }}" class="photo-image">
@endif
@if (!$hasPhotos)
<div class="text-center py-6 bg-gray-100 rounded-lg">
<p class="text-gray-500 italic">Tidak ada foto yang tersedia</p>
</div>
@endif
</div>