diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 5a400ee..537b3fb 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -123,6 +123,8 @@ class SurveyorController extends Controller ->where('permohonan_id', $id) ->get(); + $inpeksi = Inspeksi::where('permohonan_id', $id)->get(); + $forminspeksi = json_decode($inpeksi[0]->data_form, true); return view('lpj::surveyor.detail', compact( @@ -158,7 +160,9 @@ class SurveyorController extends Controller if ($data) { try { - $formatTanahJson =[ + + + $formatTanahJson = [ 'debitur_perwakilan' => $data['debitur_perwakilan'] ?? [], 'jenis_asset' => $data['jenis_asset'] ?? null, 'jenis_asset_tidak_sesuai' => $data['jenis_asset_tidak_sesuai'] ?? null, @@ -189,7 +193,7 @@ class SurveyorController extends Controller ]; - $formatBangunanJson =[ + $formatBangunanJson = [ 'luas_tanah_bangunan' => $data['luas_tanah_bangunan'] ?? null, 'jenis_bangunan' => $data['jenis_bangunan'] ?? null, 'kondisi_bangunan' => $data['kondisi_bangunan'] ?? null, @@ -202,7 +206,7 @@ class SurveyorController extends Controller ]; - $formatLingkunganJson =[ + $formatLingkunganJson = [ 'jarak_jalan_utama' => $data['jarak_jalan_utama'] ?? null, 'jalan_linkungan' => $data['jalan_linkungan'] ?? null, 'jarak_cbd_point' => $data['jarak_cbd_point'] ?? null, @@ -222,13 +226,13 @@ class SurveyorController extends Controller 'dekat_tps' => $data['dekat_tps'] ?? null, 'jarak_tps' => $data['jarak_tps'] ?? null, 'nama_tps' => $data['nama_tps'] ?? null, - 'merupkan_daerah' => $data['merupkan_daerah'] ?? null, + 'merupakan_daerah' => $data['merupakan_daerah'] ?? null, 'fasilitas_dekat_object' => $data['fasilitas_dekat_object'] ?? null, ]; - $formatFaktaJson =[ + $formatFaktaJson = [ 'fakta_positif' => $data['fakta_positif'] ?? null, 'fakta_negatif' => $data['fakta_negatif'] ?? null, 'rute_menuju' => $data['rute_menuju'] ?? null, @@ -247,7 +251,10 @@ class SurveyorController extends Controller 'nama_petugas' => $data['nama_petugas'] ?? null, 'lat' => $data['lat'] ?? null, 'lng' => $data['lng'] ?? null, - 'foto_tempat' => $data['foto_tempat'] ?? null, + 'foto_gistaru' => $data['foto_gistaru'] = $this->uploadFile($request->file('foto_gistaru'), $request->type) ?? null, + 'foto_bhumi' => $data['foto_bhumi'] = $this->uploadFile($request->file('foto_bhumi'), $request->type) ?? null, + 'foto_argis_region' => $data['foto_argis_region'] = $this->uploadFile($request->file('foto_argis_region'), $request->type) ?? null, + 'foto_tempat' => $data['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), $request->type) ?? null, 'keterangan' => $data['keterangan'] ?? null, ]; @@ -257,15 +264,13 @@ class SurveyorController extends Controller 'permohonan_id' => $request->permohonan_id, 'data_form' => json_encode($mergeData), 'name' => $request->type, - + ]); - - - return response()->json(['message' => 'Data berhasil disimpan', + return response()->json(['success' => true, 'message' => 'Data berhasil disimpan', 'data' => $mergeData], 200); } catch (Exception $e) { - return response()->json(['message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); + return response()->json(['success' => false, 'message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); } } } @@ -357,29 +362,58 @@ class SurveyorController extends Controller 'foto_lantai_unit.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); - DB::beginTransaction(); + // DB::beginTransaction(); try { - $pendampingPath = $this->uploadFile($request->file('pendamping'), 'pendamping'); - $fotojaminan = FotoJaminan::create([ - 'pendamping' => $pendampingPath, - 'permohonan_id' => $validatedData['permohonan_id'], - 'jenis_jaminan_id' => $validatedData['jenis_jaminan_id'], - ]); + $rute_menuju_lokasi = []; + $object_jaminan = []; + $lingkungan = []; - $this->processObjekUploads($request, $fotojaminan); - $this->processLantaiUnitUploads($request, $fotojaminan); - $this->processUploads('rute', $request, $fotojaminan); - $this->processUploads('lingkungan', $request, $fotojaminan); - DB::commit(); - return redirect()->route('surveyor.show', [ - 'id' => $validatedData['permohonan_id'], - 'form' => 'foto' - ])->with('success', 'Data foto berhasil disimpan'); + foreach ($request->file('foto_rute', []) as $key => $value) { + $fotoRutePath = $this->uploadFile($request->file('foto_rute.' . $key), 'foto_rute.' . $key); + + $rute_menuju_lokasi[] = [ + 'name_rute' => $request->input('name_rute.' . $key), + 'foto_rute' => $fotoRutePath, + ]; + } + + foreach ($request->file('foto_objek', []) as $key => $value) { + $fotoObjekPath = $this->uploadFile($request->file('foto_objek.' . $key), 'foto_objek.' . $key); + $object_jaminan[] = [ + 'nama_objek' => $request->input('name_objek.' . $key), + 'foto_object' => $fotoObjekPath, + 'deskripsi_objek' => $request->input('deskripsi_objek.' . $key), + ]; + } + + foreach ($request->file('foto_lingkungan', []) as $key => $value) { + $fotoLingkunganPath = $this->uploadFile($request->file('foto_lingkungan.' . $key), 'foto_lingkungan.' . $key); + $lingkungan[] = [ + 'name_lingkungan' => $request->input('name_lingkungan.' . $key), + 'foto_lingkungan' => $fotoLingkunganPath, + + ]; + } + + + + $formatFotojson = [ + 'rute_menuju_lokasi' => $rute_menuju_lokasi, + 'object_jaminan' => $object_jaminan, + 'lingkungan' => $lingkungan + ]; + + + + + // DB::commit(); + + return response()->json(['success' => true, 'message' => 'Data berhasil disimpan', 'data' => $formatFotojson], 200); } catch (Exception $e) { - DB::rollBack(); + return response()->json(['success' => false, 'message' => 'Failed to upload: ' . $e->getMessage()], 500); } } @@ -691,6 +725,11 @@ class SurveyorController extends Controller ->where('jenis_jaminan_id', $jaminanId) ->first(); + + $inpeksi = Inspeksi::where('permohonan_id', $id)->get(); + $forminspeksi = json_decode($inpeksi[0]->data_form, true); + + return view('lpj::surveyor.components.inspeksi', compact( 'analisa', 'permohonan', @@ -715,7 +754,8 @@ class SurveyorController extends Controller 'tingkatKeramaian', 'laluLintasLokasi', 'perkerasanJalan', - 'link_url_region' + 'link_url_region', + 'forminspeksi' )); } @@ -743,7 +783,10 @@ class SurveyorController extends Controller $branches = Branch::all(); $provinces = Province::all(); - $fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first(); + // $fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first(); + + $fotoJaminan = null; + return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan')); } @@ -829,11 +872,9 @@ class SurveyorController extends Controller ->with('success', 'created successfully'); } catch (Exeception $e) { - - return response()->json(array('error' => $e->getMessage()), 400); - // return redirect() - // ->route('basicdata.' . $type .'.index') - // ->with('error', $th->getMessage()); + return redirect() + ->route('basicdata.' . $type .'.index') + ->with('error', $th->getMessage()); } } } @@ -868,7 +909,7 @@ class SurveyorController extends Controller $header = $dataMap[$type] ?? ''; $model = $modelClass::findOrFail($id); - $spekKategoriBagunan= null; + $spekKategoriBagunan = null; if ($type == 'spek-bangunan') { $spekKategoriBagunan = SpekKategoritBangunan::all(); diff --git a/app/Http/Requests/FormSurveyorRequest.php b/app/Http/Requests/FormSurveyorRequest.php index 0a0e032..e003a36 100644 --- a/app/Http/Requests/FormSurveyorRequest.php +++ b/app/Http/Requests/FormSurveyorRequest.php @@ -38,7 +38,7 @@ class FormSurveyorRequest extends FormRequest 'batas_batas' => 'nullable|array', 'kondisi_linkungan' => 'nullable|array', 'kondisi_lain_bangunan' => 'nullable|array', - 'informasi_dokument' => 'nullable|array', + 'informasi_dokument' => 'nullable', 'peruntukan' => 'nullable', 'kdb' => 'nullable', 'kdh' => 'nullable', @@ -48,8 +48,11 @@ class FormSurveyorRequest extends FormRequest 'gss' => 'nullable', 'pelebaran_jalan' => 'nullable', 'nama_petugas' => 'nullable', - 'lat' => 'required|numeric', - 'lng' => 'required|numeric', + 'lat' => 'nullable|numeric', + 'lng' => 'nullable|numeric', + 'foto_gistaru' => 'nullable', + 'foto_bhumi' => 'nullable', + 'foto_argis_region' => 'nullable', 'foto_tempat' => 'nullable', 'keterangan' => 'nullable', ]; @@ -76,7 +79,8 @@ class FormSurveyorRequest extends FormRequest case 'bangunan': return $this->getTanahBangunanRules(); case 'tanah_bangunan': - return $this->getTanahRules(); + return array_merge($this->getAssetDescriptionRules(),$this->getTanahRules(), $this->getBangunanRules(), $this->getLinkunganRules(), $this->getCommonRules()); + case 'alat-berat': return $this->getUnitRules(); default: @@ -90,10 +94,7 @@ class FormSurveyorRequest extends FormRequest public function getTanahRules(): array { - - $assetDescriptionRules = $this->getAssetDescriptionRules(); - return array_merge($assetDescriptionRules, [ - + return [ 'luas_tanah' => 'required', 'luas_tanah_tidak_sesuai' => 'nullable', 'hadap_mata_angin' => 'required', @@ -108,7 +109,7 @@ class FormSurveyorRequest extends FormRequest 'tusuk_sate' => 'required', 'lockland' => 'required', 'kondisi_fisik_tanah' => 'required|array', - ]); + ]; } /** @@ -117,7 +118,7 @@ class FormSurveyorRequest extends FormRequest private function getBangunanRules(): array { - return [ + return [ 'action' => 'required', 'luas_tanah_bagunan' => 'required', 'jenis_bangunan' => 'required', @@ -137,7 +138,7 @@ class FormSurveyorRequest extends FormRequest */ private function getUnitRules(): array { - return array_merge($this->getAssetDescriptionRules(), [ + return [ 'action' => 'required', 'luas_unit' => 'required', 'luas_unit_tidak_sesuai' => 'nullable', @@ -147,14 +148,14 @@ class FormSurveyorRequest extends FormRequest 'lantai' => 'required|array', 'view' => 'required|array', 'bentuk_unit' => 'required|array', - ]); + ]; } /** * Get rules specific to Linkungan action. */ - public function getLinkunganRules(): array + private function getLinkunganRules(): array { return [ 'action' => 'required', @@ -242,8 +243,4 @@ class FormSurveyorRequest extends FormRequest } - - - - } diff --git a/resources/views/surveyor/components/bangunan.blade.php b/resources/views/surveyor/components/bangunan.blade.php index cbdf41e..d82bee0 100644 --- a/resources/views/surveyor/components/bangunan.blade.php +++ b/resources/views/surveyor/components/bangunan.blade.php @@ -1,8 +1,6 @@ -{{-- @if ($analisaType == 'tanah_bangunan') --}} +
- -

Analisa Bangunan

@@ -13,19 +11,16 @@
- - @error('luas_tanah_bagunan') - - @enderror +
@@ -39,7 +34,10 @@ @foreach ($jenisBangunan as $item) @if (strcasecmp($item->name, 'lainnya') == 0) @@ -56,9 +54,9 @@ @endforeach @endif - @error('jenis_bangunan') - - @enderror + + + @@ -66,31 +64,30 @@
-
@if (isset($kondisiBangunan)) @foreach ($kondisiBangunan as $item) @if (strcasecmp($item->name, 'lainnya') == 0) -
- - -
+
+ + +
@endif @endforeach @endif -
- +
@@ -98,29 +95,29 @@
- -
@if (isset($sifatBangunan)) @foreach ($sifatBangunan as $item) -
-
- - +
- + + +
@@ -169,37 +166,29 @@ -
- -
@if (isset($saranaPelengkap)) @foreach ($saranaPelengkap as $item) -
-
- - - - +
-
-
-
-{{-- @endif --}} + @push('scripts') diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 82d7355..1f502c4 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -19,211 +19,356 @@
- @php - $jenisJaminanData = null; - @endphp -
- @foreach ($permohonan->debiture->documents as $dokumen) - @php - $jenisJaminanData = $dokumen->jenisJaminan->name ?? ''; - @endphp -
- - +
+
+ +
+ @if (isset($permohonan->debiture)) +

{{ $permohonan->debiture->name }}

+ @endif
- @endforeach +
+
+ +
+ @foreach ($permohonan->debiture->documents as $dokumen) + + {{ $dokumen->pemilik->address ?? '' }}, + {{ $dokumen->pemilik->village->name ?? '' }}, + {{ $dokumen->pemilik->district->name ?? '' }}, + {{ $dokumen->pemilik->city->name ?? '' }}, + {{ $dokumen->pemilik->province->name ?? '' }} - + {{ $dokumen->pemilik->village->postal_code ?? '' }} + + @endforeach +
+
+
+ +
+

{{ $permohonan->nomor_registrasi }}

+
+
+ + + +
+ +
+ @if (isset($permohonan->branch)) +

{{ $permohonan->branch->name }}

+ @endif +
+
+ +
+ +
+

{{ $permohonan->nomor_registrasi }}

+
+
+
+ +
+ @if (isset($permohonan->user)) +

{{ $permohonan->user->name }}

+ @endif +
+
-
-
-
- @if (isset($fotoJaminan->id)) - - @method('PUT') - @endif - @csrf + {{--
+
--}} + + @if (isset($fotoJaminan->id)) + + @method('PUT') + @endif + @csrf - - + + - @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', - ]; + @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 = 'unknown'; - 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'; + $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 - + if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') { + $analisaType = 'unit'; + } + @endphp + -
-
-

Rute Menuju Lokasi

- -
+
+
+
+

Rute Menuju Lokasi

+ +
- @if (isset($fotoJaminan)) - @foreach ($fotoJaminan->ruteJaminan as $item) - @if (isset($item->foto_rute)) - Gambar Pendamping - @endif -
-
- -
- -
- - - -
- - -
-
- @error('foto_rute.*') - {{ $message }} - @enderror - @error('name_rute.*') - {{ $message }} - @enderror -
- @endforeach - @else + @if (isset($fotoJaminan)) + @foreach ($fotoJaminan->ruteJaminan as $item) + @if (isset($item->foto_rute)) + Gambar Pendamping + @endif
+
+
+ + + +
+ + +
+
+ @error('foto_rute.*') + {{ $message }} + @enderror + @error('name_rute.*') + {{ $message }} + @enderror +
+ @endforeach + @else + {{-- Foto Argis Region --}} + +
+
+ + +
+ + + + +
+ +
+ @error('foto_rute.*') + {{ $message }} + @enderror + @error('name_rute.*') + {{ $message }} + @enderror +
+ @endif + + +
+
+ + +
+ + + + +
+
+ +
+ +
+ +
+ + +
+
+ +
+
+
+

Objek Jaminan

+
+ @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) +
+
+ + +
+ @if (isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']])) + {{ $view['label'] }} + @endif +
+ + +
+ + +
+
+ @error('foto_objek.' . $view['index']) + {{ $message }} + @enderror + @error('name_objek.' . $view['index']) + {{ $message }} + @enderror +
+ @endforeach + @else +
+

Tipe analisa tidak valid atau belum dipilih.

+
+ @endif + + +
+
+
+ + +
+ + @if (isset($fotoJaminan)) + @foreach ($fotoJaminan->lantaiUnit as $item) +
+ +
+ +
+ @if (isset($fotoJaminan)) + Gambar Pendamping + @endif + + + + + +
+ +
+ + @error('foto_lantai_unit.*') + {{ $message }} + @enderror +
+ @endforeach + @else +
+ + +
+ +
- - +
- @error('foto_rute.*') - {{ $message }} - @enderror - @error('name_rute.*') + @error('foto_lantai_unit.*') {{ $message }} @enderror
@endif -
+
+
-
-
-

Objek Jaminan

-
- @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) -
-
- -
- @if (isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']])) - {{ $view['label'] }} - @endif -
- - -
- - -
-
- @error('foto_objek.' . $view['index']) - {{ $message }} - @enderror - @error('name_objek.' . $view['index']) - {{ $message }} - @enderror -
- @endforeach - @else -
-

Tipe analisa tidak valid atau belum dipilih.

-
- @endif - - -
-
-
+
- - @if (isset($fotoJaminan)) - @foreach ($fotoJaminan->lantaiUnit as $item) -
- -
- -
- @if (isset($fotoJaminan)) - Gambar Pendamping - @endif + @error('foto_lantai_unit.*') + {{ $message }} + @enderror +
- - - -
+
-
+
- @error('foto_lantai_unit.*') - {{ $message }} - @enderror -
- @endforeach - @else -
-
- + +
+
+
+
+ + + +
+
+ + +
+

Lingkungan

+ +
+ + @if (isset($fotoJaminan)) + @foreach ($fotoJaminan->lingkungan as $item) +
+
+ +
+ @if (isset($fotoJaminan)) + Gambar Pendamping + @endif
- - +
- @error('foto_lantai_unit.*') - {{ $message }} - @enderror -
- @endif - - -
-
- - - -
-
-

Lingkungan

- -
- - @if (isset($fotoJaminan)) - @foreach ($fotoJaminan->lingkungan as $item) -
-
- -
- @if (isset($fotoJaminan)) - Gambar Pendamping - @endif -
- - - -
- -
-
- @error('foto_lingkungan.*') - {{ $message }} - @enderror - @error('name_lingkungan.*') - {{ $message }} - @enderror -
- @endforeach - @else -
-
- -
- - - - -
- -
@error('foto_lingkungan.*') {{ $message }} @@ -461,56 +475,95 @@ {{ $message }} @enderror
- @endif -
- -
- - -
-

Pendamping

-
-
+ @endforeach + @else +
- -
- @if (isset($fotoJaminan)) - Gambar Pendamping - @endif -
- - -
+
+ + -
+ +
- @error('pendamping') + @error('foto_lingkungan.*') + {{ $message }} + @enderror + @error('name_lingkungan.*') {{ $message }} @enderror
-
-
- -
- - + @endif +
-
+ +
+
+ + +
+

Pendamping

+
+
+
+ + +
+ @if (isset($fotoJaminan)) + Gambar Pendamping + @endif +
+ + +
+ + +
+
+ @error('pendamping') + {{ $message }} + @enderror +
+
+
+ + +
+ +
+ + + {{-- +
+
--}}
@@ -607,9 +660,138 @@ @endsection + @push('scripts') - @include('lpj::surveyor.js.camera-editor') + @include('lpj::surveyor.js.camera-editor') + + + - - @endpush diff --git a/resources/views/surveyor/components/lingkungan.blade.php b/resources/views/surveyor/components/lingkungan.blade.php index da52a44..c66fcf3 100644 --- a/resources/views/surveyor/components/lingkungan.blade.php +++ b/resources/views/surveyor/components/lingkungan.blade.php @@ -14,29 +14,30 @@ + value="{{ old('jarak_jalan_utama', isset($forminspeksi['jarak_jalan_utama']) ? $forminspeksi['jarak_jalan_utama'] : '') }}">
- +
+ value="{{ old('jarak_cbd_point', isset($forminspeksi['jarak_cbd_point']) ? $forminspeksi['jarak_cbd_point'] : '') }}">
+ value="{{ old('nama_cbd_point', isset($forminspeksi['nama_cbd_point']) ? $forminspeksi['nama_cbd_point'] : '') }}">
+ value="{{ old('lebar_perkerasan_jalan', isset($forminspeksi['lebar_perkerasan_jalan']) ? $forminspeksi['lebar_perkerasan_jalan'] : '') }}">
@@ -47,56 +48,52 @@ @if (isset($perkerasanJalan)) @foreach ($perkerasanJalan as $item) @endforeach @endif
- +
- +
-
@if (isset($laluLintasLokasi)) @foreach ($laluLintasLokasi as $item) @endforeach @endif
- - +
-
-
@if (isset($golMasySekitar)) @foreach ($golMasySekitar as $item) @endforeach @endif
- - - +
@@ -104,20 +101,19 @@
-
@if (isset($tingkatKeramaian)) @foreach ($tingkatKeramaian as $item) @endforeach @endif
- - +
@@ -129,111 +125,55 @@ @if (isset($konturTanah)) @foreach ($konturTanah as $item) @endforeach @endif
- - + - - -
- -
-
-
- - - -
- -
- - ) - - -
-
-
- +
- - @error('dekatMakam') - - @enderror +
- +
@@ -242,31 +182,35 @@
- + - +
@@ -274,37 +218,53 @@ @if (isset($konturTanah)) @foreach ($konturTanah as $item) @endforeach @endif
- +
- +
-
@if (isset($konturTanah)) @foreach ($konturTanah as $item) + @php + + $selectedFasilitas = 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'] ?? '', + ), + ); + @endphp @endforeach @endif -
- +
+
+ diff --git a/resources/views/surveyor/components/tanah.blade.php b/resources/views/surveyor/components/tanah.blade.php index 12d759d..c47792e 100644 --- a/resources/views/surveyor/components/tanah.blade.php +++ b/resources/views/surveyor/components/tanah.blade.php @@ -1,4 +1,3 @@ - @include('lpj::surveyor.components.header')
@@ -27,17 +26,20 @@
+ value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['luas_tanah_tidak_sesuai'] ?? '') }}" + style="{{ old('luas_tanah', $forminspeksi['luas_tanah'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
@@ -52,25 +54,28 @@
name, old('bentuk_tanah', [])) ? 'checked' : '' }} - onClick="toggleTidakSesuai('bentuk_tanah', 'bentuk_tanah_lainnya')" /> - {{ $item->name }} - @if (strcasecmp($item->name, 'lainnya') == 0)
+ @else + @endif @endforeach @endif @@ -117,6 +124,7 @@
+
@@ -126,7 +134,8 @@ @foreach ($konturTanah as $item) @endforeach @@ -137,6 +146,7 @@
+
@@ -148,7 +158,8 @@ @foreach ($ketinggianTanah as $item) @endforeach @@ -166,12 +177,12 @@
@@ -179,7 +190,6 @@
-
@@ -188,7 +198,8 @@ @foreach ($posisiKavling as $item) @if (strcasecmp($item->name, 'lainnya') == 0) @@ -217,12 +228,12 @@
@@ -232,17 +243,17 @@
- +
@@ -255,24 +266,24 @@
-
@if (isset($kondisiFisikTanah)) @foreach ($kondisiFisikTanah as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0)
- - +
@endif @endforeach diff --git a/resources/views/surveyor/detail.blade.php b/resources/views/surveyor/detail.blade.php index 684dad4..24f60b1 100644 --- a/resources/views/surveyor/detail.blade.php +++ b/resources/views/surveyor/detail.blade.php @@ -100,7 +100,6 @@ -
@endif