Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into andydev

This commit is contained in:
Andy Chaerudin
2024-11-05 16:04:47 +07:00
2 changed files with 53 additions and 34 deletions

View File

@@ -176,6 +176,27 @@
<input class="input" type="text" name="custom_field[][$detail->jenisLegalitasJaminan->custom_field]" value="{{ $custom_field[$detail->jenisLegalitasJaminan->custom_field] }}">
</div>
</div>
@else
@if($detail->jenisLegalitasJaminan->custom_field)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
</label>
<div class="flex flex-wrap items-baseline w-full">
@if($detail->jenisLegalitasJaminan->custom_field_type === "text")
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "number")
<input class="input" type="number" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "date")
<input class="input" type="date" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "textarea")
<textarea class="textarea" rows="3" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2"></textarea>
@else
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
@endif
</div>
</div>
@endif
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -221,15 +242,15 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
@if($item->custom_field_type === "text")
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]">
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "number")
<input class="input" type="number" name="custom_field[][{{$item->custom_field}}]">
<input class="input" type="number" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "date")
<input class="input" type="date" name="custom_field[][{{$item->custom_field}}]">
<input class="input" type="date" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@elseif($item->custom_field_type === "textarea")
<textarea class="textarea" rows="3" name="custom_field[][{{$item->custom_field}}]"></textarea>
<textarea class="textarea" rows="3" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2"></textarea>
@else
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]">
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
@endif
</div>
</div>
@@ -246,9 +267,7 @@
@php $n++; @endphp
@endforeach
@else
<div id="doctainer" class="grid gap-5">
</div>
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -370,13 +389,13 @@
@push('scripts')
{{--Pemilik Jaminan--}}
<script>
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
// Function to add delete event listeners to existing buttons
function addDeleteListeners() {
document.querySelectorAll(".delete-button").forEach(button => {
button.addEventListener("click", function() {
button.addEventListener("click", function () {
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
});
});
@@ -385,7 +404,7 @@
// Add delete listeners to existing buttons
addDeleteListeners();
document.getElementById("tambah_sertifikat").addEventListener("click", function() {
document.getElementById("tambah_sertifikat").addEventListener("click", function () {
const newDiv = document.createElement("div");
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
newDiv.innerHTML = `