update insert data json ke table ispeksi
This commit is contained in:
@@ -1,100 +1,72 @@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 lg:gap-7.5">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@php
|
||||
$jaminanId = $dokumen->jenisJaminan->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT'];
|
||||
|
||||
$href = [
|
||||
[
|
||||
'label' => 'form inspeksi',
|
||||
'url' => route('surveyor.inspeksi', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $jaminanId,
|
||||
]) . "?form=create-inspeksi&inspeksi={$permohonan->id}&jenis_jaminan={$jaminanId}",
|
||||
'show' => true,
|
||||
'icon' => !empty($currentInspeksi['data_form']),
|
||||
],
|
||||
];
|
||||
|
||||
if (!in_array(strtoupper($dokumen->jenisJaminan->name), $tanahBangunanTypes)) {
|
||||
$href[] = [
|
||||
'label' => 'denah tanah dan bangunan',
|
||||
'url' => route('surveyor.denah', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $jaminanId,
|
||||
]) . "?form=create-denah&denah={$permohonan->id}&jenis_jaminan={$jaminanId}",
|
||||
'show' => true,
|
||||
'icon' => !empty($currentInspeksi['denah_form']),
|
||||
];
|
||||
}
|
||||
|
||||
$href = array_merge($href, [
|
||||
[
|
||||
'label' => 'foto',
|
||||
'url' => route('surveyor.foto', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $jaminanId,
|
||||
]) . "?form=create-foto&foto={$permohonan->id}&jenis_jaminan={$jaminanId}",
|
||||
'show' => true,
|
||||
'icon' => !empty($currentInspeksi['foto_form']),
|
||||
],
|
||||
[
|
||||
'label' => 'data pembanding',
|
||||
'url' => route('surveyor.data-pembanding', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $jaminanId,
|
||||
]) . "?form=data-pembanding&pembanding={$permohonan->id}&jenis_jaminan={$jaminanId}",
|
||||
'show' => true,
|
||||
'icon' => !empty($currentInspeksi['data_pembanding']),
|
||||
],
|
||||
]);
|
||||
@endphp
|
||||
|
||||
<div class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg grid gap-5"
|
||||
style="padding: 20px">
|
||||
|
||||
<div class="card-group flex items-center flex-wrap sm:flex-nowrap justify-between py-4 gap-2.5">
|
||||
<div class="flex items-center gap-3.5">
|
||||
<div class="relative size-[50px] shrink-0">
|
||||
<svg class="w-full h-full stroke-gray-300 fill-gray-100" fill="none" height="48"
|
||||
viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506
|
||||
18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937
|
||||
39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z"
|
||||
fill="">
|
||||
</path>
|
||||
<path
|
||||
d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506
|
||||
18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937
|
||||
39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z"
|
||||
stroke="">
|
||||
</path>
|
||||
</svg>
|
||||
<div
|
||||
class="absolute leading-none start-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4 rtl:translate-x-2/4">
|
||||
<i class="ki-filled ki-questionnaire-tablet text-1.5xl text-gray-500">
|
||||
</i>
|
||||
</div>
|
||||
<!-- SVG code remains the same -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flex items-center gap-2.5">
|
||||
|
||||
<span class="flex items-center gap-1.5 leading-none font-medium text-sm text-gray-900">
|
||||
{{ $dokumen->jenisJaminan->name ?? '' }}
|
||||
</sp>
|
||||
{{ $dokumen->jenisJaminan->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT'];
|
||||
|
||||
$href = [
|
||||
[
|
||||
'label' => 'form inspeksi',
|
||||
'url' =>
|
||||
route('surveyor.inspeksi', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $dokumen->jenisJaminan->id,
|
||||
]) .
|
||||
"?form=create-inspeksi&inspeksi={$permohonan->id}&jenis_jaminan={$dokumen->jenisJaminan->id}",
|
||||
'show' => true,
|
||||
'icon' => $forminspeksi,
|
||||
],
|
||||
];
|
||||
|
||||
if (!in_array(strtoupper($dokumen->jenisJaminan->name), $tanahBangunanTypes)) {
|
||||
$href[] = [
|
||||
'label' => 'denah tanah dan bangunan',
|
||||
'url' =>
|
||||
route('surveyor.denah', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $dokumen->jenisJaminan->id,
|
||||
]) .
|
||||
"?form=create-denah&denah={$permohonan->id}&jenis_jaminan={$dokumen->jenisJaminan->id}",
|
||||
'show' => true,
|
||||
'icon' => $formDenah,
|
||||
];
|
||||
}
|
||||
|
||||
// Tambahkan route lainnya
|
||||
$href = array_merge($href, [
|
||||
[
|
||||
'label' => 'foto',
|
||||
'url' =>
|
||||
route('surveyor.foto', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $dokumen->jenisJaminan->id,
|
||||
]) . "?form=create-foto&foto={$permohonan->id}&jenis_jaminan={$dokumen->jenisJaminan->id}",
|
||||
'show' => true,
|
||||
'icon' => $formFoto,
|
||||
],
|
||||
[
|
||||
'label' => 'data pembanding',
|
||||
'url' =>
|
||||
route('surveyor.data-pembanding', [
|
||||
'id' => $permohonan->id,
|
||||
'jaminanId' => $dokumen->jenisJaminan->id,
|
||||
]) .
|
||||
"?form=data-pembanding&pembanding={$permohonan->id}&jenis_jaminan={$dokumen->jenisJaminan->id}",
|
||||
'show' => true,
|
||||
'icon' => $formPembanding,
|
||||
],
|
||||
]);
|
||||
@endphp
|
||||
|
||||
@foreach ($href as $item)
|
||||
@if ($item['show'])
|
||||
<a href="{{ $item['url'] }}"
|
||||
@@ -108,8 +80,7 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-5">
|
||||
<div class="flex gap-0.5">
|
||||
<div class="btn btn-sm btn-icon btn-clear {{ $item['icon'] ? '' : 'btn-light' }}">
|
||||
|
||||
<div class="btn btn-sm btn-icon btn-clear {{ $item['icon'] ? '' : 'btn-light' }}">
|
||||
<i class="ki-filled {{ $item['icon'] ? 'ki-check-circle' : 'ki-notepad-edit'}}"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user