fix(penilai): print out laporan

This commit is contained in:
majid
2025-03-07 10:46:24 +07:00
parent 69e888c6d4
commit 3e6613f955
10 changed files with 134 additions and 84 deletions

View File

@@ -356,9 +356,30 @@
if (preview) {
preview.id = newImageId;
preview.src = '';
preview.accept = ".jpg,.jpeg,.png";
preview.classList.add('hidden');
input.onchange = function() {
previewImage(this, newImageId);
const file = this.files[0];
if (file) {
const validExtensions = ['image/jpeg', 'image/png', 'image/gif',
'image/webp'
];
if (validExtensions.includes(file.type)) {
previewImage(this, newImageId);
} else {
Swal.fire({
icon: 'error',
title: 'Format Tidak Didukung',
text: 'Hanya file gambar dengan format JPG, PNG, GIF, atau WEBP yang diperbolehkan.',
position: 'top-end',
toast: true,
showConfirmButton: false,
timer: 3000,
timerProgressBar: true
});
this.value = '';
}
}
};
}
}

View File

@@ -115,6 +115,27 @@
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
<span class="form-label">Gambar Surat Ukur</span>
</label>
<div class="input-group w-full flex gap-2">
<input class="upload_gs" type="hidden" name="upload_gs" value="upload_gs">
<div class="w-full">
<input id="inputGistaru" type="file" name="upload_gs"
class="file-input file-input-bordered w-full"
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
onchange="previewImage(this, 'upload-gs-preview')">
<img id="upload-gs-preview"
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
alt="Foto Gs" class="mt-2 max-w-full h-auto"
style="{{ isset($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
</div>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
<span class="form-label">Sentuh Tanahku</span>

View File

@@ -66,7 +66,7 @@
@endif
<input type="hidden" name="name_foto_objek" class="input"
value="{{ $mainPhoto['path'] ?? '' }}">
<input type="file" name="foto_objek" class="file-input" accept="image/*"
<input type="file" name="foto_objek" class="file-input" accept=".jpg,.jpeg,.png"
onchange="previewImage(this, 'uploadedImage1')">
</div>
@@ -75,7 +75,7 @@
<td class="px-4 py-2">
<div class="flex flex-col gap-2">
<img id="uploadedImage2" class="max-w-[200px] hidden" alt="Pembanding Image">
<input type="file" name="foto_objek_pembanding[]" class="file-input" accept="image/*"
<input type="file" name="foto_objek_pembanding[]" class="file-input" accept=".jpg,.jpeg,.png"
onchange="previewImage(this, 'uploadedImage2')">
</div>
</td>