update semua form inspeksi
This commit is contained in:
@@ -34,25 +34,25 @@
|
||||
|
||||
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
<input type="hidden" name="type"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
@if (is_array($formKategori))
|
||||
@foreach ($formKategori as $kategori)
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
<input type="hidden" name="type"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
@if (is_array($formKategori))
|
||||
@foreach ($formKategori as $kategori)
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-success" id="saveButton" onclick="submitData()">
|
||||
@@ -169,4 +169,44 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function previewImage(input, previewId) {
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
$('#' + previewId).attr('src', e.target.result).show();
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
} else {
|
||||
$('#' + previewId).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function addClonableItem(containerId, itemClass) {
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) {
|
||||
console.error(`Container with ID "${containerId}" not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = container.querySelector(`.${itemClass}`);
|
||||
if (!template) {
|
||||
console.error(`Template with class "${itemClass}" not found in container "${containerId}".`);
|
||||
return;
|
||||
}
|
||||
|
||||
const newElement = template.cloneNode(true);
|
||||
const inputs = newElement.querySelectorAll('input, textarea');
|
||||
inputs.forEach(input => (input.value = ''));
|
||||
|
||||
const deleteButton = newElement.querySelector('.remove-btn');
|
||||
if (deleteButton) {
|
||||
deleteButton.style.display = 'inline-block';
|
||||
deleteButton.addEventListener('click', () => newElement.remove());
|
||||
}
|
||||
|
||||
container.appendChild(newElement);
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user