fix(dokumen_jaminan): perbaiki pengambilan data detail dokumen

- Memperbaiki logika pengambilan data 'details' pada Dokumen Jaminan.
- Mengubah cara pengolahan data luas tanah dan luas bangunan untuk akurasi.
- Memperbaiki tampilan data pada email dan komponen jaminan.
This commit is contained in:
Daeng Deni Mardaeni
2025-03-07 16:50:09 +07:00
parent e1bb30c768
commit 03d28479c4
5 changed files with 271 additions and 214 deletions

View File

@@ -90,7 +90,7 @@
'jenis_legalitas_jaminan_id' => $value,
'name' => $request->name[$key],
'keterangan' => $request->keterangan[$key],
'details' => isset($request->custom_field[$value]) ? json_encode($request->custom_field[$value]) : ''
'details' => isset($request->custom_field[$key]) ? json_encode($request->custom_field[$key]) : ''
];
$dokumenJaminan = [];

View File

@@ -68,36 +68,36 @@
{{ $penawaran->tujuanPenilaianKjpp->name }}
</span>
</div>
@else
@else
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Nilai Plafond:
</h3>
<span class="text-2sm text-gray-700">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Nilai Plafond:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->nilaiPlafond->name }}
</span>
</div>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Status Bayar:
</h3>
<span
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Status Bayar:
</h3>
<span
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
</span>
</div>
@endif
</div>
@endif
</div>
</div>
@@ -263,84 +263,82 @@
</div>
</div>
@endif
<div class="card-table scrollable-x-auto pb-3">
<a href="{{ route('debitur.jaminan.bulk.download', ['id' => $permohonan->debiture->id, 'jaminan' => $dokumen->id]) }}"
class="ml-6 btn btn-dark dark:btn-light">
<i class="ki-outline ki-cloud-download"></i> Download Semua Dokumen
</a>
<table class="table align-middle text-sm text-gray-500">
@foreach ($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normal text-2sm">
{{ $detail->name ?? '' }}
</td>
</tr>
@if(isset($detail->details))
@if(json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
<tr>
<td class="py-3 capitalize">
{{formatLabel($key)}}
</td>
<td class="py-2 text-gray-800 font-normal text-2sm">
{{ $value ?? "" }}
</td>
</tr>
@endforeach
@endif
@endif
<tr>
<td class="py-3 max-w-[100px] align-top">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@php $document = $dokumen; @endphp
@foreach($document->detail as $detail)
<tr>
<td colspan="2">
<strong class="text-2xs text-gray-600 uppercase">
{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</strong>
</td>
</tr>
@if (isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
? json_decode($detail->dokumen_jaminan)
: [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
? json_decode($detail->dokumen_nomor)
: ($detail->dokumen_nomor
? [$detail->dokumen_nomor]
: []);
@endphp
@foreach ($dokumen_jaminan as $index => $dokumen)
<div class="flex w-full lg:w-[30%]">
@if (in_array(Auth::user()->roles[0]->name, ['administrator', 'pemohon-eo']))
@if (!empty($dokumen_nomor))
<span class="flex-1 mt-2 text-info">Nomor Dokumen :
{{ $dokumen_nomor[$index] }}</span>
@endif
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
{{ basename($dokumen) }}
<i class="ki-filled ki-cloud-download"></i>
</a>
@endif
<span class="flex-none badge badge-sm badge-outline badge-warning mt-2"
onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i
class="ki-filled ki-eye mr-2"></i>Preview</span>
</div>
<br>
@endforeach
@if(isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
@endphp
@foreach($dokumen_jaminan as $index => $dokumen)
<tr>
<td>
<span class="text-2xs text-gray-600 uppercase pl-3">
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
</span>
</td>
<td class="text-left">
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
{{ basename($dokumen) }}
<i class="ki-filled ki-cloud-download"></i>
</a>
@endif
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')">
<i class="ki-filled ki-eye mr-2"></i>Preview
</span>
</td>
</tr>
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? '' }}
</td>
</tr>
@if(isset($detail->details) && json_decode($detail->details)[$index])
@foreach (json_decode($detail->details)[$index] as $key => $value)
<tr>
<td>
<span class="text-2xs text-gray-600 uppercase pl-3">
- {{ str_replace("_"," ",$key) ?? "" }}
</span>
</td>
<td class="text-left">
<p class="text-2xs text-gray-600 max-w-[250px]">
{{ $value }}
</p>
</td>
</tr>
@endforeach
@endif
@endforeach
@endif
<tr>
<td>
<span class="text-2xs text-gray-600 uppercase pl-3">
- keterangan
</span>
</td>
<td class="text-right">
<p class="text-2xs text-gray-600 max-w-[250px]">
{{ $detail->keterangan }}
</p>
</td>
</tr>
@endforeach
</table>
</div>
</div>
@@ -349,6 +347,9 @@
</div>
@if (!isset($status))
</div>
@include('lpj::component.history-permohonan')
@endif
@include('lpj::component.pdfviewer')

View File

@@ -282,50 +282,52 @@
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nomor">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Dokumen Jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
<div class="flex items-center gap-2">
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
</div>
<div id="additional-files-{{ $n }}"></div>
</div>
@if(isset($detail->dokumen_jaminan))
@if(isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
@endphp
<div class="flex flex-col w-full gap-2">
@foreach($dokumen_jaminan as $index => $dokumen)
<div class="flex w-full lg:w-[30%]">
@if(!empty($dokumen_nomor))
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : {{ $dokumen_nomor[$index] }}</span>
@endif
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
{{ basename($dokumen) }}
<i class="ki-filled ki-cloud-download"></i>
</a>
</div>
@endforeach
<div id="document-container-${index}">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Dokumen Jaminan
</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
<div class="flex items-center gap-2">
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
</div>
<div id="additional-files-{{ $n }}"></div>
</div>
@if(isset($detail->dokumen_jaminan))
@if(isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
@endphp
<div class="flex flex-col w-full gap-2">
@foreach($dokumen_jaminan as $index => $dokumen)
<div class="flex w-full lg:w-[30%]">
@if(!empty($dokumen_nomor))
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : {{ $dokumen_nomor[$index] }}</span>
@endif
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
{{ basename($dokumen) }}
<i class="ki-filled ki-cloud-download"></i>
</a>
</div>
@endforeach
</div>
@endif
@endif
@endif
</div>
</div>
<div id="document-container"></div>
</div>
@if($detail->details)
@if($detail->jenisLegalitasJaminan->custom_fields)
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 custom-field">
@php
$customField = getCustomField($key);
$fieldValue = json_decode($detail->details)->{$customField->name} ?? '';
@@ -504,6 +506,7 @@
</div>
</form>
@push('scripts')
{{--Pemilik Jaminan--}}
<script>
@@ -600,33 +603,36 @@
<input class="input" type="text" name="name[]" value="${item.name || ""}" placeholder="Nomor">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Dokumen Jaminan
</label>
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
<div class="flex flex-col w-full gap-2">
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
</div>
<div class="flex items-center gap-2 my-2 w-full">
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput(${index})">Add File</button>
<div id="document-container-${index}">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Dokumen Jaminan
</label>
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
<div class="flex flex-col w-full gap-2">
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
</div>
<div class="flex items-center gap-2 my-2 w-full">
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput(${index})">Add File</button>
</div>
</div>
</div>
</div>
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">
${field.label}
</label>
<div class="flex flex-wrap items-baseline w-full">
${getCustomFieldInput(field.type, field.name, item.details, item.jenis_legalitas_jaminan_id)}
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-2 custom-field">
<label class="form-label max-w-56 capitalize">
${field.label}
</label>
<div class="flex flex-wrap items-baseline w-full">
${getCustomFieldInput(index, field.type, field.name, item.details, item.jenis_legalitas_jaminan_id, 0)}
</div>
</div>
`).join('') : ""}
<div id="document_container"></div>
</div>
`).join('') : ""}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
@@ -643,19 +649,51 @@
}
function addFileInput(index) {
const container = document.getElementById(`file-container-${index}`);
const documentContainer = document.getElementById(`document-container-${index}`);
const customFields = documentContainer.querySelectorAll('.custom-field');
const container = documentContainer.querySelector('#document_container');
// Get the current number of custom field sets
const currentFieldSets = container.querySelectorAll('.custom-field-set').length;
const newFieldIndex = currentFieldSets+1;
const newInput = document.createElement("div");
newInput.className = "flex items-center gap-2 mb-2 w-full";
newInput.className = "flex flex-col w-full gap-2 mb-4 custom-field-set";
let customFieldsHtml = '';
customFields.forEach(field => {
const label = field.querySelector('label').textContent;
const input = field.querySelector('input, textarea, select');
const fieldName = input.name.match(/\[([^\]]+)\]$/)[1];
customFieldsHtml += `
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 capitalize">${label}</label>
<div class="flex flex-wrap items-baseline w-full">
${getCustomFieldInput(index, input.type, fieldName, null, null, newFieldIndex)}
</div>
</div>
`;
});
newInput.innerHTML = `
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col w-full gap-2">
&nbsp;
</div>
<div class="flex items-center gap-2 w-full">
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
<button type="button" class="flex-none btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
`;
</div>
</div>
${customFieldsHtml}
`;
container.appendChild(newInput);
}
function removeFileInput(button) {
button.closest(".flex.items-center.gap-2.mb-2").remove();
button.closest(".flex.flex-col.w-full.gap-2.mb-4").remove();
}
function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) {
@@ -707,19 +745,19 @@
return dokumenNomor;
}
function getCustomFieldInput(type, fieldName, value, itemId) {
function getCustomFieldInput(index, type, fieldName, value, itemId, fieldIndex = 0) {
value = value ? JSON.parse(value)[fieldName] || "" : "";
switch (type) {
case "text":
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
case "number":
return `<input class="input" type="number" step="0.01" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
return `<input class="input" type="number" step="0.01" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
case "date":
return `<input class="input" type="date" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
return `<input class="input" type="date" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
case "textarea":
return `<textarea class="textarea" rows="3" name="custom_field[${itemId}][${fieldName}]">${value}</textarea>`;
return `<textarea class="textarea" rows="3" name="custom_field[${index}][${fieldIndex}][${fieldName}]">${value}</textarea>`;
default:
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
}
}

View File

@@ -78,15 +78,26 @@
@foreach($document->detail as $detail)
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">
{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}
<strong>{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}</strong>
</span>
<div>
@if(isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
@endphp
@foreach($dokumen_jaminan as $index => $dokumen)
&nbsp;
</div>
</div>
<div class="border-t border-gray-300 border-dashed"></div>
@if(isset($detail->dokumen_jaminan))
@php
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
$count_jaminan = 0;
@endphp
@foreach($dokumen_jaminan as $index => $dokumen)
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase pl-3">
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
</span>
<div>
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
@@ -95,30 +106,30 @@
</a>
@endif
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
<br>
@endforeach
</div>
</div>
@if(isset($detail->details))
@if(json_decode($detail->details)[$index])
@foreach (json_decode($detail->details)[$index] as $key => $value)
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase pl-3">
{{ str_replace("_"," ",$key) ?? "" }}
</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{ $value }}
</p>
</div>
<div class="border-t border-gray-300 border-dashed">
</div>
@endforeach
@endif
@endif
</div>
</div>
<div class="border-t border-gray-300 border-dashed">
</div>
@if(isset($detail->details))
@if(json_decode($detail->details))
@foreach (json_decode($detail->details) as $key => $value)
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase pl-3">
{{ str_replace("_"," ",$key) ?? "" }}
</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{ $value ?? "" }}
</p>
</div>
<div class="border-t border-gray-300 border-dashed">
</div>
@endforeach
@endif
@endforeach
@endif
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase pl-3">
keterangan
@@ -178,6 +189,7 @@
@endif
</div>
@include('lpj::component.pdfviewer')
@push('scripts')

View File

@@ -124,35 +124,41 @@
@endphp
@foreach ($permohonan->documents as $document)
@foreach ($document->detail as $detail)
@php
$details = json_decode($detail->details);
@endphp
@foreach ($document->detail as $index => $detail)
@if($detail->details)
@php $luastanah = $luasbangunan = null; @endphp
@foreach (json_decode($detail->details) as $key => $value)
@foreach($value as $k => $v)
@if($k=='luas_tanah')
@php
$luastanah += preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
@endphp
@endif
@if($k=='luas_bangunan')
@php
$luasbangunan += preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
@endphp
@endif
@endforeach
@endforeach
@if (isset($luastanah) && isset($luasbangunan))
{{ $n }}. {{ $detail->name }}<br>
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
<br>
@php $n++; @endphp
@elseif (isset($luastanah))
{{ $n }}. {{ $detail->name }}<br>
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
<br>
@php $n++; @endphp
@elseif (isset($luasbangunan))
{{ $n }}. {{ $detail->name }}<br>
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
<br>
@php $n++; @endphp
@endif
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
{{ $n }}. {{ $detail->name }}<br>
Luas Tanah / Luas Bangunan:
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
m<sup>2</sup>
/
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
m<sup>2</sup>
<br>
@php $n++; @endphp
@elseif (isset($details->luas_tanah))
{{ $n }}. {{ $detail->name }}<br>
Luas Tanah :
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
m<sup>2</sup>
<br>
@php $n++; @endphp
@elseif (isset($details->luas_bangunan))
{{ $n }}. {{ $detail->name }}<br>
Luas Bangunan:
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
m<sup>2</sup>
<br>
@php $n++; @endphp
@endif
@endforeach
@endforeach