update form data surveyor

This commit is contained in:
majid
2024-11-13 22:12:51 +07:00
parent 8e9e5e4843
commit 947cccfeac
21 changed files with 1518 additions and 1510 deletions

View File

@@ -171,6 +171,10 @@
// Get the total count of records
$totalRecords = $query->count();
$size = $request->get('size', 10);
if ($size == 0) {
$size = 10;
}
// Apply pagination if provided
if ($request->has('page') && $request->has('size')) {
@@ -185,13 +189,13 @@
$filteredRecords = $query->count();
// Get the data for the current page
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian','penilaian'])->get();
// Calculate the page count
$pageCount = ceil($totalRecords / $request->get('size'));
$pageCount = ceil($totalRecords / $size);
// Calculate the current page number
$currentPage = 0 + 1;
$currentPage = max(1, $request->get('page', 1));
// Return the response data as a JSON object
return response()->json([

File diff suppressed because it is too large Load Diff

View File

@@ -19,75 +19,50 @@ class FormSurveyorRequest extends FormRequest
*/
public function rules(): array
{
$commonRules = $this->getBangunanRules();
$actionSpecificRules = $this->getActionSpecificRules();
return array_merge($commonRules, $actionSpecificRules);
return $actionSpecificRules;
}
/**
* Get common rules that apply to all actions.
*/
private function getCommonRules(): array
{
return [
'fakta_positif' => 'nullable|array',
'fakta_negatif' => 'nullable|array',
'rute_menuju' => 'nullable',
'batas_batas' => 'nullable|array',
'kondisi_linkungan' => 'nullable|array',
'kondisi_lain_bangunan' => 'nullable|array',
'informasi_dokument' => 'nullable',
'peruntukan' => 'nullable',
'kdb' => 'nullable',
'kdh' => 'nullable',
'gsb' => 'nullable',
'max_lantai' => 'nullable',
'klb' => 'nullable',
'gss' => 'nullable',
'pelebaran_jalan' => 'nullable',
'nama_petugas' => 'nullable',
'lat' => 'nullable|numeric',
'lng' => 'nullable|numeric',
'foto_gistaru' => 'nullable',
'foto_bhumi' => 'nullable',
'foto_argis_region' => 'nullable',
'foto_tempat' => 'nullable',
'keterangan' => 'nullable',
];
}
/**
* Get rules specific to the action.
*/
private function getActionSpecificRules(): array
{
$action = $this->input('action');
$pisah = explode(',', $action);
switch ($action) {
case 'tanah':
return $this->getTanahRules();
case 'unit':
return $this->getUnitRules();
case 'kapal':
return $this->getUnitRules();
case 'kendaraan':
return $this->getUnitRules();
case 'mesin':
return $this->getUnitRules();
case 'bangunan':
return $this->getTanahBangunanRules();
case 'tanah_bangunan':
return array_merge($this->getAssetDescriptionRules(),$this->getTanahRules(), $this->getBangunanRules(), $this->getLinkunganRules(), $this->getCommonRules());
$allRules = [
'tanah' => $this->getTanahRules(),
'bangunan' => $this->getBangunanRules(),
'kapal' => $this->getKapalRules(),
'kendaraan' => $this->getKendaraanRules(),
'mesin' => $this->getMesinRules(),
'pesawat' => $this->getLinkunganRules(),
'alat-berat' => $this->getLinkunganRules(),
'apartemen-kantor' => $this->getUnitRules(),
'lingkungan' => $this->getLinkunganRules(),
'fakta' => $this->getCommonRules(),
];
case 'alat-berat':
return $this->getUnitRules();
default:
return [];
$rules = [];
$hasAssetDescriptionRules = false;
foreach ($pisah as $act) {
if (isset($allRules[$act])) {
$rules = array_merge($rules, $allRules[$act]);
if ($act == 'tanah' || $act == 'bangunan') {
$hasAssetDescriptionRules = true;
}
}
}
}
if ($hasAssetDescriptionRules) {
$rules = array_merge($rules, $this->getAssetDescriptionRules());
}
return $rules;
}
/**
* Get rules specific to tanah action.
*/
@@ -133,9 +108,9 @@ class FormSurveyorRequest extends FormRequest
];
}
/**
* Get rules specific to unit action.
*/
/**
* Get rules specific to unit action.
*/
private function getUnitRules(): array
{
return [
@@ -164,7 +139,7 @@ class FormSurveyorRequest extends FormRequest
'jarak_cbd_point' => 'nullable',
'nama_cbd_point' => 'nullable',
'lebar_perkerasan_jalan' => 'nullable',
'perkerasan_jalan' => 'nullable',
'perkerasan_jalan.*' => 'nullable',
'lalu_lintas' => 'nullable',
'gol_mas_sekitar' => 'nullable',
'tingkat_keramaian' => 'nullable',
@@ -223,24 +198,57 @@ class FormSurveyorRequest extends FormRequest
private function getAssetDescriptionRules(): array
{
return [
'permohonan_id' => 'required',
'type' => 'required',
'debitur_perwakilan' => 'required|array',
'jenis_asset' => 'required',
'jenis_asset_tidak_sesuai' => 'nullable',
'alamat_sesuai' => 'required',
'alamat_tidak_sesuai' => 'nullable',
'nama_jalan' => 'nullable',
'desa_kelurahan' => 'nullable',
'kecamatan' => 'nullable',
'kota_kabupaten' => 'nullable',
'provinsi' => 'nullable',
'kordinat_lng' => 'nullable',
'kordinat_lat' => 'nullable',
];
}
{
return [
'permohonan_id' => 'required',
'type' => 'required',
'debitur_perwakilan' => 'required|array',
'jenis_asset' => 'required',
'jenis_asset_tidak_sesuai' => 'nullable',
'alamat_sesuai' => 'required',
'alamat_tidak_sesuai' => 'nullable',
'nama_jalan' => 'nullable',
'desa_kelurahan' => 'nullable',
'kecamatan' => 'nullable',
'kota_kabupaten' => 'nullable',
'provinsi' => 'nullable',
'kordinat_lng' => 'nullable',
'kordinat_lat' => 'nullable',
];
}
/**
* Get common rules that apply to all actions.
*/
private function getCommonRules(): array
{
return [
'fakta_positif' => 'nullable|array',
'fakta_negatif' => 'nullable|array',
'rute_menuju' => 'nullable',
'batas_batas' => 'nullable|array',
'kondisi_lingkungan' => 'nullable|array',
'kondisi_lain_bangunan' => 'nullable|array',
'informasi_dokument' => 'nullable',
'peruntukan' => 'nullable',
'kdb' => 'nullable',
'kdh' => 'nullable',
'gsb' => 'nullable',
'max_lantai' => 'nullable',
'klb' => 'nullable',
'gss' => 'nullable',
'pelebaran_jalan' => 'nullable',
'nama_petugas' => 'nullable',
'lat' => 'nullable|numeric',
'lng' => 'nullable|numeric',
'foto_gistaru' => 'nullable',
'foto_bhumi' => 'nullable',
'foto_argis_region' => 'nullable',
'foto_tempat' => 'nullable',
'keterangan' => 'nullable',
];
}
}

View File

@@ -19,6 +19,7 @@
'name' => 'required|max:255',
'slug' => 'required|max:255',
'jenis_legalitas_jaminan_id' => 'nullable',
'form_kategori.*' => 'required',
];
}

View File

