update service preview laporan and foto jaminan

This commit is contained in:
majid
2025-06-18 10:15:49 +07:00
parent daed7c5e48
commit db3ffacebe
2 changed files with 159 additions and 73 deletions

View File

@@ -98,41 +98,83 @@
<table width="100%" border="0"
style="align-content: center; text-align: center; margin-bottom: 20px">
@foreach ($chunkedPhotos as $item)
@php
$filePath = $statusLpj == 1 ? storage_path('app/public/' . $item['path']) : asset('storage/' . $item['path']);
$filePath = asset('storage/' . $item['path']);
@php
$filePath =
$statusLpj == 1
? storage_path('app/public/' . $item['path'])
: asset('storage/' . $item['path']);
$extension = strtolower(pathinfo($item['path'], PATHINFO_EXTENSION));
$isImage = in_array($extension, ['jpg', 'jpeg', 'png', 'gif']);
$isImage = in_array($extension, [
'jpg',
'jpeg',
'png',
'gif',
'bmp',
'svg',
'webp',
'tiff',
]);
$isPdf = $extension === 'pdf';
@endphp
<tr>
<td style="width: 100%; padding: 10px; align-content: center; text-align: center" class="photo-item border " >
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@if ($statusLpj == 1)
@if ($isImage && $filePath)
<tr>
<td style="width: 100%; padding: 10px; align-content: center; text-align: center"
class="photo-item border">
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
<img src="{{ $filePath }}" alt="{{ $item['path'] }}" class="photo-image"
style="align-content: center; text-align: center; max-width: 100%; height: auto;">
</td>
</tr>
@endif
@elseif ($statusLpj != 1)
<tr>
<td style="width: 100%; padding: 10px; align-content: center; text-align: center"
class="photo-item border ">
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
@if ($statusLpj || file_exists(public_path('storage/' . $item['path'])))
@if ($isImage)
<img src="{{ $filePath }}" alt="{{ $item['path'] }}"
class="photo-image"
style="align-content: center; text-align: center;">
@elseif ($isPdf)
<a href="{{ $filePath }}" download="{{ basename($filePath) }}"
style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File PDF
</a>
@else
<a href="{{ $filePath }}" download="{{ basename($filePath) }}"
style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File
</a>
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
@if ($statusLpj || file_exists(public_path('storage/' . $item['path'])))
@if ($isImage)
<img src="{{ $filePath }}" alt="{{ $item['path'] }}" class="photo-image" style="align-content: center; text-align: center;">
@elseif ($isPdf)
<a href="{{ $filePath }}" download="{{ basename($filePath) }}" style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File PDF
</a>
@else
<a href="{{ $filePath }}" download="{{ basename($filePath) }}" style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File
</a>
@endif
@endif
@isset($item['description'])
<p style="font-size:9px">{{ $item['description'] }}</p>
@endisset
</td>
</tr>
@isset($item['description'])
<p style="font-size:9px">{{ $item['description'] }}</p>
@endisset
</td>
</tr>
@endif
@endforeach
@if (count($chunkedPhotos) < 2)
<tr style="width: 100%;"></tr>
@@ -151,41 +193,79 @@
<table width="100%" border="0"
style="align-content: center; text-align: center; margin-bottom: 20px">
@foreach ($chunkedPhotos as $item)
@php
$filePath = $statusLpj == 1 ? storage_path('app/public/' . $item['path']) : asset('storage/' . $item['path']);
@php
$filePath =
$statusLpj == 1
? storage_path('app/public/' . $item['path'])
: asset('storage/' . $item['path']);
$extension = strtolower(pathinfo($item['path'], PATHINFO_EXTENSION));
$isImage = in_array($extension, [
'jpg',
'jpeg',
'png',
'gif',
'bmp',
'svg',
'webp',
'tiff',
]);
$isPdf = $extension === 'pdf';
@endphp
<tr>
<td style="width: 100%; padding: 10px;" class="photo-item border">
<p style="font-weight: medium; font-size: 10px">Lainnya -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@if ($statusLpj == 1)
@if ($isImage && $filePath)
<tr>
<td style="width: 100%; padding: 10px; align-content: center; text-align: center"
class="photo-item border">
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
<img src="{{ $filePath }}" alt="{{ $item['path'] }}" class="photo-image"
style="align-content: center; text-align: center; max-width: 100%; height: auto;">
</td>
</tr>
@endif
@elseif ($statusLpj != 1)
<tr>
<td style="width: 100%; padding: 10px;" class="photo-item border">
<p style="font-weight: medium; font-size: 10px">Lainnya -
@isset($subcategory)
@if (trim($subcategory) !== '')
{{ $subcategory }} -
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
@if ($statusLpj || file_exists(public_path('storage/' . $item['path'])))
@if ($isImage)
<img src="{{ $filePath }}" alt="{{ $item['path'] }}"
class="photo-image" style="text-align: center;">
@elseif ($isPdf)
<a href="{{ $filePath }}" download="{{ basename($filePath) }}"
style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File PDF
</a>
@else
<a href="{{ $filePath }}" download="{{ basename($filePath) }}"
style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File
</a>
@endif
@endisset
{{ $item['name'] ?? '' }}
</p>
@if ($statusLpj || file_exists(public_path('storage/' . $item['path'])))
@if ($isImage)
<img src="{{ $filePath }}" alt="{{ $item['path'] }}" class="photo-image" style="text-align: center;">
@elseif ($isPdf)
<a href="{{ $filePath }}" download="{{ basename($filePath) }}" style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File PDF
</a>
@else
<a href="{{ $filePath }}" download="{{ basename($filePath) }}" style="font-size:12px; color:#1a73e8; text-decoration: underline;">
⬇️ Unduh File
</a>
@endif
@endif
@isset($item['description'])
<p style="font-size:9px">{{ $item['description'] }}</p>
@endisset
</td>
@isset($item['description'])
<p style="font-size:9px">{{ $item['description'] }}</p>
@endisset
</td>
</tr>
@endif
@endforeach
</tr>
@if (count($chunkedPhotos) < 2)
<tr style="width: 100%;"></tr>
@endif