fix view foto jaminan
This commit is contained in:
@@ -1,264 +1,89 @@
|
||||
@if (isset($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Rute Menuju Lokasi
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi']))
|
||||
@foreach ($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi'][0] as $index => $item)
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $item['name'] ?? 'Rute menuju lokasi - ' . ($index + 1) }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
<img src="{{ Storage::url($item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@isset($basicData['foto'])
|
||||
@php
|
||||
$photos = $formFoto['upload_foto'] ?? [];
|
||||
if (!is_array($photos)) {
|
||||
$photos = [];
|
||||
}
|
||||
$groupedPhotos = collect($photos)->groupBy('category');
|
||||
@endphp
|
||||
|
||||
@if (isset($formFoto['foto_rute_lainnya']))
|
||||
<div class="card">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Rute Lainnya
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['foto_rute_lainnya']))
|
||||
@foreach ($formFoto['foto_rute_lainnya'] as $index => $item)
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $item['name_rute_lainnya'] ?? 'Rute Lainnya - ' . ($index + 1) }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
<img src="{{ Storage::url($item['foto_rute_lainnya']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['foto_gerbang']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Gerbang
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
@if ($groupedPhotos->isEmpty())
|
||||
<p class="text-gray-500">Tidak ada foto yang tersedia.</p>
|
||||
@else
|
||||
@foreach ($groupedPhotos as $category => $photos)
|
||||
<div class="mt-5">
|
||||
<h2 class="text-gray-800 font-bold text-xl mb-3">{{ $category ?? 'Tanpa Kategori' }}</h2>
|
||||
<div class="grid gap-5">
|
||||
<h2 class=" font-semibold text-xl">
|
||||
Gerbang
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
@php
|
||||
$groupedBySubcategory = $photos->groupBy('sub');
|
||||
@endphp
|
||||
|
||||
@if ($groupedBySubcategory->isEmpty())
|
||||
|
||||
<img src="{{ Storage::url($formFoto['foto_gerbang']) }}" alt="" class="w-full h-auto object-cover">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))
|
||||
<div class="card">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Lingkungan </h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))
|
||||
@foreach ($formFoto['foto_lingkungan']['foto_lingkungan'][0] as $index => $item)
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $item['name'] ?? 'Lingkungan - ' . ($index + 1) }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
<img src="{{ Storage::url($item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['object_jaminan']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Object Jaminan
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['object_jaminan']))
|
||||
@foreach ($formFoto['object_jaminan'] as $item)
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class=" font-semibold text-xl">
|
||||
{{ $item['name_objek'] ?? "" }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
<img src="{{ Storage::url($item['foto_objek']) }}" alt=""
|
||||
class="w-full h-auto object-cover">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['foto_lantai_unit']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">Lantai</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['foto_lantai_unit']))
|
||||
@foreach ($formFoto['foto_lantai_unit'] as $floorIndex => $floorPhotos)
|
||||
<div class="mt-5">
|
||||
@foreach ($floorPhotos as $index => $item)
|
||||
@if (is_int($index) && isset($item['name'], $item['path']) && is_string($item['path']))
|
||||
<div class="flex items-center justify-between mt-3">
|
||||
<div class="grid gap-3">
|
||||
<h3 class="text-gray-600 font-semibold text-lg">
|
||||
{{ $item['name'] ?? 'Foto Lantai ' . ($floorIndex + 1) . ' - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<div class="flex items-center ">
|
||||
<img src="{{ Storage::url($item['path']) }}"
|
||||
alt="Gambar {{ $floorIndex + 1 }}-{{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover">
|
||||
@foreach ($photos as $index => $item)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="grid gap-5">
|
||||
<h3 class="text-gray-600 font-semibold text-lg">
|
||||
{{ $item['name'] ?? 'Foto - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<div class="flex items-center">
|
||||
@if (isset($item['path']))
|
||||
<img src="{{ asset('storage/' . $item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover rounded-md">
|
||||
@else
|
||||
<p class="text-gray-500">Gambar tidak tersedia</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-gray-500 text-sm">{{ $item['description'] ?? '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if (isset($formFoto['foto_basement']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Basement
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class=" font-semibold text-xl">
|
||||
Basemnt
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
|
||||
|
||||
<img src="{{ Storage::url($formFoto['foto_basement']) }}" alt="" class="w-full h-auto object-cover">
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<!-- Jika ada subkategori, tampilkan berdasarkan subkategori -->
|
||||
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
|
||||
<div class="mb-4">
|
||||
<!-- Judul Subkategori -->
|
||||
<h4 class="text-gray-700 font-semibold text-lg mb-2">
|
||||
@if ($subcategory)
|
||||
{{ $subcategory }}
|
||||
@endif
|
||||
</h4>
|
||||
<div class="grid gap-5">
|
||||
@foreach ($subPhotos as $index => $item)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="grid gap-5">
|
||||
<h3 class="text-gray-600 font-semibold text-lg">
|
||||
{{ $item['name'] ?? 'Foto - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<div class="flex items-center">
|
||||
@if (isset($item['path']))
|
||||
<img src="{{ asset('storage/' . $item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover rounded-md">
|
||||
@else
|
||||
<p class="text-gray-500">Gambar tidak tersedia</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-gray-500 text-sm">{{ $item['description'] ?? '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['foto_lantai_lainnya']))
|
||||
<div class="card">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Lantai Lainnya
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (isset($formFoto['foto_lantai_lainnya']))
|
||||
@foreach ($formFoto['foto_lantai_lainnya'] as $index => $item)
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $item['name_lantai_lainnya'] ?? 'Lantai - ' . ($index + 1) }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
<img src="{{ Storage::url($item['foto_lantai_lainnya']) }}"
|
||||
alt="Gambar {{ $index + 1 }}" class="w-full h-auto object-cover">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
@if (isset($formFoto['pendamping']))
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Pendamping
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="flex items-center justify-between mt-5">
|
||||
<div class="grid gap-5">
|
||||
<h2 class=" font-semibold text-xl">
|
||||
Pendamping
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
|
||||
|
||||
<img src="{{ Storage::url($formFoto['pendamping']) }}" alt="" class="w-full h-auto object-cover">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
$adaFoto = false;
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
$adaFoto = false;
|
||||
if (isset($forminspeksi)) {
|
||||
foreach ($fotoTypes as $type) {
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@@ -271,33 +96,33 @@ $adaFoto = false;
|
||||
@endphp
|
||||
|
||||
@if ($adaFoto)
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Peta
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Peta
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div>
|
||||
@if (isset($forminspeksi))
|
||||
@forelse ($fotoTypes as $type)
|
||||
<div class="border photo-item">
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
<div>
|
||||
@if (isset($forminspeksi))
|
||||
@forelse ($fotoTypes as $type)
|
||||
<div class="border photo-item">
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<img src="{{ Storage::url($imagePath) }}" alt="{{ $type }}"
|
||||
class="w-full h-auto object-cover">
|
||||
@endif
|
||||
<p class="mt-2 text-sm">{{ Str::title(str_replace('_', ' ', $type)) }}</p>
|
||||
</div>
|
||||
@empty
|
||||
<p>Tidak ada tipe foto yang tersedia</p>
|
||||
@endforelse
|
||||
@endif
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<img src="{{ asset('storage/' . $imagePath) }}" alt="{{ $type }}"
|
||||
class="w-full h-auto object-cover">
|
||||
@endif
|
||||
<p class="mt-2 text-sm">{{ Str::title(str_replace('_', ' ', $type)) }}</p>
|
||||
</div>
|
||||
@empty
|
||||
<p>Tidak ada tipe foto yang tersedia</p>
|
||||
@endforelse
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user