@@ -5,5 +5,5 @@ namespace Modules\Lpj\Models;
class JenisJaminan extends Base
{
protected $table = 'jenis_jaminan';
protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id'];
protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id', 'form_kategori'];
}

View File

@@ -19,7 +19,7 @@ class Penilaian extends Model
protected $fillable = [
'jenis_penilaian_id', 'penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by','waktu_penilaian', 'deskripsi_penilaian'
];
public function jenis_penilaian()

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('jenis_jaminan', function (Blueprint $table) {
$table->json('form_kategori')->after('slug')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('jenis_jaminan', function (Blueprint $table) {
$table->dropColumn('form_kategori');
});
}
};

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('penilaian', function (Blueprint $table) {
$table->datetime('waktu_penilaian')->nullable();
$table->text('deskripsi_penilaian')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('penilaian', function (Blueprint $table) {
$table->dropColumn('waktu_penilaian');
$table->dropColumn('deskripsi_penilaian');
});
}
};

View File

@@ -66,6 +66,28 @@
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Form Kategori</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('form_kategori') border-danger bg-danger-light @enderror select2"
name="form_kategori[]" multiple="multiple">
<option value="">Pilih Form</option>
@foreach (['tanah', 'bangunan', 'kapal', 'kendaraan', 'mesin', 'pesawat', 'alat-berat', 'apartemen-kantor','lingkungan', 'fakta'] as $item)
<option value="{{ $item }}"
@if (isset($jenisJaminan->form_kategori) && in_array($item, json_decode($jenisJaminan->form_kategori, true))) {{ 'selected' }} @endif>
{{ $item }}
</option>
@endforeach
</select>
@error('form_kategori')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Jenis Legalitas Jaminan

View File

