fix(surveyor dan penilai): perbaikan upload foto dan print out

This commit is contained in:
majid
2025-02-07 07:29:49 +07:00
parent 8fc5f6ec0b
commit 7c6059d479
21 changed files with 2941 additions and 3867 deletions

View File

@@ -1,7 +1,6 @@
<style>
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
@@ -34,9 +33,11 @@
/* Image Styling */
.photo-item img {
max-width: 100%;
height: auto;
width: 300px;
height: 300px;
object-fit: contain;
background-color: #f0f0f0;
border-radius: 5px;
page-break-inside: avoid;
}
@@ -58,24 +59,25 @@
page-break-inside: avoid;
}
width: 48%;
margin-right: 2%;
float: left;
padding: 5px;
box-sizing: border-box;
page-break-inside: avoid;
}
.photo-item img {
max-width: 100%;
max-width: 100%;
height: auto;
width: 300px;
height: 300px;
object-fit: contain;
background-color: #f0f0f0;
border-radius: 5px;
page-break-inside: avoid;
}
h2 {
font-size: 14px;
margin-bottom: 5px;
}
.photo-container {
page-break-inside: avoid;
}
.photo-row {
page-break-inside: avoid;
}
}
</style>
@@ -88,17 +90,16 @@
}
$groupedPhotos = collect($photos)->groupBy('category');
$mainPhotos = $groupedPhotos->filter(fn($_, $key) => $key !== 'Lainnya');
$otherPhotos = $groupedPhotos->get('Lainnya', collect());
$mainPhotos = $groupedPhotos->filter(fn($_, $key) => $key !== 'lainnya');
$otherPhotos = $groupedPhotos->get('lainnya', collect());
@endphp
@if ($groupedPhotos->isEmpty())
<p class="text-gray-500">Tidak ada foto yang tersedia.</p>
@else
<div class="photo-container">
@foreach ($mainPhotos as $category => $photos)
<h2 class="text-gray-800 font-bold text-lg">{{ $category }}</h2>
@foreach ($mainPhotos as $category => $photos)
<div class="photo-container">
<h2>{{ $category }}</h2>
@php
$groupedBySubcategory = $photos->groupBy('sub');
@endphp
@@ -107,25 +108,27 @@
<p class="text-gray-500">Tidak ada subkategori yang tersedia.</p>
@else
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
<h3 class="text-gray-600 font-semibold text-md">
{{ $subcategory ?: '' }}
</h3>
@isset($subcategory)
<h6 style="font-size:10px">
{{ $subcategory ?: '' }}
</h6>
@endisset
<div class="photo-row clearfix">
@foreach ($subPhotos as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
@if ($counter % 2 == 0)
<div class="photo-row clearfix">
@endif
<div class="photo-item border">
<h4 class="text-gray-600 font-semibold text-sm">{{ $item['name'] }}</h4>
<p style="text-align: center" >{{ $item['name'] }}</p>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@else
<p class="text-gray-400">Foto tidak ditemukan.</p>
@endif
@isset($item['description'])
<p style="font-size:9px">{{ $item['description'] }}</p>
@endisset
</div>
@if (($index + 1) % 2 == 0 && !$loop->last)
@@ -133,49 +136,53 @@
<div class="photo-row clearfix">
@endif
@endforeach
</div>
@endforeach
</div>
@endforeach
@endif
</div>
@endforeach
@if (!$otherPhotos->isEmpty())
<h2 class="text-gray-800 font-bold text-lg">Lainnya</h2>
<div class="photo-container">
<h2 class="text-gray-800 font-bold text-lg">Lainnya</h2>
@php
$groupedBySubcategory = $otherPhotos->groupBy('sub');
@endphp
@php
$groupedBySubcategory = $otherPhotos->groupBy('sub');
@endphp
@if ($groupedBySubcategory->isEmpty())
<p class="text-gray-500">Tidak ada subkategori yang tersedia.</p>
@else
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
<h3 class="text-gray-600 font-semibold text-md">
{{ $subcategory ?: '' }}
</h3>
@if ($groupedBySubcategory->isEmpty())
<p class="text-gray-500">Tidak ada subkategori yang tersedia.</p>
@else
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
@isset($subcategory)
<h6 style="font-size:10px">
{{ $subcategory ?: '' }}
</h6>
@endisset
<div class="photo-row clearfix">
@foreach ($subPhotos as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
<div class="photo-item border">
<h4 class="text-gray-600 font-semibold text-sm">{{ $item['name'] }}</h4>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@else
<p class="text-gray-400">Foto tidak ditemukan.</p>
@endif
</div>
<div class="photo-row clearfix">
@foreach ($subPhotos as $index => $item)
@php
$imagePath = storage_path('app/public/' . $item['path']);
@endphp
<div class="photo-item border">
<h6 style="text-align: center" >{{ $item['name'] }}</h6>
@if ($statusLpj || file_exists($imagePath))
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
@else
<p class="text-gray-400">Foto tidak ditemukan.</p>
@endif
</div>
@if (($index + 1) % 2 == 0 && !$loop->last)
</div>
<div class="photo-row clearfix">
@endif
@endforeach
@if (($index + 1) % 2 == 0 && !$loop->last)
</div>
<div class="photo-row clearfix">
@endif
@endforeach
</div>
@endforeach
@endif
</div>
@endforeach
@endif
@endif
</div>
@endif
@endif
@endif
@endisset