update export basic data dan tampilan awal form surveyor

This commit is contained in:
majid
2024-11-29 22:16:04 +07:00
parent b52ffa5106
commit 8287ce3963
15 changed files with 943 additions and 773 deletions

View File

@@ -1,78 +1,122 @@
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 lg:gap-7.5">
@foreach ($permohonan->debiture->documents as $dokumen)
@if (request()->has('form') && request('form') === 'denah')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.denah', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-denah&denah={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@elseif(request()->has('form') && request('form') === 'foto')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.foto', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-foto&foto={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@elseif(request()->has('form') && request('form') === 'inspeksi')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.inspeksi', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-inspeksi&inspeksi={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
<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">
@elseif(request()->has('form') && request('form') === 'data-pembanding')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.data-pembanding', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=data-pembanding&pembanding={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@endif
<div class="card-body grid items-center">
<div class="flex flex-col gap-3">
<div class="flex justify-center pt-5">
<div class="relative size-[60px] shrink-0">
<svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48"
<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>
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>
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 left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
<i class="ki-filled ki-additem text-2xl text-brand"></i>
<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>
</div>
</div>
<div class="flex flex-col text-center">
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
@php
$formType = request()->input('form');
$formData = null;
$formAction = 'Tambah';
@endphp
<div class="flex items-center gap-2.5">
@if ($formType === 'inspeksi')
@php
$formData = $forminspeksi ?? null;
@endphp
@elseif ($formType === 'foto')
@php
$formData = $formFoto ?? null;
@endphp
@elseif ($formType === 'denah')
@php
$formData = $formDenah ?? null;
@endphp
@endif
@if ($formData)
@php
$formAction = 'Update';
@endphp
@endif
{{ $formAction }}
{{ request('form') }}
</span>
<span class="text-2sm font-normal text-gray-600">
{{ $dokumen->jenisJaminan->name ?? '' }}
</span>
<span class="flex items-center gap-1.5 leading-none font-medium text-sm text-gray-900">
{{ $dokumen->jenisJaminan->name ?? '' }}
</sp>
</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'] }}"
class="flex items-center justify-between border border-gray-200 rounded-xl gap-2 px-4 py-4 btn-outline {{ $item['icon'] ? 'btn-success' : 'btn-primary' }} hover:btn-light">
<div class="flex items-center gap-3.5">
<div class="flex flex-col">
<h1 class="text-sm font-medium text-gray-900 mb-px uppercase">
{{ $item['label'] }}
</h1>
</div>
</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' }}">
<i class="ki-filled {{ $item['icon'] ? 'ki-check-circle' : 'ki-notepad-edit'}}"></i>
</div>
</div>
</div>
</a>
@endif
@endforeach
</div>
</a>
@endforeach
</div>