@@ -162,7 +162,7 @@
debitur_id: {
title: 'Debitur',
render: (item, data) => {
if(data.debiture) {
if (data.debiture) {
return `${data.debiture.name}`;
}
return "-";
@@ -183,21 +183,33 @@
actions: {
title: 'Actions',
render: (item, data) => {
var actionHtml = `
<div class="flex flex-nowrap justify-center gap-1.5">`;
if(data.status !== 'order'){
actionHtml += `<a class="btn btn-sm btn-outline btn-success" href="permohonan/${data.id}">
<i class="ki-filled ki-document"></i>
</a>`;
let actionHtml = `<div class="flex flex-nowrap justify-center gap-1.5">`;
if (data && data.penilaian && data.penilaian.waktu_penilaian !== null && data.status !==
'done') {
actionHtml += `
<a class="btn btn-sm btn-outline btn-primary" href="surveyor/storeAproved/${data.penilaian.id}">
<i class="ki-filled ki-calendar-edit"></i>
</a>
`;
}
if (data.status !== 'order') {
actionHtml += `
<a class="btn btn-sm btn-outline btn-success" href="permohonan/${data.id}">
<i class="ki-filled ki-document"></i>
</a>
`;
}
actionHtml += `
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-outline btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit">
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-outline btn-danger">
<i class="ki-outline ki-trash"></i>
</a>
</div>`;
return actionHtml;
},
@@ -214,3 +226,4 @@
});
</script>
@endpush

View File

@@ -1,4 +1,3 @@
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
<div class="card-body">
<div class="">
@@ -20,7 +19,7 @@
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
<em id="error-luas_tanah_bagunan" class="alert text-danger text-sm"></em>
<em id="error-luas_tanah_bagunan" class="alert text-danger text-sm"></em>
</div>
</div>
@@ -34,28 +33,26 @@
@foreach ($jenisBangunan as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="jenis_bangunan[]" type="checkbox"
value="{{ $item->name }}" {{
old('jenis_bangunan') == $item->name || isset($forminspeksi['jenis_bangunan']) == $item->name ? 'checked' : ''
}}/>
value="{{ $item->name }}"
{{ old('jenis_bangunan') == $item->name || isset($forminspeksi['jenis_bangunan']) == $item->name ? 'checked' : '' }} />
{{ $item->name }}
</label>
@if (strcasecmp($item->name, 'lainnya') == 0)
<div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="jenis_bangunan[]" type="checkbox"
value="{{ $item->name }}" />
{{ $item->name }}
</label>
<input type="text" name="jenis_bangunan" class="input mt-2" id="bentukTanahInput"
placeholder="Masukkan Jenis Bangunan...">
</div>
<div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="jenis_bangunan[]" type="checkbox"
value="{{ $item->name }}" />
{{ $item->name }}
</label>
<input type="text" name="jenis_bangunan" class="input mt-2"
id="bentukTanahInput" placeholder="Masukkan Jenis Bangunan...">
</div>
@endif
@endforeach
@endif
</div>
<em id="error-jenis_bangunan" class="alert text-danger text-sm"></em>
<em id="error-jenis_bangunan" class="alert text-danger text-sm"></em>
</div>
</div>
@@ -69,18 +66,20 @@
@foreach ($kondisiBangunan as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="kondisi_bangunan[]" type="checkbox"
value="{{ $item->name }}" {{ in_array($item->name, old('kondisi_bangunan', $forminspeksi['kondisi_bangunan'] ?? [])) ? 'checked' : '' }} />
value="{{ $item->name }}"
{{ in_array($item->name, old('kondisi_bangunan', $forminspeksi['kondisi_bangunan'] ?? [])) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@if (strcasecmp($item->name, 'lainnya') == 0)
<div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="kondisi_bangunan[]" type="checkbox"
value="{{ $item->name }}" {{ in_array($item->name, old('kondisi_bangunan', $forminspeksi['kondisi_bangunan'] ?? [])) ? 'checked' : '' }} />
value="{{ $item->name }}"
{{ in_array($item->name, old('kondisi_bangunan', $forminspeksi['kondisi_bangunan'] ?? [])) ? 'checked' : '' }} />
{{ $item->name }}
</label>
<input type="text" name="kondisi_bangunan_lainnya" class="input mt-2" id="bentukTanahInput"
placeholder="Masukkan Kondisi Bangunan..."
<input type="text" name="kondisi_bangunan_lainnya" class="input mt-2"
id="bentukTanahInput" placeholder="Masukkan Kondisi Bangunan..."
value="{{ old('kondisi_bangunan_lainnya', $forminspeksi['kondisi_bangunan_lainnya'] ?? '') }}">
</div>
@endif
@@ -101,11 +100,12 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
<input class="checkbox" name="sifat_bangunan[]" type="checkbox"
value="{{ $item->name }}" {{ in_array($item->name, old('sifat_bangunan', $forminspeksi['sifat_bangunan'] ?? [])) ? 'checked' : '' }} />
value="{{ $item->name }}"
{{ in_array($item->name, old('sifat_bangunan', $forminspeksi['sifat_bangunan'] ?? [])) ? 'checked' : '' }} />
{{ $item->name }}
</label>
<input type="text" name="sifat_bangunan_input[]" class="input w-full" id="sifat_bangunan"
placeholder="Masukkan {{ $item->name }}..."
<input type="text" name="sifat_bangunan_input[]" class="input w-full"
id="sifat_bangunan" placeholder="Masukkan {{ $item->name }}..."
value="{{ old('sifat_bangunan_input.' . $loop->index, $forminspeksi['sifat_bangunan_input'][$loop->index] ?? '') }}">
</div>
@endforeach
@@ -128,7 +128,8 @@
@if (@isset($spekKategoriBagunan))
@foreach ($spekKategoriBagunan as $item)
<div>
<input type="hidden" name="spek_kategori_bangunan[]" value="{{ $item->name }}">
<input type="hidden" name="spek_kategori_bangunan[]"
value="{{ $item->name }}">
<label
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
<div class="flex flex-wrap items-baseline w-full">
@@ -136,7 +137,8 @@
@foreach ($spekBangunan as $spek)
@if ($spek->spek_kategori_bangunan_id == $item->id)
<label class="form-label flex items-center gap-2.5">
<input class="checkbox" name="spek_bangunan_{{ $item->name }}[]"
<input class="checkbox"
name="spek_bangunan_{{ $item->name }}[]"
type="checkbox" value="{{ $spek->name }}" />
{{ $spek->name }}
</label>
@@ -144,7 +146,8 @@
@endforeach
</div>
<em id="error-spek_bangunan_{{ $item->name }}" class="alert text-danger text-sm"></em>
<em id="error-spek_bangunan_{{ $item->name }}"
class="alert text-danger text-sm"></em>
</div>
</div>
@endforeach
@@ -175,11 +178,12 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
<input class="checkbox" name="sarana_pelengkap[]" type="checkbox"
value="{{ $item->name }}" {{ in_array($item->name, old('sarana_pelengkap', $forminspeksi['sarana_pelengkap'] ?? [])) ? 'checked' : '' }} />
value="{{ $item->name }}"
{{ in_array($item->name, old('sarana_pelengkap', $forminspeksi['sarana_pelengkap'] ?? [])) ? 'checked' : '' }} />
{{ $item->name }}
</label>
<input type="text" name="sarana_pelengkap_input[]" class="input w-full" id="bentukTanahInput"
placeholder="Masukkan {{ $item->name }}..."
<input type="text" name="sarana_pelengkap_input[]" class="input w-full"
id="bentukTanahInput" placeholder="Masukkan {{ $item->name }}..."
value="{{ old('sarana_pelengkap_input.' . $loop->index, $forminspeksi['sarana_pelengkap_input'][$loop->index] ?? '') }}">
</div>
@endforeach
@@ -188,8 +192,9 @@
<em id="error-sarana_pelengkap" class="alert text-danger text-sm"></em>
</div>
</div>
</div>
</div>
</div>
@push('scripts')
<script>
const spekBangunanContainer = document.getElementById('spek-bangunan-container');

View File

@@ -1,163 +1,74 @@
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 lg:gap-7.5">
@foreach ($permohonan->debiture->documents as $dokumen)
@php
$jenisAnalisa = null;
$perbandingan = null;
if (request()->has('form') && request('form') === 'denah' && isset($denah)) {
$denahIds = [];
$permohonaDenahId = [];
foreach ($denah as $item) {
$denahIds[] = $item->jenis_jaminan_id;
$permohonaDenahId[] = $item->permohonan_id;
}
$perbandingan =
in_array($dokumen->jenisJaminan->id, $denahIds) && in_array($permohonan->id, $permohonaDenahId);
} elseif (request()->has('form') && request('form') === 'foto' && isset($fotojaminan)) {
$fotoIds = [];
$permohonanFotoId = [];
foreach ($fotojaminan as $item) {
$fotoIds[] = $item->jenis_jaminan_id;
$permohonanFotoId[] = $item->permohonan_id;
}
} elseif (request()->has('form') && request('form') === 'inspeksi' && isset($analisa)) {
$jenisIds = [];
foreach ($analisa as $item) {
$jenisIds[] = $item->jenis_jaminan_id;
}
}
@endphp
@if ($perbandingan)
<div class="card flex flex-col gap-5 p-5 lg:p-7.5">
<div class="flex items-center flex-wrap justify-between gap-1">
<div class="flex items-center gap-2.5">
<div class="relative size-[44px] shrink-0">
<svg class="w-full h-full stroke-primary-clarity fill-primary-light" 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 left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
<i class="ki-filled ki-add-files text-1.5xl text-primary"></i>
</div>
</div>
</div>
<div class="menu inline-flex" data-menu="true">
<div class="flex flex-nowrap justify-center gap-1.5">
@php
$formTypes = [
'denah' => [
'model' => $denah,
'route' => 'surveyor.denah',
'update' => 'update-denah',
],
'foto' => [
'model' => $fotojaminan,
'route' => 'surveyor.foto',
'update' => 'update-foto',
],
'inspeksi' => [
'model' => $analisa,
'route' => 'surveyor.inspeksi',
'update' => 'update-inspeksi',
],
];
$currentForm = request('form');
$formConfig = $formTypes[$currentForm] ?? null;
@endphp
@if ($formConfig && isset($formConfig['model']))
<a href="{{ route($formConfig['route'], ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form={{ $formConfig['update'] }}&{{ $currentForm }}={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}"
class="btn btn-sm btn-icon btn-outline btn-info">
<i class="ki-outline ki-notepad-edit"></i>
</a>
@endif
{{-- <a class="delete btn btn-sm btn-icon btn-outline btn-danger">
<i class="ki-outline ki-trash"></i>
</a> --}}
</div>
</div>
</div>
<div class="grid">
{{-- Display your analisa data here --}}
<div class="flex items-center justify-between flex-wrap mb-3.5 gap-2"><span
class="text-2xs text-gray-600uppercase">Tipe Analisa</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{-- {{ $analisa->type }} --}}
</p>
</div>
{{-- Add more fields as needed --}}
{{-- @endif
@if ($analisa->analisaLingkungan) --}}
<div class="border-t border-gray-300 border-dashed"></div>
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">Analisa Lingkungan</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{-- Display relevant analisaLingkungan data --}}
</p>
</div>
{{-- @endif --}}
{{-- @if ($analisa->analisaFakta) --}}
<div class="border-t border-gray-300 border-dashed"></div>
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">Analisa Fakta</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">{{-- Display relevant analisaFakta data --}}
</p>
</div>
{{-- @endif --}}
</div>
</div>
@else
@if (request()->has('form') && request('form') === 'denah')
@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.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')
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.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 }}">
@endif
href="{{ route('surveyor.inspeksi', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-inspeksi&inspeksi={{ $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"
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 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>
<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"
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 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>
</div>
<div class="flex flex-col text-center">
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
Tambah {{ request('form') }}
</span>
<span class="text-2sm font-normal text-gray-600">
Inspeksi {{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</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
@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>
</div>
</div>
</a>
@endif
</div>
</a>
@endforeach
</div>

View File

@@ -23,7 +23,8 @@
@foreach ($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accoordion_detail_jaminan_{{ $loop->index }}">
<button class="accordion-toggle py-4 group mx-8"
data-accordion-toggle="#accoordion_detail_jaminan_{{ $loop->index }}">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
@@ -117,9 +118,8 @@
<div class="card">
<div class="card-body">
<form
action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('surveyor.storeDenah') }}"
method="POST" class="grid gap-5" enctype="multipart/form-data">
<form id="formDenah" method="POST" class="grid gap-5" enctype="multipart/form-data">
@if (isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT')
@@ -134,18 +134,27 @@
<div>
</div>
<div class="flex flex-wrap gap-4" style="margin-top: 20px">
<div class="flex w-full items-center justify-center gap-4">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Upload Denah</span>
</label>
<input type="file"
value="{{ old('foto_denah', isset($denah->foto_denah) ? $denah->foto_denah : '') }}"
name="foto_denah" class="file-input file-input-bordered w-full " accept="image/*">
<div class="w-full grid gap-5">
<img id="foto_denah"
src="{{ isset($formFoto['foto_denah']) ? asset('storage/' . old('foto_denah', $formFoto['foto_denah'])) : '#' }}"
alt="Gambar foto_denah" style="width: 30rem;">
<div class="input-group w-full flex gap-2">
<input type="file"
value="{{ old('foto_denah', isset($formDenah['foto_denah']) ? $formDenah['foto_denah'] : '') }}"
name="foto_denah" class="file-input file-input-bordered w-full "
accept="image/*">
</div>
</div>
</div>
</div>
@error('foto_denah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<em id="error-foto_denah" class="alert text-danger text-sm"></em>
</div>
</div>
@@ -160,7 +169,7 @@
<span class="form-label">Masukkan total luas tanah</span>
</label>
<input type="text" name="luas" class="input w-full "
value="{{ old('luas', isset($denah->luas) ? $denah->luas : '') }}">
value="{{ old('luas', isset($formDenah['luas']) ? $formDenah['luas'] : '') }}">
</div>
</div>
@@ -170,15 +179,70 @@
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success">
Save
<button type="button" class="btn btn-success" id="saveButton" onclick="submitDenah()">
<span id="saveButtonText">Save</span>
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;"
id="saveButtonSpinner">
<span class="visually-hidden">Loading...</span>
</div>
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@endsection
@push('scripts')
<script>
function submitDenah() {
const formElement = $('#formDenah')[0];
const formData = new FormData(formElement);
// Disable the button and show the spinner
$('#saveButton').prop('disabled', true);
$('#saveButtonText').hide();
$('#saveButtonSpinner').show();
$.ajax({
url: '{{ route('surveyor.storeDenah') }}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
success: function(response) {
if (response.success) {
window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=denah';
}
console.log(response);
},
error: function(xhr, status, error) {
let errors = xhr.responseJSON?.errors;
$('.alert').text('');
if (errors) {
$.each(errors, function(key, value) {
$(`#error-${key}`).text(value[0]);
});
}
console.error('Terjadi error:', error); // Menampilkan pesan error di konsol
console.log('Status:', status);
console.log('Response:', xhr.responseText);
console.log(errors);
},
complete: function() {
// Re-enable the button and hide the spinner
$('#saveButton').prop('disabled', false);
$('#saveButtonText').show();
$('#saveButtonSpinner').hide();
}
});
}
</script>
@endpush

View File

@@ -28,7 +28,7 @@
</button>
</div>
@if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat')
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Rute Menuju</label>
<div class="flex flex-wrap items-baseline w-full">
@@ -84,9 +84,9 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondisi lain terkait lingkungan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="kondisi_linkungan[]" rows="3">{{ old('kondisi_linkungan.0', $forminspeksi['kondisi_linkungan'][0] ?? '') }}</textarea>
<textarea class="textarea mt-2" name="kondisi_lingkungan[]" rows="3">{{ old('kondisi_lingkungan.0', $forminspeksi['kondisi_lingkungan'][0] ?? '') }}</textarea>
<em id="error-kondisi_linkungan" class="alert text-danger text-sm"></em>
<em id="error-kondisi_lingkungan" class="alert text-danger text-sm"></em>
</div>
<button class="btn btn-primary btn-sm mt-5 ">
@@ -121,14 +121,14 @@
<i class="ki-outline ki-plus"></i>
</button>
</div>
@endif
</div>
</div>
</div>
<!-- Informasi Tata Ruang -->
@if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat')
<div class="card w-full bg-white">
<div class="card-body">
<div class="py-4">
@@ -315,6 +315,7 @@
<div class="w-full">
<input id="foto_tempat" type="file" name="foto_tempat"
class="file-input file-input-bordered w-full" accept="image/*"
onchange="previewImage(this, 'argis-region-preview')">
<img id="argis-region-preview"
@@ -335,7 +336,7 @@
</div>
</div>
</div>
@endif
<script>
function previewImage(input, previewId) {
if (input.files && input.files[0]) {

View File

@@ -83,48 +83,30 @@
{{-- <div class="card">
<div class="card-body"> --}}
<form id="formFoto" method="POST" class="grid gap-5" enctype="multipart/form-data">
@if (isset($fotoJaminan->id))
<input type="hidden" name="id" value="{{ $fotoJaminan->id }}">
@method('PUT')
@endif
@csrf
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
@php
$data = [
'tanah' => 'Tanah',
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
'tanah_bangunan' => 'Mall',
];
$analisaType = 'tanah';
if (isset($analisa->id)) {
$analisaType = $analisa->type ?? 'unknown';
} else {
foreach ($data as $key => $value) {
if (
isset($jenisJaminanData) &&
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
) {
$analisaType = $key;
break;
}
}
}
if ($analisaType === 'tanah') {
$analisaType = 'tanah_bangunan';
}
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
$analisaType = 'unit';
}
@endphp
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
@foreach ($permohonan->debiture->documents as $dokumen)
@if ($dokumen->jenisJaminan)
@php
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
@endphp
<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
@endforeach
<div class="card bg-white rounded-lg shadow-md">
@@ -136,263 +118,220 @@
</button>
</div>
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->ruteJaminan as $item)
@if (isset($item->foto_rute))
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
@if (isset($formFoto['rute_menuju_lokasi']))
@foreach ($formFoto['rute_menuju_lokasi'] as $index => $photo)
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<div class="flex w-full items-center justify-center gap-4 mb-4"
id="photoContainer-{{ $index }}">
<label class="form-label max-w-56">
<span class="form-label">Foto Rute Menuju Lokasi</span>
</label>
<div class="w-full grid gap-5">
<div class="input-group w-full flex flex-col gap-2">
<img id="foto_rute-preview-{{ $index }}"
src="{{ asset('storage/' . $photo['foto_rute']) }}"
alt="Foto Rute {{ $index }}" class="mt-2 h-auto"
style="display: block; width: 30rem;">
<div class="input-group w-full flex gap-2">
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
<input id="inputRute" type="file" name="foto_rute[]"
<div class="input-group w-full gap-2">
<input class="name_rute" type="hidden" name="name_rute[]"
value="rute_{{ $index }}">
<input id="inputRute-{{ $index }}" type="file" name="foto_rute[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
capture="camera"
onchange="previewImage(this, 'foto_rute-preview-{{ $index }}')">
<button type="button" id="btnCamera-{{ $index }}" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Rute Menuju Lokasi</span>
</label>
<div class="input-group w-full flex gap-2">
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
{{-- <img id="foto_rute-preview" src="" alt="Foto Argis Region"
class="mt-2 max-w-full h-auto" style="display: none;"> --}}
<input id="inputRute" type="file" name="foto_rute[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
onchange="previewImage(this, 'foto_rute-preview')">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
<!-- Delete button to remove photo -->
<button type="button" class="btn btn-danger btn-sm delete-btn"
onclick="deletePhoto('{{ $index }}')">
<i class="ki-filled ki-trash"></i>
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
@endforeach
</div>
@else
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Rute Menuju Lokasi</span>
</label>
<div class="input-group w-full flex flex-col gap-2">
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Gerbang & Nama Perumahan</span>
</label>
<div class="input-group w-full flex gap-2">
<input class="name_gerbang" type="hidden" name="name_gerbang" value="rute">
{{-- <img id="foto_gerbang-preview" src="" alt="Foto Gerbong"
class="mt-2 max-w-full h-auto" style="display: none;"> --}}
<input id="inputRute" type="file" name="foto_gerbang"
<img id="foto_rute-preview" src="" alt="Foto Rute" class="mt-2 h-auto"
style="display: none; width: 30rem;">
<div class="input-group w-full gap-2">
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
<input id="inputRute" type="file" name="foto_rute[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
onchange="previewImage(this, 'foto_gerbang-preview')">
onchange="previewImage(this, 'foto_rute-preview')">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
<span class="alert text-danger text-sm"></span>
</div>
@endif
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Gerbang & Nama Perumahan</span>
</label>
<div class="input-group w-full flex flex-col gap-2">
<input class="name_gerbang" type="hidden" name="name_gerbang" value="rute">
<img id="foto_gerbang-preview"
src="{{ isset($formFoto['gerbang']) ? asset('storage/' . $formFoto['gerbang']) : '' }}"
alt="Foto Gerbong" class="mt-2 max-w-full h-auto"
style="{{ isset($formFoto['gerbang']) ? '' : 'display: none;' }} width: 30rem;">
<div class="input-group w-full flex gap-2">
<input id="inputRute" type="file" name="foto_gerbang"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
onchange="previewImage(this, 'foto_gerbang-preview')">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
</div>
</div>
<span class="alert text-danger text-sm"></span>
</div>
<div id="ruteLainnya" style="margin-top: 10px">
</div>
<button type="button" class="btn btn-primary btn-sm" id="btnAddMore" style="margin-top: 10px">
<i class="ki-outline ki-plus text-2sm"></i>
Lainnya
</button>
</div>
</div>
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
</div>
@php
$objekViews = [];
if ($analisaType === 'tanah_bangunan') {
$objekViews = [
['label' => 'Tampak Samping Kiri', 'index' => 0],
['label' => 'Tampak Samping Kanan', 'index' => 1],
['label' => 'Nomor Rumah/Unit', 'index' => 2],
];
} elseif ($analisaType === 'unit') {
$objekViews = [
['label' => 'Tampak Loby', 'index' => 0],
['label' => 'Tampak Lift', 'index' => 1],
['label' => 'Tampak Samping Kiri Unit', 'index' => 2],
['label' => 'Tampak Samping Kanan Unit', 'index' => 3],
['label' => 'Tampak Depan Unit', 'index' => 4],
['label' => 'Nomor Unit', 'index' => 5],
];
}
@endphp
@if (count($objekViews) > 0)
@foreach ($objekViews as $view)
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
<div class="flex w-full gap-4">
<label class="form-label max-w-56"><span class="form-label">{{ $view['label'] }}</span>
</label>
<input type="hidden" class="form-control" name="name_objek[]"
value="{{ $view['label'] }}" />
<div class="w-full grid gap-5">
<img id="foto_object_jaminan_preview_{{ $view['index'] }}"
src="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_object']) ? asset('storage/' . $formFoto['object_jaminan'][$view['index']]['foto_object']) : '' }}"
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
onchange="previewImage(this, 'foto_object_jaminan_preview_{{ $view['index'] }}')" style="{{ isset($formFoto['foto_object']) ? '' : 'display: none;' }} width: 30rem;">
<div class="input-group w-full flex gap-2">
<input type="file" name="foto_objek[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($formFoto) && isset($formFoto['object_jaminan'][$view['index']]) ? str_replace($view['label'] . ': ', '', $formFoto['object_jaminan'][$view['index']]['deskripsi_objek']) : '' }}</textarea>
</div>
</div>
<span class="alert text-danger text-sm"></span>
</div>
<div id="ruteLainnya" style="margin-top: 10px">
</div>
<button type="button" class="btn btn-primary btn-sm" id="btnAddMore" style="margin-top: 10px">
<i class="ki-outline ki-plus text-2sm"></i>
Lainnya
</button>
@endforeach
@else
<div class="p-4">
<p class="text-gray-500">Tipe analisa tidak valid atau belum dipilih.</p>
</div>
</div>
@endif
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
<div class="flex flex-wrap gap-4 w-full">
<div class="w-full ">
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
<label class="form-label">
<span class="form-label">Lantai</span>
</label>
<button type="button" id="btnLantai" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@php
$objekViews = [];
if ($analisaType === 'tanah_bangunan') {
$objekViews = [
['label' => 'Tampak Samping Kiri', 'index' => 0],
['label' => 'Tampak Samping Kanan', 'index' => 1],
['label' => 'Nomor Rumah/Unit', 'index' => 2],
];
} elseif ($analisaType === 'unit') {
$objekViews = [
['label' => 'Tampak Loby', 'index' => 0],
['label' => 'Tampak Lift', 'index' => 1],
['label' => 'Tampak Samping Kiri Unit', 'index' => 2],
['label' => 'Tampak Samping Kanan Unit', 'index' => 3],
['label' => 'Tampak Depan Unit', 'index' => 4],
['label' => 'Nomor Unit', 'index' => 5],
];
}
@endphp
@if (count($objekViews) > 0)
@foreach ($objekViews as $view)
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
<div class="flex w-full gap-4">
<label class="form-label max-w-56"><span
class="form-label">{{ $view['label'] }}</span>
@if (isset($formFoto['foto_lantai_unit']))
@foreach ($formFoto['foto_lantai_unit'] as $item)
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Lantai 1</span>
</label>
<input type="hidden" class="form-control" name="name_objek[]"
value="{{ $view['label'] }}" />
<div class="w-full grid gap-5">
@if (isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]))
<img src="{{ asset('storage/' . $fotoJaminan->objekJaminan[$view['index']]->foto_objek) }}"
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
style="width: 12rem;">
@endif
<div class="input-group w-full flex gap-2">
<input type="file" name="foto_objek[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]) ? str_replace($view['label'] . ': ', '', $fotoJaminan->objekJaminan[$view['index']]->name_objek) : '' }}</textarea>
<img src="{{ asset('storage/' . old('foto_lantai_unit', $item['foto_lantai_unit'])) }}"
alt="Gambar Pendamping" style="width: 30rem;">
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_objek.' . $view['index'])
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_objek.' . $view['index'])
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div class="p-4">
<p class="text-gray-500">Tipe analisa tidak valid atau belum dipilih.</p>
</div>
@endif
<div class="flex flex-wrap gap-4 w-full">
<div class="w-full ">
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
<label class="form-label">
<span class="form-label">Lantai</span>
</label>
<button type="button" id="btnLantai" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->lantaiUnit as $item)
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Lantai 1</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('foto_lantai_unit', $item->foto_lantai_unit)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Lantai 1</span>
</label>
<div class="input-group w-full flex gap-2">
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
<div id="inputContainerBasement" class="w-full" style="margin-top: 10px">
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Basement</span>
<span class="form-label">Foto Lantai 1</span>
</label>
<div class="input-group w-full flex gap-2">
<input type="hidden" name="name_basement" value="basement">
<input id="inputLantai" type="file" name="foto_basement"
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
@@ -408,157 +347,179 @@
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
<div id="inputContainerBasement" class="w-full" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Basement</span>
</label>
<div class="input-group w-full flex flex-col gap-2">
<input type="hidden" name="name_basement" value="basement">
<div id="lantaiLainnya" style="margin-top: 10px">
<img id="basement"
src="{{ isset($formFoto['basement']) ? asset('storage/' . old('basement', $formFoto['basement'])) : '#' }}"
alt="Gambar basement" style="width: 30rem;" onerror="this.style.display='none';"
onchange="previewImage(this, 'basement')">
<div class="input-group w-full flex gap-2">
<input id="inputLantai" type="file" name="foto_basement"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
<div id="lantaiLainnya" style="margin-top: 10px">
<button type="button" class="btn btn-primary btn-sm" id="btnAddMoreObject"
style="margin-top: 10px">
<i class="ki-outline ki-plus text-2sm"></i>
Lainnya
</button>
</div>
</div>
<button type="button" class="btn btn-primary btn-sm" id="btnAddMoreObject"
style="margin-top: 10px">
<i class="ki-outline ki-plus text-2sm"></i>
Lainnya
</button>
</div>
</div>
</div>
</div>
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@if (isset($formFoto['lingkungan']))
@foreach ($formFoto['lingkungan'] as $item)
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<div class="w-full grid gap-5">
<img src="{{ asset('storage/' . old('foto_lingkungan', $item['foto_lingkungan'])) }}"
alt="Gambar Pendamping" style="width: 30rem;">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->lingkungan as $item)
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<div class="input-group w-full flex gap-2">
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<div class="input-group w-full flex gap-2">
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
</div>
</div>
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Pendamping</h1>
</div>
<div style="margin-top: 5px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Pendamping</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<div class="input-group w-full flex gap-2">
<input id="inputPendamping" type="file" name="pendamping"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('pendamping')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
<span class="alert text-danger text-sm"></span>
</div>
@endforeach
@else
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<div class="input-group w-full flex gap-2">
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
<span class="alert text-danger text-sm"></span>
</div>
@endif
</div>
</div>
<div class="card bg-white rounded-lg shadow-md">
<div class="card-body">
<div class=" text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Pendamping</h1>
</div>
<div style="margin-top: 5px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Pendamping</span>
</label>
<div class="w-full grid gap-5">
<img id="pendamping"
src="{{ isset($formFoto['pendamping']) ? asset('storage/' . old('pendamping', $formFoto['pendamping'])) : '#' }}"
alt="Gambar Pendamping" style="width: 30rem;" onerror="this.style.display='none';"
onchange="previewImage(this, 'pendamping')">
<div class="input-group w-full flex gap-2">
<input id="inputPendamping" type="file" name="pendamping"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" id="btnCamera" class="btn btn-light"
data-modal-toggle="#cameraModal">
<i class="ki-outline ki-abstract-33"></i> Camera
</button>
</div>
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('pendamping')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="button" class="btn btn-success" id="saveButtonFoto" onclick="submitFoto()">
<span id="saveButtonFotoText">Save</span>
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;"
id="saveButtonSpinner">
<span class="visually-hidden">Loading...</span>
</div>
</button>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="button" class="btn btn-success" id="saveButtonFoto" onclick="submitFoto()">
<span id="saveButtonFotoText">Save</span>
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;"
id="saveButtonSpinner">
<span class="visually-hidden">Loading...</span>
</div>
</button>
</div>
</form>
{{--
</form>
{{--
</div>
</div> --}}
</div>

View File

@@ -10,7 +10,7 @@
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
Form Inspeksi
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('surveyor.show', ['id' => request('inspeksi')]) }}?form=inspeksi"
@@ -19,107 +19,6 @@
</a>
</div>
</div>
@php
$jenisJaminanData = null;
@endphp
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
@php
$jenisJaminanData = $dokumen->jenisJaminan->name ?? '';
@endphp
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8"
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_detail_jaminan_{{ $loop->index }}">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? '' }},
<br> {{ $dokumen->pemilik->village->name ?? '' }},
{{ $dokumen->pemilik->district->name ?? '' }},
{{ $dokumen->pemilik->city->name ?? '' }},
{{ $dokumen->pemilik->province->name ?? '' }} -
{{ $dokumen->pemilik->village->postal_code ?? '' }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<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-normaltext-sm">
{{ $detail->name ?? '' }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if (isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</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>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
@@ -128,91 +27,44 @@
{{-- <div class="card">
<div class="card-body"> --}}
<form id="formInspeksi" method="POST" enctype="multipart/form-data" class="grid gap-5">
@if (isset($analisa->id))
<input type="hidden" name="id" value="{{ $analisa->id }}">
@method('PUT')
@endif
@csrf
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
@php
$analisaType = 'unknown';
$data = [
'tanah' => 'Tanah',
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
'tanah_bangunan' => 'Mall',
];
if (isset($analisa->id)) {
$analisaType = $analisa->type;
} else {
foreach ($data as $key => $value) {
if (
isset($jenisJaminanData) &&
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
) {
$analisaType = $key;
break;
}
}
}
if ($analisaType === 'tanah') {
$analisaType = 'tanah_bangunan';
}
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
$analisaType = 'unit';
}
@endphp
<input type="hidden" name="action" value="{{ $analisaType }}">
<input type="hidden" name="type" value="{{ $analisaType }}">
@if ($analisaType == 'tanah_bangunan')
@include('lpj::surveyor.components.tanah')
@elseif($analisaType == 'unit')
@include('lpj::surveyor.components.apartemen-kantor')
@elseif($analisaType == 'alat-berat')
@include('lpj::surveyor.components.alat-berat')
@elseif($analisaType == 'mesin')
@include('lpj::surveyor.components.mesin')
@elseif($analisaType == 'kapal')
@include('lpj::surveyor.components.kapal')
@elseif($analisaType == 'kendaraan')
@include('lpj::surveyor.components.kendaraan')
@elseif($analisaType == 'pesawat')
@include('lpj::surveyor.components.pesawat')
@endif
@if ($analisaType == 'tanah_bangunan')
@include('lpj::surveyor.components.bangunan')
@endif
@if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat')
@include('lpj::surveyor.components.lingkungan')
@endif
@include('lpj::surveyor.components.fakta')
@foreach ($permohonan->debiture->documents as $dokumen)
@if ($dokumen->jenisJaminan)
@php
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
@endphp
<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
@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()">
<span id="saveButtonText">Save</span>
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;" id="saveButtonSpinner">
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;"
id="saveButtonSpinner">
<span class="visually-hidden">Loading...</span>
</div>
</button>
</button>
</div>
</form>
{{-- </div>
</div> --}}
</div>
@endsection
@push('scripts')
<script>
@@ -269,50 +121,50 @@
}
function submitData() {
const formElement = $('#formInspeksi')[0];
const formData = new FormData(formElement);
const formElement = $('#formInspeksi')[0];
const formData = new FormData(formElement);
// Disable the button and show the spinner
$('#saveButton').prop('disabled', true);
$('#saveButtonText').hide();
$('#saveButtonSpinner').show();
// Disable the button and show the spinner
$('#saveButton').prop('disabled', true);
$('#saveButtonText').hide();
$('#saveButtonSpinner').show();
$.ajax({
url: '{{ route('surveyor.store') }}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
success: function(response) {
if (response.success) {
window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=inspeksi';
$.ajax({
url: '{{ route('surveyor.store') }}',
type: 'POST',
data: formData,
processData: false,
contentType: false,
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
success: function(response) {
if (response.success) {
window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=inspeksi';
}
console.log(response);
},
error: function(xhr, status, error) {
let errors = xhr.responseJSON?.errors;
$('.alert').text('');
if (errors) {
$.each(errors, function(key, value) {
$(`#error-${key}`).text(value[0]);
});
}
console.error('Terjadi error:', error); // Menampilkan pesan error di konsol
console.log('Status:', status);
console.log('Response:', xhr.responseText);
console.log(errors);
},
complete: function() {
// Re-enable the button and hide the spinner
$('#saveButton').prop('disabled', false);
$('#saveButtonText').show();
$('#saveButtonSpinner').hide();
}
console.log(response);
},
error: function(xhr, status, error) {
let errors = xhr.responseJSON?.errors;
$('.alert').text('');
if (errors) {
$.each(errors, function(key, value) {
$(`#error-${key}`).text(value[0]);
});
}
console.error('Terjadi error:', error); // Menampilkan pesan error di konsol
console.log('Status:', status);
console.log('Response:', xhr.responseText);
console.log(errors);
},
complete: function() {
// Re-enable the button and hide the spinner
$('#saveButton').prop('disabled', false);
$('#saveButtonText').show();
$('#saveButtonSpinner').hide();
}
});
}
});
}
</script>
@endpush

View File

@@ -48,7 +48,9 @@
@if (isset($perkerasanJalan))
@foreach ($perkerasanJalan as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="perkerasan_jalan" type="checkbox" value="{{ $item->name }}" />
<input class="checkbox" name="perkerasan_jalan[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, isset($forminspeksi['perkerasan_jalan']) ? $forminspeksi['perkerasan_jalan'] : []) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -68,7 +70,9 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="lalu_lintas[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, explode(',', old('lalu_lintas', $forminspeksi['lalu_lintas'] ?? ''))) ? 'checked' : '' }} />
{{ isset($forminspeksi['lalu_lintas']) && in_array($item->name, explode(',', is_array(old('lalu_lintas', $forminspeksi['lalu_lintas'] ?? '')) ? implode(',', old('lalu_lintas', $forminspeksi['lalu_lintas'] ?? '')) : old('lalu_lintas', $forminspeksi['lalu_lintas'] ?? ''))) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -87,7 +91,8 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="gol_mas_sekitar[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, explode(',', old('gol_mas_sekitar', $forminspeksi['gol_mas_sekitar'] ?? ''))) ? 'checked' : '' }} />
{{ isset($forminspeksi['gol_mas_sekitar']) && in_array($item->name, explode(',', is_array(old('gol_mas_sekitar', $forminspeksi['gol_mas_sekitar'] ?? '')) ? implode(',', old('gol_mas_sekitar', $forminspeksi['gol_mas_sekitar'] ?? '')) : old('gol_mas_sekitar', $forminspeksi['gol_mas_sekitar'] ?? ''))) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -107,7 +112,8 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="tingkat_keramaian[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, explode(',', old('tingkat_keramaian', $forminspeksi['tingkat_keramaian'] ?? ''))) ? 'checked' : '' }} />
{{ isset($forminspeksi['tingkat_keramaian']) && in_array($item->name, explode(',', is_array(old('tingkat_keramaian', $forminspeksi['tingkat_keramaian'] ?? '')) ? implode(',', old('tingkat_keramaian', $forminspeksi['tingkat_keramaian'] ?? '')) : old('tingkat_keramaian', $forminspeksi['tingkat_keramaian'] ?? ''))) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -127,7 +133,8 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="terletak_diarea[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, explode(',', old('terletak_diarea', $forminspeksi['terletak_diarea'] ?? ''))) ? 'checked' : '' }} />
{{ isset($forminspeksi['terletak_diarea']) && in_array($item->name, explode(',', is_array(old('terletak_diarea', $forminspeksi['terletak_diarea'] ?? '')) ? implode(',', old('terletak_diarea', $forminspeksi['terletak_diarea'] ?? '')) : old('terletak_diarea', $forminspeksi['terletak_diarea'] ?? ''))) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -220,7 +227,7 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="merupakan_daerah[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, explode(',', old('merupakan_daerah', $forminspeksi['merupakan_daerah'] ?? []))) ? 'checked' : '' }} />
{{ in_array($item->name, isset($forminspeksi['merupakan_daerah']) ? $forminspeksi['merupakan_daerah'] : []) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach
@@ -255,7 +262,15 @@
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="fasilitas_dekat_object[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, $selectedFasilitas) ? 'checked' : '' }} />
{{ in_array(
$item->name,
is_array(old('fasilitas_dekat_object', $forminspeksi['fasilitas_dekat_object'] ?? ''))
? old('fasilitas_dekat_object', $forminspeksi['fasilitas_dekat_object'] ?? [])
: explode(',', old('fasilitas_dekat_object', $forminspeksi['fasilitas_dekat_object'] ?? '')),
)
? 'checked'
: '' }} />
{{ $item->name }}
</label>
@endforeach

View File

@@ -134,8 +134,8 @@
@foreach ($konturTanah as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="kontur_tanah[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, old('kontur_tanah', $forminspeksi['kontur_tanah'] ?? [])) ? 'checked' : '' }} />
value="{{ $item->name }}"
{{ in_array($item->name, old('kontur_tanah', isset($forminspeksi['kontur_tanah']) ? $forminspeksi['kontur_tanah'] : [])) ? 'checked' : '' }} />
{{ $item->name }}
</label>
@endforeach

View File

@@ -83,7 +83,7 @@
<div class="card-body">
@if (request()->has('form') && request('form') == 'denah')
@include('lpj::surveyor.components.card-tambah')
{{-- @elseif(request()->has('form') && request('form') == 'data-pembanding')
{{-- @elseif(request()->has('form') && request('form') == 'data-pembanding')
@include('lpj::surveyor.components.data-pembanding') --}}
@elseif(request()->has('form') && request('form') == 'foto')
@include('lpj::surveyor.components.card-tambah')
@@ -92,23 +92,75 @@
@endIf
</div>
@if (request()->has('form') && request('form') !== 'data-pembanding')
<div class="card-footer">
<form action="{{ route('surveyor.submitSurveyor', $surveyor ) }}" method="POST">
@csrf
@method('PUT')
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
<div class="card-footer ">
<div class="flex gap-5">
<button type="button" id="btnProses" class="btn btn-success">
Proses
</button>
<button type="button" id="btnSubmit" class="btn btn-primary">
Submit
</button>
</form>
</div>
@endif
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function() {
checkButtonStatus();
document.getElementById('btnProses').addEventListener('click', onProses);
document.getElementById('btnSubmit').addEventListener('click', onSubmit);
});
function checkButtonStatus() {
$.ajax({
url: "{{ route('surveyor.checkButtonStatus', ['id' => $surveyor]) }}",
type: "GET",
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
success: function(response) {
if (response.buttonDisable) {
$('#btnProses, #btnSubmit').prop('disabled', true);
} else {
$('#btnProses, #btnSubmit').prop('disabled', false);
}
},
error: function(xhr, status, error) {
console.log('Error checking button status:', error, status, xhr);
}
});
}
function onProses() {
return alert('Are you sure you want to submit?');
}
function onSubmit() {
$.ajax({
url: "{{ route('surveyor.submitSurveyor', ['id' => $surveyor]) }}",
type: "GET",
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
success: function(response) {
if (response.success) {
window.location.href = "{{ route('surveyor.index') }}";
}
},
error: function(xhr, status, error) {
console.log('Error checking button status:', error, status, xhr);
}
});
}
$('.card-title a').on('click', function(e) {
e.preventDefault();
var url = $(this).attr('href');

View File

@@ -4,22 +4,21 @@
{{ Breadcrumbs::render('surveyor') }}
@endsection
@section('content')
@push('styles')
<style>
.modal {
@push('styles')
<style>
.modal {
width: 50%;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
@endpush
width: 50%;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
@endpush
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
@@ -113,152 +112,159 @@
</div>
</div>
<div class="modal fade" data-modal="true" id="modal_revisi" data-backdrop="static" data-keyboard="false">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Kunjungan</h3>
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
<i class="ki-outline ki-cross"></i>
</button>
</div>
<div class="modal-body">
<form
action=""
method="POST" enctype="multipart/form-data" id="revisiForm">
@csrf
@method('PUT')
<input type="hidden" name="action" value="revisi">
{{-- <input type="hidden" name="nomor_registrasi"
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}"> --}}
<div class="pl-1 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tanggal Kunjungan</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
type="datetime-local" name="tanggal_kunjungan"
value="">
@error('tanggal_kunjungan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Catatan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea id="keterangan" class="textarea @error('keterangan') border-danger bg-danger-light @enderror"
rows="3" name="keterangan"></textarea>
@error('keterangan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class="modal-footer justify-end mt-2">
<div class="flex gap-4">
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="module">
const element = document.querySelector('#permohonan-table');
const searchInput = document.getElementById('search');
const statusFilter = document.getElementById('status-filter'); // Dropdown filter element
<script>
function jadwal(id){
document.getElementById('ids').value = id ;
}
</script>
<script type="module">
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
order: [{
column: 'nomor_registrasi',
dir: 'asc'
} // Default order by 'nomor_registrasi' ascending
],
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
tanggal_permohonan: {
title: 'Tanggal Assigned',
// render: (item, data) => {
// const createdAt = convertDate(data.penilaian.created_at);
// return createdAt;
// },
const element = document.querySelector('#permohonan-table');
const searchInput = document.getElementById('search');
const statusFilter = document.getElementById('status-filter');
const apiUrl = element.getAttribute('data-api-url');
const dataTableOptions = {
apiEndpoint: apiUrl,
pageSize: 5,
order: [{
column: 'nomor_registrasi',
dir: 'asc'
}], // Default order by 'nomor_registrasi' ascending
columns: {
select: {
render: (item, data, context) => {
const checkbox = document.createElement('input');
checkbox.className = 'checkbox checkbox-sm';
checkbox.type = 'checkbox';
checkbox.value = data.id.toString();
checkbox.setAttribute('data-datatable-row-check', 'true');
return checkbox.outerHTML.trim();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
tanggal_permohonan: {
title: 'Tanggal Assigned',
},
user_id: {
title: 'User Pemohon',
render: (item, data) => `${data.user.name}`,
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => `${data.branch.name}`,
},
debitur_id: {
title: 'Debitur',
render: (item, data) => `${data.debiture.name}`,
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => `${data.tujuan_penilaian.name}`,
},
jenis_fasilitas_kredit_id: {
title: 'Fasilitas Kredit',
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
},
actions: {
title: 'Action',
render: (item, data) => {
let actionHtml = '';
user_id: {
title: 'User Pemohon',
render: (item, data) => `${data.user.name}`,
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => `${data.branch.name}`,
},
debitur_id: {
title: 'Debitur',
render: (item, data) => `${data.debiture.name}`,
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => `${data.tujuan_penilaian.name}`,
},
jenis_fasilitas_kredit_id: {
title: 'Fasilitas Kredit',
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
},
actions: {
title: 'Action',
render: (item, data) => `
<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
if (data.penilaian.waktu_penilaian == null && data.penilaian.authorized_status == null) {
actionHtml += `
<a class="btn btn-sm btn-icon btn-clear btn-primary" data-modal-toggle="#modal_jadwal" onclick="jadwal(${data.penilaian.id})">
<i class="ki-filled ki-calendar-edit"></i>
</a>
`;
} else {
actionHtml += `
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
<i class="ki-outline ki-eye"></i>
</a>
</div>`,
`;
}
return actionHtml;
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
// statusFilter.addEventListener('change', function() {
// const selectedStatus = this.value;
// dataTable.search(selectedStatus);
// });
function convertDate(date) {
const createdAt = new Date(date);
const day = String(createdAt.getDate()).padStart(2, '0');
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
const year = createdAt.getFullYear();
return `${day}-${month}-${year}`;
}
}
</script>
};
let dataTable = new KTDataTable(element, dataTableOptions);
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
// statusFilter.addEventListener('change', function() {
// const selectedStatus = this.value;
// dataTable.search(selectedStatus);
// });
function convertDate(date) {
const createdAt = new Date(date);
const day = String(createdAt.getDate()).padStart(2, '0');
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
const year = createdAt.getFullYear();
return `${day}-${month}-${year}`;
}
</script>
@endpush
<div class="modal fade" data-modal="true" id="modal_jadwal" data-backdrop="static" data-keyboard="false">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Kunjungan</h3>
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
<i class="ki-outline ki-cross"></i>
</button>
</div>
<div class="modal-body">
<form action="{{ route('surveyor.storeJadwal')}}" method="POST" enctype="multipart/form-data" id="revisiForm">
@method('put')
@csrf
<input id="ids" type="text" name="id">
<div class="pl-1 grid gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tanggal Kunjungan</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('waktu_penilaian') border-danger bg-danger-light @enderror"
type="datetime-local" name="waktu_penilaian" value="">
@error('waktu_penilaian')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Catatan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea id="deskripsi_penilaian" class="textarea @error('deskripsi_penilaian') border-danger bg-danger-light @enderror"
rows="3" name="deskripsi_penilaian"></textarea>
@error('deskripsi_penilaian')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class="modal-footer justify-end mt-2">
<div class="flex gap-4">
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>

View File

@@ -460,14 +460,18 @@ Route::middleware(['auth'])->group(function () {
Route::get('/', [SurveyorController::class, 'index'])->name('index');
Route::get('{id}/show', [SurveyorController::class, 'show'])->name('show');
Route::post('store', [SurveyorController::class, 'store'])->name('store');
Route::post('storeDenah', [SurveyorController::class, 'storeDenah'])->name('storeDenah');
Route::post('storeDenah/{id}', [SurveyorController::class, 'storeDenah'])->name('storeDenah');
Route::put('storeJadwal', [SurveyorController::class, 'storeJadwal'])->name('storeJadwal');
Route::get('storeAproved/{id}', [SurveyorController::class, 'storeAproved'])->name('storeAproved');
Route::post('storeFoto', [SurveyorController::class, 'storeFoto'])->name('storeFoto');
Route::get('checkButtonStatus/{id}', [SurveyorController::class, 'checkButtonStatus'])->name('checkButtonStatus');
Route::get('datatables', [SurveyorController::class, 'dataForDatatables'])->name('datatables');
Route::get('inspeksi/{id}/{jaminanId}', [SurveyorController::class, 'formInspeksi'])->name('inspeksi');
Route::get('denah/{id}/{jaminanId}', [SurveyorController::class, 'denah'])->name('denah');
Route::get('foto/{id}/{jaminanId}', [SurveyorController::class, 'foto'])->name('foto');
Route::get('data-pembanding/{id}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding');
Route::put('submitSurveyor/{id}', [SurveyorController::class, 'submitSurveyor'])->name('submitSurveyor');
Route::get('submitSurveyor/{id}', [SurveyorController::class, 'submitSurveyor'])->name('submitSurveyor');
});
Route::name('penilai.')->prefix('penilai')->group(function () {