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

@@ -35,10 +35,23 @@
<td class="px-4 py-2">Foto</td>
<td class="px-4 py-2">
<div class="flex flex-col gap-2">
<img id="uploadedImage1"
src="{{ isset($fotoForm['object_jaminan'][0]['foto_objek']) ? asset('storage/' . $fotoForm['object_jaminan'][0]['foto_objek']) : '' }}"
class="max-w-[200px] {{ isset($fotoForm['object_jaminan'][0]['foto_objek']) ? '' : 'hidden' }}"
alt="Uploaded Image">
@php
$photos = $fotoForm['upload_foto'] ?? [];
if (!is_array($photos)) {
$photos = [];
}
$groupedPhotos = collect($photos)->groupBy('category');
$mainPhoto = $groupedPhotos->get('Tampak Depan', collect())->first();
// echo $mainPhoto;
@endphp
@if ($mainPhoto)
<img id="uploadedImage1" src="{{ asset('storage/' . $mainPhoto['path']) }}"
class="max-w-[200px]" alt="Uploaded Image">
@endif
<input type="file" name="foto_objek" class="file-input" accept="image/*"
onchange="previewImage(this, 'uploadedImage1')">
</div>