From df68c7012748382ade76ead174414f6b6235e32b Mon Sep 17 00:00:00 2001 From: majid Date: Fri, 8 Nov 2024 16:14:46 +0700 Subject: [PATCH 1/7] update assingment --- app/Http/Controllers/PenilaianController.php | 2 +- app/Http/Requests/PenilaianRequest.php | 1 - resources/views/penilaian/form.blade.php | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PenilaianController.php b/app/Http/Controllers/PenilaianController.php index 2b5a894..8f6ae47 100644 --- a/app/Http/Controllers/PenilaianController.php +++ b/app/Http/Controllers/PenilaianController.php @@ -215,7 +215,7 @@ class PenilaianController extends Controller $teamPenilai = $userTeam->flatMap(function ($team) { return $team->teamsUsers->filter(function ($teamUser) { return $teamUser->user->roles->contains(function ($role) { - return $role->name === 'surveyor' || $role->name === 'surveyor-penilai'; + return $role->name === 'surveyor' || $role->name === 'surveyor-penilai' || $role->name === 'administrator'; }); })->map(function ($teamUser) { return $teamUser->user; diff --git a/app/Http/Requests/PenilaianRequest.php b/app/Http/Requests/PenilaianRequest.php index a3c1db0..23b91bf 100644 --- a/app/Http/Requests/PenilaianRequest.php +++ b/app/Http/Requests/PenilaianRequest.php @@ -33,7 +33,6 @@ class PenilaianRequest extends FormRequest 'tanggal_kunjungan' => 'required|max:255', 'status' => 'required|string', 'nomor_registrasi' => 'required|string', - 'surveyor_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,penilai_id', 'penilai_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,surveyor_id', 'penilai_surveyor_id' => 'nullable', diff --git a/resources/views/penilaian/form.blade.php b/resources/views/penilaian/form.blade.php index 8c21971..0433bfc 100644 --- a/resources/views/penilaian/form.blade.php +++ b/resources/views/penilaian/form.blade.php @@ -451,6 +451,7 @@ + From edd005e132c104cef1e83daadd9326d6f52167ab Mon Sep 17 00:00:00 2001 From: majid Date: Sat, 9 Nov 2024 00:55:11 +0700 Subject: [PATCH 2/7] update form surveyor --- app/Http/Controllers/SurveyorController.php | 77 +- app/Http/Controllers/TeamsController.php | 3 + app/Http/Requests/FormSurveyorRequest.php | 50 +- app/Http/Requests/PenilaianRequest.php | 2 - app/Http/Requests/RegionRequest.php | 2 + app/Models/Regions.php | 2 +- ...58_create_analisa_tanah_bangunan_table.php | 2 +- ...10_31_032940_create_penilai_team_table.php | 2 +- ...2024_11_08_065701_update_regions_table.php | 30 + module.json | 8 + resources/views/region/create.blade.php | 24 + resources/views/region/index.blade.php | 7 + .../surveyor/components/alat-berat.blade.php | 37 +- .../surveyor/components/bangunan.blade.php | 111 +-- .../views/surveyor/components/foto.blade.php | 2 - .../surveyor/components/inspeksi.blade.php | 583 +++++-------- .../views/surveyor/components/kapal.blade.php | 44 +- .../surveyor/components/kendaraan.blade.php | 40 +- .../surveyor/components/lingkungan.blade.php | 363 ++++++++ .../components/lokasi-jaminan.blade.php | 38 + .../views/surveyor/components/mesin.blade.php | 38 +- .../surveyor/components/pesawat.blade.php | 580 +++++++++++++ .../views/surveyor/components/tanah.blade.php | 820 +++++++++++++----- routes/breadcrumbs.php | 1 + routes/web.php | 1 + 25 files changed, 1998 insertions(+), 869 deletions(-) create mode 100644 database/migrations/2024_11_08_065701_update_regions_table.php create mode 100644 resources/views/surveyor/components/lingkungan.blade.php create mode 100644 resources/views/surveyor/components/lokasi-jaminan.blade.php create mode 100644 resources/views/surveyor/components/pesawat.blade.php diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 0c936a0..48a5066 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -35,6 +35,7 @@ use Modules\Lpj\Models\FotoJaminan; use Modules\Lpj\Models\Lingkungan; use Modules\Lpj\Models\LantaiUnit; use Modules\Lpj\Models\Lantai; +use Modules\Lpj\Models\Teams; use Modules\Lpj\Models\ViewUnit; use Modules\Lpj\Models\ObjekJaminan; use Modules\Lpj\Models\RuteJaminan; @@ -149,41 +150,45 @@ class SurveyorController extends Controller /** * Store form inspeksi. */ - public function store(FormSurveyorRequest $request) + public function store(Request $request) { - $validatedData = $request->validated(); - DB::beginTransaction(); - try { - $analisa = Analisa::create($validatedData); - if ($analisa) { - $validatedData['analisa_id'] = $analisa->id; + dd($request); - switch ($validatedData['action']) { - case 'tanah_bangunan': - $this->handleTanahBangunan($validatedData, $request); - break; - case 'unit': - $this->handleUnit($validatedData); - break; - default: - throw new \Exception('Invalid action type'); - } - AnalisaLingkungan::create($validatedData); - $validatedData['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), 'foto_tempat'); - AnalisaFakta::create($validatedData); - } + // $validatedData = $request->validated(); + // DB::beginTransaction(); + // try { + // $analisa = Analisa::create($validatedData); - DB::commit(); - return redirect()->route('surveyor.show', [ - 'id' => $validatedData['permohonan_id'], - 'form' => 'inspeksi' - ])->with('success', 'Data form surveyor berhasil disimpan'); - } catch (Exception $e) { - DB::rollback(); - return response()->json(['error' => 'Failed to save data', 'details' => $e->getMessage()], 500); - } + // if ($analisa) { + // $validatedData['analisa_id'] = $analisa->id; + + // switch ($validatedData['action']) { + // case 'tanah_bangunan': + // $this->handleTanahBangunan($validatedData, $request); + // break; + // case 'unit': + // $this->handleUnit($validatedData); + // break; + // default: + // throw new \Exception('Invalid action type'); + // } + + // AnalisaLingkungan::create($validatedData); + // $validatedData['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), 'foto_tempat'); + // AnalisaFakta::create($validatedData); + // } + + // DB::commit(); + // return redirect()->route('surveyor.show', [ + // 'id' => $validatedData['permohonan_id'], + // 'form' => 'inspeksi' + // ])->with('success', 'Data form surveyor berhasil disimpan'); + // } catch (Exception $e) { + // DB::rollback(); + // return response()->json(['error' => 'Failed to save data', 'details' => $e->getMessage()], 500); + // } } private function handleTanahBangunan(array $validatedData, FormSurveyorRequest $request) @@ -567,8 +572,14 @@ class SurveyorController extends Controller { $permohonan = $this->getPermohonanJaminanId($id, $jaminanId); + // Auth::user()->id + $link_url_region = Teams::with('regions', 'teamsUsers') + ->whereHas('teamsUsers', function ($query) { + $query->where('user_id', Auth::user()->id); + })->first(); + $branches = Branch::all(); $provinces = Province::all(); @@ -600,9 +611,6 @@ class SurveyorController extends Controller ->where('jenis_jaminan_id', $jaminanId) ->first(); - // return response()->json($permohonan); - - return view('lpj::surveyor.components.inspeksi', compact( 'analisa', 'permohonan', @@ -626,7 +634,8 @@ class SurveyorController extends Controller 'golMasySekitar', 'tingkatKeramaian', 'laluLintasLokasi', - 'perkerasanJalan' + 'perkerasanJalan', + 'link_url_region' )); } diff --git a/app/Http/Controllers/TeamsController.php b/app/Http/Controllers/TeamsController.php index 9efc3ca..d83184d 100644 --- a/app/Http/Controllers/TeamsController.php +++ b/app/Http/Controllers/TeamsController.php @@ -196,6 +196,9 @@ class TeamsController extends Controller ->leftJoin('teams_users', 'teams.id', '=', 'teams_users.teams_id') ->leftJoin('users', 'teams_users.user_id', '=', 'users.id') ->addSelect('users.id as user_id', 'users.name as user_name'); + + + // Filter pencarian if ($request->has('search') && !empty($request->get('search'))) { diff --git a/app/Http/Requests/FormSurveyorRequest.php b/app/Http/Requests/FormSurveyorRequest.php index b79014a..475960b 100644 --- a/app/Http/Requests/FormSurveyorRequest.php +++ b/app/Http/Requests/FormSurveyorRequest.php @@ -80,10 +80,22 @@ class FormSurveyorRequest extends FormRequest $action = $this->input('action'); switch ($action) { - case 'tanah_bangunan': + case 'tanah': return $this->getTanahBangunanRules(); 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 $this->getTanahBangunanRules(); + case 'alat-berat': + return $this->getUnitRules(); default: return []; } @@ -130,4 +142,40 @@ class FormSurveyorRequest extends FormRequest 'bentuk_unit' => 'required', ]; } + + + + private function getKapalRules():array{ + return [ + 'action' => 'required', + 'kondisi_kapal' => 'required', + 'kondisi_kapal_lain' => 'required', + ]; + } + + public function getKendaraanRules():array{ + return [ + 'action' => 'required', + 'kondisi_kendaraan' => 'required', + 'kondisi_kendaraan_lain' => 'required', + ]; + } + + + public function getMesinRules():array{ + return [ + 'action' => 'required', + 'kondisi_mesin' => 'required', + 'kondisi_mesin_lain' => 'required', + ]; + } + + + public function getAlatBeratRules():array{ + return [ + 'action' => 'required', + 'kondisi_alat_berat' => 'required', + 'kondisi_alat_berat_lain' => 'required', + ]; + } } diff --git a/app/Http/Requests/PenilaianRequest.php b/app/Http/Requests/PenilaianRequest.php index 23b91bf..99e979a 100644 --- a/app/Http/Requests/PenilaianRequest.php +++ b/app/Http/Requests/PenilaianRequest.php @@ -25,8 +25,6 @@ class PenilaianRequest extends FormRequest ]; } - - return [ 'jenis_penilaian_id' => 'required|max:255', 'teams_id' => 'required|max:255', diff --git a/app/Http/Requests/RegionRequest.php b/app/Http/Requests/RegionRequest.php index fd9ab1d..250d926 100644 --- a/app/Http/Requests/RegionRequest.php +++ b/app/Http/Requests/RegionRequest.php @@ -14,6 +14,8 @@ class RegionRequest extends FormRequest $rules = [ 'name' => 'required|string|max:255', 'status' => 'nullable|boolean', + 'url' => 'nullable|string|max:255', + 'name_url' => 'nullable|string|max:255', 'authorized_at' => 'nullable|datetime', 'authorized_status' => 'nullable|string|max:1', 'authorized_by' => 'nullable|exists:users,id', diff --git a/app/Models/Regions.php b/app/Models/Regions.php index 28836b5..7b5519c 100644 --- a/app/Models/Regions.php +++ b/app/Models/Regions.php @@ -17,7 +17,7 @@ class Regions extends Model protected $table = 'regions'; protected $fillable = [ - 'code', 'name', 'status', 'authorized_status', 'authorized_at', 'authorized_by' + 'code', 'name', 'status', 'name_url','url','authorized_status', 'authorized_at', 'authorized_by' ]; public function teams(){ diff --git a/database/migrations/2024_10_16_153558_create_analisa_tanah_bangunan_table.php b/database/migrations/2024_10_16_153558_create_analisa_tanah_bangunan_table.php index 585dbf4..2c0cf23 100644 --- a/database/migrations/2024_10_16_153558_create_analisa_tanah_bangunan_table.php +++ b/database/migrations/2024_10_16_153558_create_analisa_tanah_bangunan_table.php @@ -20,7 +20,7 @@ return new class extends Migration $table->string('kontur_tanah'); $table->string('ketinggian_jalan'); $table->string('kontur_jalan'); - $table->string('posis_kavling'); + $table->string('posisi_kavling'); $table->enum('tusuk_sate', ['yes', 'no']); $table->enum('lockland', ['yes', 'no']); $table->string('kondisi_fisik_tanah'); diff --git a/database/migrations/2024_10_31_032940_create_penilai_team_table.php b/database/migrations/2024_10_31_032940_create_penilai_team_table.php index db287b2..fe4f80e 100644 --- a/database/migrations/2024_10_31_032940_create_penilai_team_table.php +++ b/database/migrations/2024_10_31_032940_create_penilai_team_table.php @@ -14,7 +14,7 @@ return new class () extends Migration { $table->id(); $table->unsignedBigInteger('penilaian_id'); $table->unsignedBigInteger('team_id'); - $table->unsignedBigInteger('user_id'); + $table->unsignedBigInteger('user_id')->nullable(); $table->string('role'); $table->boolean('status')->default(true); $table->char('authorized_status', 1)->nullable(); diff --git a/database/migrations/2024_11_08_065701_update_regions_table.php b/database/migrations/2024_11_08_065701_update_regions_table.php new file mode 100644 index 0000000..5c40384 --- /dev/null +++ b/database/migrations/2024_11_08_065701_update_regions_table.php @@ -0,0 +1,30 @@ +string('url')->nullable()->after('name'); + $table->string('name_url')->nullable()->after('url'); + + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('regions', function (Blueprint $table) { + $table->dropColumn('url'); + $table->dropColumn('name_url'); + }); + } +}; diff --git a/module.json b/module.json index 572fe59..1531970 100644 --- a/module.json +++ b/module.json @@ -567,6 +567,14 @@ "attributes": [], "permission": "", "roles": ["administrator","surveyor"] + }, + { + "title": "Perkerasan jalan", + "path": "basicdata.perkerasan-jalan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["administrator","surveyor"] } diff --git a/resources/views/region/create.blade.php b/resources/views/region/create.blade.php index ed8ca6f..626414b 100644 --- a/resources/views/region/create.blade.php +++ b/resources/views/region/create.blade.php @@ -49,6 +49,30 @@ @enderror +
+ +
+ + @error('name_url') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('url') + {{ $message }} + @enderror +
+
-
-

Lokasi Jaminan

-
-
- @php - $inputDataLoaksi = []; + {{-- lokasi jaminan --}} + @include('lpj::surveyor.components.lokasi-jaminan') - $inputDataLoaksi = [ - ['label' => 'Nama Jalan', 'index' => 0], - ['label' => 'Perumahan/Gang', 'index' => 1], - ['label' => 'Blok/Nomor', 'index' => 2], - ['label' => 'Desa/Kelurahan', 'index' => 3], - ['label' => 'Kecamatan', 'index' => 4], - ['label' => 'Kota/Kotamadya', 'index' => 5], - ['label' => 'Provinsi', 'index' => 6] - ]; - - @endphp - - @if (count($inputDataLoaksi) > 0) - @foreach ($inputDataLoaksi as $item) - -
- -
- - - @error('bentuk_tanah') - {{ $message }} - @enderror -
-
- @endforeach - @endif -
diff --git a/resources/views/surveyor/components/bangunan.blade.php b/resources/views/surveyor/components/bangunan.blade.php index 524aace..c293814 100644 --- a/resources/views/surveyor/components/bangunan.blade.php +++ b/resources/views/surveyor/components/bangunan.blade.php @@ -1,6 +1,9 @@ {{-- @if ($analisaType == 'tanah_bangunan') --}} -
+
+
+ +

Analisa Bangunan

@@ -29,21 +32,21 @@ -
+
- + {{ $item->name }} + + @endforeach @endif - + +
@error('jenis_bangunan') {{ $message }} @@ -52,21 +55,23 @@
-
+
- + {{ $item->name }} + + @endforeach @endif - + +
+ @error('kondisi_bangunan') {{ $message }} @@ -75,21 +80,24 @@
-
+
- + {{ $item->name }} + + +
@endforeach @endif - +
@error('sifat_bangunan') {{ $message }} @@ -99,32 +107,29 @@
-
+
-
@if (@isset($spekKategoriBagunan)) @foreach ($spekKategoriBagunan as $item) +
- + {{ $spek->name }} + + @endif @endforeach - +
@error('name') {{ $message }} @@ -154,18 +159,21 @@
- + {{ $item->name }} + + +
@endforeach @endif - +
@error('sarana_pelengkap') {{ $message }} @@ -174,6 +182,7 @@
+
{{-- @endif --}} @push('scripts') diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 0293a06..82d7355 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -5,7 +5,6 @@ @endsection --}} @section('content') -
@@ -516,7 +515,6 @@ - + @endif -
- -
- +
+
-
+ + {{--
+
--}}
@@ -780,7 +557,7 @@
diff --git a/resources/views/surveyor/components/kendaraan.blade.php b/resources/views/surveyor/components/kendaraan.blade.php index a96d64b..093682e 100644 --- a/resources/views/surveyor/components/kendaraan.blade.php +++ b/resources/views/surveyor/components/kendaraan.blade.php @@ -43,43 +43,9 @@
- -
-

Lokasi Jaminan

-
-
- @php - $inputDataLoaksi = []; - - $inputDataLoaksi = [ - ['label' => 'Nama Jalan', 'index' => 0], - ['label' => 'Perumahan/Gang', 'index' => 1], - ['label' => 'Blok/Nomor', 'index' => 2], - ['label' => 'Desa/Kelurahan', 'index' => 3], - ['label' => 'Kecamatan', 'index' => 4], - ['label' => 'Kota/Kotamadya', 'index' => 5], - ['label' => 'Provinsi', 'index' => 6], - ]; - - @endphp - - @if (count($inputDataLoaksi) > 0) - @foreach ($inputDataLoaksi as $item) - -
- -
- - - @error('bentuk_tanah') - {{ $message }} - @enderror -
-
- @endforeach - @endif -
+ + {{-- lokasi jaminan --}} + @include('lpj::surveyor.components.lokasi-jaminan')
diff --git a/resources/views/surveyor/components/lingkungan.blade.php b/resources/views/surveyor/components/lingkungan.blade.php new file mode 100644 index 0000000..a8c105b --- /dev/null +++ b/resources/views/surveyor/components/lingkungan.blade.php @@ -0,0 +1,363 @@ +
+ +
+ + +
+

Analisis Lingkungan

+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ +
+
+ @if (isset($perkerasanJalan)) + @foreach ($perkerasanJalan as $item) + + @endforeach + @endif +
+ @error('perkerasan_jalan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (isset($laluLintasLokasi)) + @foreach ($laluLintasLokasi as $item) + + @endforeach + @endif +
+ @error('lalu_lintas') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (isset($golMasySekitar)) + @foreach ($golMasySekitar as $item) + + @endforeach + @endif +
+ + @error('gol_mas_sekitar') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (isset($tingkatKeramaian)) + @foreach ($tingkatKeramaian as $item) + + @endforeach + @endif +
+ + @error('tingkat_keramaian') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+ + @error('terletak_diarea') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+
+ + +
+ +
+ + @error('disekitar_lokasi') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+
+ + +
+ + +
+ + @error('dekatMakam') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+
+ + +
+ + +
+ + @error('dekatTps') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+ + @error('merupakan_daerah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ +
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+ @error('fasilitas_dekat_object') + {{ $message }} + @enderror +
+
+
+
+
+ + +@push('scripts') + +@endpush diff --git a/resources/views/surveyor/components/lokasi-jaminan.blade.php b/resources/views/surveyor/components/lokasi-jaminan.blade.php new file mode 100644 index 0000000..32397f1 --- /dev/null +++ b/resources/views/surveyor/components/lokasi-jaminan.blade.php @@ -0,0 +1,38 @@ +
+

Lokasi Jaminan

+
+
+ + + @php + + $inputDataLoaksi = []; + $inputDataLoaksi = [ + ['label' => 'Nama Jalan', 'index' => 0, 'name' => 'nama_jalan', 'value' => old('lokasi_jalan', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_jalan : '')], + ['label' => 'Perumahan/Gang', 'index' => 1, 'name' => 'perumahan_gang', 'value' => old('lokasi_perumahan_gang', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_perumahan_gang : '')], + ['label' => 'Blok/Nomor', 'index' => 2, 'name' => 'blok_nomor', 'value' => old('lokasi_blok_nomor', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_blok_nomor : '')], + ['label' => 'Desa/Kelurahan', 'index' => 3, 'name' => 'desa_kelurahan', 'value' => old('lokasi_desa_kelurahan', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_desa_kelurahan : '')], + ['label' => 'Kecamatan', 'index' => 4, 'name' => 'kecamatan' , 'value' => old('lokasi_kecamatan', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_kecamatan : '')], + ['label' => 'Kota/Kotamadya', 'index' => 5, 'name' => 'kota_kotamadya', 'value' => old('lokasi_kota_kotamadya', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_kota_kotamadya : '')], + ['label' => 'Provinsi', 'index' => 6, 'name' => 'provinsi', 'value' => old('lokasi_provinsi', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lokasi_provinsi : '')], + ]; + + @endphp + + @if (count($inputDataLoaksi) > 0) + @foreach ($inputDataLoaksi as $item) + +
+ +
+ + + @error($item['name']) + {{ $message }} + @enderror +
+
+ @endforeach + @endif +
diff --git a/resources/views/surveyor/components/mesin.blade.php b/resources/views/surveyor/components/mesin.blade.php index 81d71c0..ed75ce2 100644 --- a/resources/views/surveyor/components/mesin.blade.php +++ b/resources/views/surveyor/components/mesin.blade.php @@ -16,42 +16,8 @@
-
-

Lokasi Jaminan

-
-
- @php - $inputDataLoaksi = []; - - $inputDataLoaksi = [ - ['label' => 'Nama Jalan', 'index' => 0], - ['label' => 'Perumahan/Gang', 'index' => 1], - ['label' => 'Blok/Nomor', 'index' => 2], - ['label' => 'Desa/Kelurahan', 'index' => 3], - ['label' => 'Kecamatan', 'index' => 4], - ['label' => 'Kota/Kotamadya', 'index' => 5], - ['label' => 'Provinsi', 'index' => 6] - ]; - - @endphp - - @if (count($inputDataLoaksi) > 0) - @foreach ($inputDataLoaksi as $item) - -
- -
- - - @error('bentuk_tanah') - {{ $message }} - @enderror -
-
- @endforeach - @endif -
+ {{-- lokasi jaminan --}} + @include('lpj::surveyor.components.lokasi-jaminan')
diff --git a/resources/views/surveyor/components/pesawat.blade.php b/resources/views/surveyor/components/pesawat.blade.php new file mode 100644 index 0000000..26aa8db --- /dev/null +++ b/resources/views/surveyor/components/pesawat.blade.php @@ -0,0 +1,580 @@ +
+
+

Identitas Debitur

+
+ +
+ +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ +
+ + {{-- lokasi jaminan --}} + @include('lpj::surveyor.components.lokasi-jaminan') +
+ + +
+
+

Data Data Umum

+
+
+
+ +
+ + + @error('hadapMataAngin') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('hadapMataAngin') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('hadapMataAngin') + {{ $message }} + @enderror +
+
+ + @php + $inputDataJaminan = []; + + $inputDataJaminan = [ + ['label' => 'Nama Pesawat', 'index' => 0], + ['label' => 'Model', 'index' => 1], + ['label' => 'Nomor Registrasi', 'index' => 2], + ['label' => 'Tahun Pembuatan', 'index' => 3], + ['label' => 'Certificate of Airworthines (C of A)', 'index' => 4], + [ + 'label' => 'Certificate of Registration (C of A)', + 'index' => 5, + ], + + [ + 'label' => 'Total Service Hours (TSN - Total Time Since New)', + 'index' => 6, + ], + [ + 'label' => 'Total Service Cycles (CSN - Cycle Since New)', + 'index' => 7, + ], + ]; + @endphp + + @if (count($inputDataJaminan) > 0) + @foreach ($inputDataJaminan as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif +
+
+ + +
+
+

Maintainence Data

+
+
+ + @php + $inputMaintenece = []; + $inputMaintenece = [ + ['label' => 'Last A Check', 'index' => 0], + ['label' => 'Next A Check', 'index' => 1], + ['label' => 'Last B Check', 'index' => 2], + ['label' => 'Next B Check', 'index' => 3], + ['label' => 'Last C Check', 'index' => 4], + ['label' => 'Next C Check', 'index' => 5], + ['label' => 'Next D Check (Overhaul)', 'index' => 6], + ['label' => 'Last D Check (Overhaul)', 'index' => 7], + ]; + @endphp + + @if (count($inputMaintenece) > 0) + @foreach ($inputMaintenece as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + + +
+
+

Fungsi konfigurasi

+
+
+ + @php + $inputFungsiKonfigurasi = []; + $inputFungsiKonfigurasi = [ + ['label' => 'Instrument Landing System (ILS)', 'index' => 0], + ['label' => 'Traffic Collision Avoidance System (TCAS)', 'index' => 1], + ['label' => 'Windshear', 'index' => 2], + ['label' => 'Electronic Flight Instrument System (EFIS)', 'index' => 3], + ['label' => 'Winglets ', 'index' => 4], + ]; + @endphp + + @if (count($inputFungsiKonfigurasi) > 0) + @foreach ($inputFungsiKonfigurasi as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + +
+
+

Kondisi Kabin pesawat

+
+
+ + @php + $inputMaintenece = []; + $inputMaintenece = [ + ['label' => 'Maksimal Penumpang', 'index' => 0], + ['label' => 'Jumlah Kursi', 'index' => 1], + ['label' => 'Kursi Pramugari/Pramugara', 'index' => 2], + ['label' => 'Kartu Fitur keselamatan', 'index' => 3], + ['label' => 'Sabuk Pengaman', 'index' => 4], + ['label' => 'Lampu Kabin', 'index' => 5], + ['label' => 'Lampu Pintu Keluar', 'index' => 6], + ['label' => 'Intercom Kabin', 'index' => 7], + ]; + @endphp + + @if (count($inputMaintenece) > 0) + @foreach ($inputMaintenece as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + +
+
+

Kondisi Struktur Pesawat

+
+
+ + @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Badan pesawat', 'index' => 0], + ['label' => 'Sayap Pesawat', 'index' => 1], + ['label' => 'Ekor peswat', 'index' => 2], + ['label' => 'Landing Gear', 'index' => 3], + ['label' => 'Sabuk Pengaman', 'index' => 4], + ['label' => 'Sistem Pengelasan', 'index' => 5], + ]; + @endphp + + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + + +
+
+

Fungsi Navigasi dan Komunikasi

+
+
+ @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Gps', 'index' => 0], + ['label' => 'Radar', 'index' => 1], + ['label' => 'Radio Komunikasi', 'index' => 2], + ['label' => 'Lampu Navigasi', 'index' => 3], + ['label' => 'Sistem Autopilot', 'index' => 4], + ]; + @endphp + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + + +
+
+

Kondisi Sistem Bahan Bakar dan Hidrolic

+
+
+ @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Tangki Bahan Bakar', 'index' => 0], + ['label' => 'Saluran & Pipa Bahan Bakar', 'index' => 1], + ['label' => 'Pompa Bahan Bakar', 'index' => 2], + ['label' => 'Sistem Hidrolik Utama', 'index' => 3], + ['label' => 'Sistem Pendigin Hidrolik', 'index' => 4], + ]; + @endphp + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + +
+
+

Kondisi Mesin dan Propulis

+
+
+ @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Mesin Utama', 'index' => 0], + ['label' => 'Sistem Pendorong', 'index' => 1], + ['label' => 'Sistem Pendigin Mesin', 'index' => 2], + ['label' => 'Sistem pelumasan', 'index' => 3], + ['label' => 'Filter dan Perangkat Pendukung', 'index' => 4], + ]; + @endphp + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + +
+
+

Fungsi keselamatan dan darurat

+
+
+ @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Jaket pelampung', 'index' => 0], + ['label' => 'Pintu darurat', 'index' => 1], + ['label' => 'Alat Pemadaman Kebakaran', 'index' => 2], + ['label' => 'Sistem Alaram Darurat', 'index' => 3], + ['label' => 'Sekoci', 'index' => 4], + ['label' => 'Masker Oksigen', 'index' => 4], + ['label' => 'Sabuk Pengaman', 'index' => 4], + ]; + @endphp + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
+ + + +
+
+

Interior dan Sistem Pendukung Kabin

+
+
+ @php + $inputStrukturPeswat = []; + $inputStrukturPeswat = [ + ['label' => 'Sistem ventilasi & AC', 'index' => 0], + ['label' => 'Sistem Penerangan Kabin', 'index' => 1], + ['label' => 'Panel Informasi Penumpang', 'index' => 2], + ['label' => 'Sistem Hiburan Kabin', 'index' => 3], + ]; + @endphp + @if (count($inputStrukturPeswat) > 0) + @foreach ($inputStrukturPeswat as $item) + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ @endforeach + @endif + +
+ +
+ + @error('deskripsi') + {{ $message }} + @enderror +
+
+
+ +
diff --git a/resources/views/surveyor/components/tanah.blade.php b/resources/views/surveyor/components/tanah.blade.php index c71af11..80885ff 100644 --- a/resources/views/surveyor/components/tanah.blade.php +++ b/resources/views/surveyor/components/tanah.blade.php @@ -1,248 +1,588 @@ -
-
-

Analisa Tanah

+
+
+
+

Order Penilaian

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

{{ $permohonan->tujuanPenilaian->name }}

+ @endif +
+
+
+ +
+

{{ $permohonan->created_at->format('d/m/Y') }}

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

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

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

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

+ @endif +
+
+
+ +
+ +
+
+ + +
+
+ + +
-
+
- -
- -
-
- - + +
+ +
+
+

Nama Cadeb/Debitur

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

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

+ @endif
- - @error('bentuk_tanah') - {{ $message }} - @enderror -
-
- - -
- -
- - - @error('hadapMataAngin') - {{ $message }} - @enderror -
-
- - -
- -
- - - @error('bentuk_tanah') - {{ $message }} - @enderror -
-
- - - -
- -
- - - @error('kontur_tanah') - {{ $message }} - @enderror -
-
- - - -
- -
- - - @error('ketinggian_jalan') - {{ $message }} - @enderror -
-
- - - -
- -
-
- - -
- - @error('kontur_jalan') - {{ $message }} - @enderror -
-
- - -
- -
- - @error('posisi_kavling') - {{ $message }} - @enderror -
-
- - - -
- -
-
- - -
- - @error('tusuk_sate') - {{ $message }} - @enderror -
-
- - -
- -
-
- - -
- @error('lockland') - {{ $message }} - @enderror -
-
- - - -
- -
- - - @error('kondisi_fisik_tanah') - {{ $message }} - @enderror
+ +
+
+
+

Deskripsi Aset jaminan

+
+ +
+
+ +
+
+ @if (isset($permohonan->debiture->documents)) + @foreach ($permohonan->debiture->documents as $item) +

{{ $item->jenisJaminan->name }}

+ @endforeach + @endif +
+
+ + + + + + + + +
+
+
+ +
+ +
+ + @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 + +
+
+ + + + +
+
+ +
+
+
+
+
+ + +
+
+
+

Titik Koordinat Google Maps

+
+
+ +
+
+ + +
+
+
+
+
+ +
+
+ +
+
+

Status Kepemilikan

+
+
+ + +
+
+

Izin Bangunan

+
+
+ + +
+
+

SPPT PBB

+
+
+ +
+
+

Dokument Lainnya

+
+
+ + +
+
+

Hubungan cadeb/debitur dengan Pemilik Jaminan

+
+
+ +
+
+

Hubungan Cadeb/Debitur dengan Penghuni Jaminan

+
+
+ +
+
+ + +
+
+ + +
+

Analisa Tanah

+
+
+ +
+ +
+ @if (isset($permohonan->debiture->documents)) + @foreach ($permohonan->debiture->documents as $item) + @php + $details = json_decode($item->detail); + $luas_tanah = isset($details['luas_tanah']) ? $details['luas_tanah'] : 'N/A'; + @endphp +

{{ $luas_tanah }} m2

+ @endforeach + @endif +
+
+ + + +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+
+ + +
+ +
+
+ + + + + + +
+ + @error('hadapMataAngin') + {{ $message }} + @enderror +
+
+ + + +
+ +
+
+ @if (isset($bentukTanah)) + @foreach ($bentukTanah as $item) + + @endforeach + @endif + +
+ @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+ @error('kontur_tanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + +
+ @if (isset($ketinggianTanah)) + @foreach ($ketinggianTanah as $item) + + @endforeach + @endif +
+ @error('ketinggian_jalan') + {{ $message }} + @enderror +
+
+ + + +
+ +
+
+ + +
+ + @error('kontur_jalan') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ @if (isset($posisiKavling)) + @foreach ($posisiKavling as $item) + + @endforeach + @endif + +
+ @error('posisi_kavling') + {{ $message }} + @enderror +
+
+ + + +
+ +
+
+ + +
+ + @error('tusuk_sate') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ @error('lockland') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ +
+ @if (isset($kondisiFisikTanah)) + @foreach ($kondisiFisikTanah as $item) + + @endforeach + @endif + +
+ + @error('kondisi_fisik_tanah') + {{ $message }} + @enderror +
+
+
+
+
+ + +@push('scripts') + +@endpush diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index f88c30e..2a428af 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -547,6 +547,7 @@ $basicDataRoutes = [ 'lantai-unit' => 'Lantai Unit', 'view-unit' => 'View Unit', 'bentuk-unit' => 'Bentuk unit', + 'perkerasan-jalan' => 'Perkerasan jalan' ]; diff --git a/routes/web.php b/routes/web.php index 97e53a4..47f49ad 100644 --- a/routes/web.php +++ b/routes/web.php @@ -294,6 +294,7 @@ Route::middleware(['auth'])->group(function () { 'lantai-unit' => 'Lantai Unit', 'view-unit' => 'View Unit', 'bentuk-unit' => 'Bentuk unit', + 'perkerasan-jalan' => 'Perkerasan jalan', ]; foreach ($headers as $type => $header) { From 1f033a6f2543d1e687b7200475e8cf62cf756abb Mon Sep 17 00:00:00 2001 From: majid76 Date: Mon, 11 Nov 2024 07:29:18 +0700 Subject: [PATCH 3/7] update form inspeksi tanah dan bagunan --- app/Http/Controllers/SurveyorController.php | 16 +- app/Models/PenilaianTeam.php | 2 +- .../surveyor/components/bangunan.blade.php | 347 +++-- .../surveyor/components/inspeksi.blade.php | 1299 +++++++++-------- .../surveyor/components/lingkungan.blade.php | 4 +- .../views/surveyor/components/tanah.blade.php | 149 +- 6 files changed, 945 insertions(+), 872 deletions(-) diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 48a5066..ec27c82 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -153,7 +153,13 @@ class SurveyorController extends Controller public function store(Request $request) { - dd($request); + try { + + return response()->json(['status' => 200, 'message' => 'Data berhasil disimpan']); + } catch (Exception $e) { + + return response()->json(['status' => 500, 'message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); + } // $validatedData = $request->validated(); @@ -523,8 +529,9 @@ class SurveyorController extends Controller $query->whereRaw('LOWER(status) = ?', ['assign']); - $query->whereHas('region.teams.teamsUsers.user', function ($q) { - $q->where('id', Auth::user()->id); + $query->whereHas('penilaian.userPenilai', function ($q) { + $q->where('user_id', Auth::user()->id); + $q->where('role', 'surveyor'); }); @@ -549,7 +556,7 @@ class SurveyorController extends Controller } $filteredRecords = $query->count(); - $data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'jenisFasilitasKredit'])->get(); + $data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisFasilitasKredit'])->get(); $pageCount = ceil($totalRecords / $size); @@ -788,6 +795,7 @@ class SurveyorController extends Controller $header = $dataMap[$type] ?? ''; $model = $modelClass::findOrFail($id); + $spekKategoriBagunan= null; if ($type == 'spek-bangunan') { $spekKategoriBagunan = SpekKategoritBangunan::all(); diff --git a/app/Models/PenilaianTeam.php b/app/Models/PenilaianTeam.php index 808d0de..8df88ef 100644 --- a/app/Models/PenilaianTeam.php +++ b/app/Models/PenilaianTeam.php @@ -29,7 +29,7 @@ class PenilaianTeam extends Model public function penilaian(){ - return $this->hasMany(Penilaian::class, 'penilaian_id', 'id'); + return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id'); } protected static function newFactory(): PenilaianTeamFactory diff --git a/resources/views/surveyor/components/bangunan.blade.php b/resources/views/surveyor/components/bangunan.blade.php index c293814..7c66d7d 100644 --- a/resources/views/surveyor/components/bangunan.blade.php +++ b/resources/views/surveyor/components/bangunan.blade.php @@ -1,188 +1,211 @@ - {{-- @if ($analisaType == 'tanah_bangunan') --}}
-
-

Analisa Bangunan

-
-
-
- -
-
- - +
+

Analisa Bangunan

+
+
+
+ +
+
+ + +
+ + @error('luas_tanah_bagunan') + {{ $message }} + @enderror
- - @error('luas_tanah_bagunan') - {{ $message }} - @enderror
-
- -
- -
-
- @if (isset($jenisBangunan)) - @foreach ($jenisBangunan as $item) - - @endforeach - @endif - -
- - @error('jenis_bangunan') - {{ $message }} - @enderror -
-
- - -
- -
- -
- @if (isset($kondisiBangunan)) - @foreach ($kondisiBangunan as $item) - - @endforeach - @endif - -
- - - @error('kondisi_bangunan') - {{ $message }} - @enderror -
-
- - -
- -
- - -
- @if (isset($sifatBangunan)) - @foreach ($sifatBangunan as $item) -
- - -
- @endforeach - @endif -
- - @error('sifat_bangunan') - {{ $message }} - @enderror -
-
- - -
+
- -
-
- -
- @if (@isset($spekKategoriBagunan)) - @foreach ($spekKategoriBagunan as $item) + +
+
+ @if (isset($jenisBangunan)) + @foreach ($jenisBangunan as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ + +
+ @endif + @endforeach + @endif +
+ @error('jenis_bangunan') + {{ $message }} + @enderror +
+
-
- -
-
- @foreach ($spekBangunan as $spek) - @if ($spek->spek_kategori_bangunan_id == $item->id) - - @endif - @endforeach -
+ +
+ +
- @error('name') - {{ $message }} - @enderror +
+ @if (isset($kondisiBangunan)) + @foreach ($kondisiBangunan as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ + +
+ @endif + @endforeach + @endif + +
+ + + @error('kondisi_bangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + +
+ @if (isset($sifatBangunan)) + @foreach ($sifatBangunan as $item) +
+ + +
+ @endforeach + @endif +
+ + @error('sifat_bangunan') + {{ $message }} + @enderror +
+
+ + +
+
+ +
+
+ +
+ @if (@isset($spekKategoriBagunan)) + @foreach ($spekKategoriBagunan as $item) +
+ +
+
+ @foreach ($spekBangunan as $spek) + @if ($spek->spek_kategori_bangunan_id == $item->id) + + @endif + @endforeach +
+ + @error('name') + {{ $message }} + @enderror +
-
- @endforeach - @endif + @endforeach + @endif +
+
-
-
-
- -
-
- - - - -
- -
- - -
- @if (isset($saranaPelengkap)) - @foreach ($saranaPelengkap as $item) -
- - -
- @endforeach - @endif +
+
+
- @error('sarana_pelengkap') - {{ $message }} - @enderror + + + +
+ +
+ + +
+ @if (isset($saranaPelengkap)) + @foreach ($saranaPelengkap as $item) +
+ + +
+ @endforeach + @endif +
+ + @error('sarana_pelengkap') + {{ $message }} + @enderror +
-
{{-- @endif --}} @push('scripts') diff --git a/resources/views/surveyor/components/inspeksi.blade.php b/resources/views/surveyor/components/inspeksi.blade.php index 7951638..0389306 100644 --- a/resources/views/surveyor/components/inspeksi.blade.php +++ b/resources/views/surveyor/components/inspeksi.blade.php @@ -5,681 +5,690 @@ @endsection --}} @section('content') -
+
+
-
-
-

- Data Jaminan -

- -
- @php - $jenisJaminanData = null; - - @endphp - -
- @foreach ($permohonan->debiture->documents as $dokumen) - @php - $jenisJaminanData = $dokumen->jenisJaminan->name ?? ''; - @endphp - -
- - -
- @endforeach +
+

+ Data Jaminan +

+
-
- - - - {{--
-
--}} -
- @if (isset($analisa->id)) - - @method('PUT') - @endif - @csrf - - - - @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'; - } + $jenisJaminanData = null; @endphp - - +
+ @foreach ($permohonan->debiture->documents as $dokumen) + @php + $jenisJaminanData = $dokumen->jenisJaminan->name ?? ''; + @endphp - @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 - - {{-- analisa fakta --}} -
-
-
-

Analisis Fakta

-
-
-
- -
- - - @error('fakta_positif') - {{ $message }} - @enderror +
+ + --}} -
- - - + + {{--
+
--}} +
+ @if (isset($analisa->id)) + + @method('PUT') + @endif + @csrf + + + + + @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 + + + + + @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 + + {{-- analisa fakta --}} +
+
+
+

Analisis Fakta

+
+
+
+ +
+ + + @error('fakta_positif') + {{ $message }} + @enderror +
+ + +
+ +
+ +
+ + @error('fakta_negatif') + {{ $message }} + @enderror +
+ +
+ + @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') +
+ +
+ + @error('rute_menuju') + {{ $message }} + @enderror +
+
+ +
+ +
+
+ @php + $inputBatas = []; + $inputBatas = [ + ['label' => 'Utara', 'index' => 0], + ['label' => 'Timur', 'index' => 1], + ['label' => 'Selatan', 'index' => 2], + ['label' => 'Barat', 'index' => 3], + ]; + @endphp + @if ($inputBatas > 0) + @foreach ($inputBatas as $item) +
+ + +
+ @endforeach + @endif +
+ + @error('batas_batas') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + + @error('kondisi_linkungan') + {{ $message }} + @enderror +
+ + +
+ + +
+ +
+ + @error('kondisi_lain_bangunan') + {{ $message }} + @enderror +
+ +
+ +
+ +
+ + @error('informasi_dokument') + {{ $message }} + @enderror +
+ +
+ @endif +
+
+
+ + + + @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') +
+
+ + +
+

Informasi Dinas Tata Ruang

+
+ + +
+ +
+ +
+ + @error('peruntukan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('kdb') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kdh') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gsb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('maxLantai') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('klb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gss') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('pelebaran_jalan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('nama_petugas') + {{ $message }} + @enderror +
+
+ + +
+ + +
+
+ +
+ + + + Bhumi + +
+
+ + @if (isset($link_url_region->regions->url)) +
+ + +
+ @endif +
+ + +
+ + +
+ +
+
+ + + +
+
+ +
+ @if (old('foto_tempat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->foto_tempat : '')) + Gambar Tempat + @endif +
+ + + + + @error('foto_tempat') + {{ $message }} + @enderror + + + +
+ +
+ + +
+
+

Catatan yang Perlu Diperhatikan +

+ +
+
+
+
+ @endif + +
+ +
+
+ {{--
+
--}} +
+ + + + + @endsection @push('scripts') - + + + - // Isi input dengan data URL gambar - inputRute.value = dataURL; + + - - - - - -@endpush + alert("Data gagal disimpan."); + } + }); + } + + +@endpush \ No newline at end of file diff --git a/resources/views/surveyor/components/lingkungan.blade.php b/resources/views/surveyor/components/lingkungan.blade.php index a8c105b..3af8fee 100644 --- a/resources/views/surveyor/components/lingkungan.blade.php +++ b/resources/views/surveyor/components/lingkungan.blade.php @@ -3,12 +3,12 @@
-
+

Analisis Lingkungan

-
+
- +
@@ -113,16 +109,14 @@ value="{{ $item->name }}" /> {{ $item->name }} -
@endforeach @endif
+ - @error('sifat_bangunan') - {{ $message }} - @enderror
@@ -137,6 +131,7 @@ @if (@isset($spekKategoriBagunan)) @foreach ($spekKategoriBagunan as $item)
+
@@ -144,7 +139,7 @@ @foreach ($spekBangunan as $spek) @if ($spek->spek_kategori_bangunan_id == $item->id) @@ -152,9 +147,7 @@ @endforeach
- @error('name') - {{ $message }} - @enderror +
@endforeach @@ -191,16 +184,16 @@ value="{{ $item->name }}" /> {{ $item->name }} -
@endforeach @endif
- @error('sarana_pelengkap') - {{ $message }} - @enderror + + +
diff --git a/resources/views/surveyor/components/fakta.blade.php b/resources/views/surveyor/components/fakta.blade.php new file mode 100644 index 0000000..900bca6 --- /dev/null +++ b/resources/views/surveyor/components/fakta.blade.php @@ -0,0 +1,334 @@ + {{-- analisa fakta --}} +
+
+
+

Analisis Fakta

+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + +
+ +
+ + @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') +
+ +
+ + +
+
+ +
+ +
+
+ @php + $inputBatas = []; + $inputBatas = [ + ['label' => 'Utara', 'index' => 0], + ['label' => 'Timur', 'index' => 1], + ['label' => 'Selatan', 'index' => 2], + ['label' => 'Barat', 'index' => 3], + ]; + @endphp + @if ($inputBatas > 0) + @foreach ($inputBatas as $item) +
+ + +
+ @endforeach + @endif +
+ + @error('batas_batas') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + + @error('kondisi_linkungan') + {{ $message }} + @enderror +
+ + +
+ + +
+ +
+ + @error('kondisi_lain_bangunan') + {{ $message }} + @enderror +
+ +
+ +
+ +
+ + @error('informasi_dokument') + {{ $message }} + @enderror +
+ +
+ @endif +
+
+
+ + + + @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') +
+
+ + +
+

Informasi Dinas Tata Ruang

+
+ + +
+ +
+ +
+ + @error('peruntukan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('kdb') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kdh') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gsb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('maxLantai') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('klb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gss') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('pelebaran_jalan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('nama_petugas') + {{ $message }} + @enderror +
+
+ + +
+ + +
+
+ +
+ + + + Bhumi + +
+
+ + @if (isset($link_url_region->regions->url)) +
+ + +
+ @endif +
+ + +
+ + +
+ +
+
+ + + +
+
+ +
+ @if (old('foto_tempat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->foto_tempat : '')) + Gambar Tempat + @endif +
+ + + + + @error('foto_tempat') + {{ $message }} + @enderror + + + +
+ +
+ + +
+
+

Catatan yang Perlu Diperhatikan +

+ +
+
+
+
+ @endif diff --git a/resources/views/surveyor/components/header.blade.php b/resources/views/surveyor/components/header.blade.php new file mode 100644 index 0000000..83ad489 --- /dev/null +++ b/resources/views/surveyor/components/header.blade.php @@ -0,0 +1,322 @@ +
+
+
+

Order Penilaian

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

{{ $permohonan->tujuanPenilaian->name }}

+ @endif +
+
+
+ +
+

{{ $permohonan->created_at->format('d/m/Y') }}

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

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

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

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

+ @endif +
+
+
+ +
+ +
+
+ + +
+
+ + + +
+
+
+ + +
+ +
+
+

Nama Cadeb/Debitur

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

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

+ @endif +
+
+
+
+
+ + +
+
+
+

Deskripsi Aset jaminan

+
+ +
+
+ +
+
+ @if (isset($permohonan->debiture->documents)) + @foreach ($permohonan->debiture->documents as $item) +

{{ $item->jenisJaminan->name }}

+ @endforeach + @endif +
+
+
+ + + + +
+ +
+
+
+ +
+ +
+ + @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 + +
+
+ + + + +
+ + +
+ +
+ @php + + $inputDataLoaksi = []; + $inputDataLoaksi = [ + [ + 'label' => 'Jl.', + 'index' => 0, + 'name' => 'nama_jalan', + 'value' => old( + 'lokasi_jalan', + isset($analisa->analisaLingkungan) + ? $analisa->analisaLingkungan->lokasi_jalan + : '', + ), + ], + + [ + 'label' => 'Desa/Kelurahan', + 'index' => 3, + 'name' => 'desa_kelurahan', + 'value' => old( + 'lokasi_desa_kelurahan', + isset($analisa->analisaLingkungan) + ? $analisa->analisaLingkungan->lokasi_desa_kelurahan + : '', + ), + ], + [ + 'label' => 'Kecamatan', + 'index' => 4, + 'name' => 'kecamatan', + 'value' => old( + 'lokasi_kecamatan', + isset($analisa->analisaLingkungan) + ? $analisa->analisaLingkungan->lokasi_kecamatan + : '', + ), + ], + [ + 'label' => 'Kota/Kabupaten', + 'index' => 5, + 'name' => 'kota_kabupaten', + 'value' => old( + 'lokasi_kota_kotamadya', + isset($analisa->analisaLingkungan) + ? $analisa->analisaLingkungan->lokasi_kota_kotamadya + : '', + ), + ], + [ + 'label' => 'Provinsi', + 'index' => 6, + 'name' => 'provinsi', + 'value' => old( + 'lokasi_provinsi', + isset($analisa->analisaLingkungan) + ? $analisa->analisaLingkungan->lokasi_provinsi + : '', + ), + ], + ]; + + @endphp + + @if (count($inputDataLoaksi) > 0) + @foreach ($inputDataLoaksi as $item) + +
+ +
+ + + @error($item['name']) + {{ $message }} + @enderror +
+
+ @endforeach + @endif +
+ + + +
+
+
+
+
+ + +
+
+
+

Titik Koordinat Google Maps

+
+
+ +
+
+ + +
+ +
+
+
+
+ +
+
+ +
+
+

Status Kepemilikan

+
+
+ + +
+
+

Izin Bangunan

+
+
+ + +
+
+

SPPT PBB

+
+
+ +
+
+

Dokument Lainnya

+
+
+ + +
+
+

Hubungan cadeb/debitur dengan Pemilik Jaminan

+
+
+ +
+
+

Hubungan Cadeb/Debitur dengan Penghuni Jaminan

+
+
+ +
+
diff --git a/resources/views/surveyor/components/inspeksi.blade.php b/resources/views/surveyor/components/inspeksi.blade.php index 0389306..e00e617 100644 --- a/resources/views/surveyor/components/inspeksi.blade.php +++ b/resources/views/surveyor/components/inspeksi.blade.php @@ -5,690 +5,363 @@ @endsection --}} @section('content') -
-
+
-
-

- Data Jaminan -

-
- - Back - +
+
+

+ Data Jaminan +

+ +
+ @php + $jenisJaminanData = null; + + @endphp + +
+ @foreach ($permohonan->debiture->documents as $dokumen) + @php + $jenisJaminanData = $dokumen->jenisJaminan->name ?? ''; + @endphp + +
+ + +
+ @endforeach
+
+ + + + {{--
+
--}} +
+ @if (isset($analisa->id)) + + @method('PUT') + @endif + @csrf + + + + @php - $jenisJaminanData = null; + $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 = 'kendaraan'; + } + + if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') { + $analisaType = 'unit'; + } @endphp -
- @foreach ($permohonan->debiture->documents as $dokumen) - @php - $jenisJaminanData = $dokumen->jenisJaminan->name ?? ''; - @endphp + + -
- - -
- @endforeach + @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') + +
+
-
-
- - - - {{--
-
--}} - - @if (isset($analisa->id)) - - @method('PUT') - @endif - @csrf - - - - - @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 - - - - - @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 - - {{-- analisa fakta --}} -
-
-
-

Analisis Fakta

-
-
-
- -
- - - @error('fakta_positif') - {{ $message }} - @enderror -
- - -
- -
- -
- - @error('fakta_negatif') - {{ $message }} - @enderror -
- -
- - @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') -
- -
- - @error('rute_menuju') - {{ $message }} - @enderror -
-
- -
- -
-
- @php - $inputBatas = []; - $inputBatas = [ - ['label' => 'Utara', 'index' => 0], - ['label' => 'Timur', 'index' => 1], - ['label' => 'Selatan', 'index' => 2], - ['label' => 'Barat', 'index' => 3], - ]; - @endphp - @if ($inputBatas > 0) - @foreach ($inputBatas as $item) -
- - -
- @endforeach - @endif -
- - @error('batas_batas') - {{ $message }} - @enderror -
-
- - -
- -
- - - - @error('kondisi_linkungan') - {{ $message }} - @enderror -
- - -
- - -
- -
- - @error('kondisi_lain_bangunan') - {{ $message }} - @enderror -
- -
- -
- -
- - @error('informasi_dokument') - {{ $message }} - @enderror -
- -
- @endif -
-
-
- - - - @if ($analisaType != 'mesin' && $analisaType != 'kapal' && $analisaType != 'kendaraan' && $analisaType != 'pesawat') -
-
- - -
-

Informasi Dinas Tata Ruang

-
- - -
- -
- -
- - @error('peruntukan') - {{ $message }} - @enderror -
-
- -
- -
- - @error('kdb') - {{ $message }} - @enderror -
-
- - -
- -
- - @error('kdh') - {{ $message }} - @enderror -
-
- -
- -
- - @error('gsb') - {{ $message }} - @enderror -
-
- -
- -
- - @error('maxLantai') - {{ $message }} - @enderror -
-
- -
- -
- - @error('klb') - {{ $message }} - @enderror -
-
- -
- -
- - @error('gss') - {{ $message }} - @enderror -
-
- -
- -
- - @error('pelebaran_jalan') - {{ $message }} - @enderror -
-
- -
- -
- - @error('nama_petugas') - {{ $message }} - @enderror -
-
- - -
- - -
-
- -
- - - - Bhumi - -
-
- - @if (isset($link_url_region->regions->url)) -
- - -
- @endif -
- - -
- - -
- -
-
- - - -
-
- -
- @if (old('foto_tempat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->foto_tempat : '')) - Gambar Tempat - @endif -
- - - - - @error('foto_tempat') - {{ $message }} - @enderror - - - -
- -
- - -
-
-

Catatan yang Perlu Diperhatikan -

- -
-
-
-
- @endif - -
- -
- - {{--
+ + {{--
--}} -
+
-
-
+
+

Data Data Jaminan

@@ -124,3 +131,4 @@
+
diff --git a/resources/views/surveyor/components/lingkungan.blade.php b/resources/views/surveyor/components/lingkungan.blade.php index 3af8fee..da52a44 100644 --- a/resources/views/surveyor/components/lingkungan.blade.php +++ b/resources/views/surveyor/components/lingkungan.blade.php @@ -18,8 +18,8 @@
- +
@@ -29,7 +29,7 @@
+ value="{{ old('nama_cbd_point', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->jarak_cbd_point : '') }}">
@@ -53,9 +53,7 @@ @endforeach @endif
- @error('perkerasan_jalan') - {{ $message }} - @enderror +
@@ -75,9 +73,8 @@ @endforeach @endif
- @error('lalu_lintas') - {{ $message }} - @enderror + +
@@ -98,9 +95,8 @@ @endif
- @error('gol_mas_sekitar') - {{ $message }} - @enderror + +
@@ -120,10 +116,8 @@ @endforeach @endif
+ - @error('tingkat_keramaian') - {{ $message }} - @enderror
@@ -142,10 +136,8 @@ @endforeach @endif
+ - @error('terletak_diarea') - {{ $message }} - @enderror
@@ -156,19 +148,20 @@
+
- @error('disekitar_lokasi') - {{ $message }} - @enderror + ) + +
@@ -235,7 +228,7 @@
@error('dekatMakam') - {{ $message }} + @enderror
@@ -256,7 +249,7 @@ style="visibility: hidden; height: 0;">
- +
@@ -269,10 +262,7 @@ Tidak
- - @error('dekatTps') - {{ $message }} - @enderror +
@@ -291,10 +281,7 @@ @endforeach @endif
- - @error('merupakan_daerah') - {{ $message }} - @enderror +
@@ -314,10 +301,8 @@ @endforeach @endif - - @error('fasilitas_dekat_object') - {{ $message }} - @enderror + + diff --git a/resources/views/surveyor/components/tanah.blade.php b/resources/views/surveyor/components/tanah.blade.php index aee7a97..12d759d 100644 --- a/resources/views/surveyor/components/tanah.blade.php +++ b/resources/views/surveyor/components/tanah.blade.php @@ -1,238 +1,5 @@ -
-
-
-

Order Penilaian

-
-
-
- -
- @if (isset($permohonan->tujuanPenilaian)) -

{{ $permohonan->tujuanPenilaian->name }}

- @endif -
-
-
- -
-

{{ $permohonan->created_at->format('d/m/Y') }}

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

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

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

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

- @endif -
-
-
- -
- -
-
- - -
-
- - -
-
-
- - -
- -
-
-

Nama Cadeb/Debitur

-
- -
-
- -
- @if (isset($permohonan->debiture)) -

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

- @endif -
-
-
-
-
- - -
-
-
-

Deskripsi Aset jaminan

-
- -
-
- -
-
- @if (isset($permohonan->debiture->documents)) - @foreach ($permohonan->debiture->documents as $item) -

{{ $item->jenisJaminan->name }}

- @endforeach - @endif -
-
- - - - - - -
-
-
- -
- -
- - @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 - -
-
- - - - -
-
- -
-
-
-
-
- - -
-
-
-

Titik Koordinat Google Maps

-
-
- -
-
- - - -
-
-
-
-
- -
-
- -
-
-

Status Kepemilikan

-
-
- - -
-
-

Izin Bangunan

-
-
- - -
-
-

SPPT PBB

-
-
- -
-
-

Dokument Lainnya

-
-
- - -
-
-

Hubungan cadeb/debitur dengan Pemilik Jaminan

-
-
- -
-
-

Hubungan Cadeb/Debitur dengan Penghuni Jaminan

-
-
- -
-
+@include('lpj::surveyor.components.header')
@@ -255,26 +22,25 @@

{{ $luas_tanah }} m2

@endforeach @endif -
-
- - - +
+
+
+ + + +
+
- - @error('luas') - {{ $message }} - @enderror
@@ -282,22 +48,22 @@
-
+
-
- - @error('hadap_mata_angin_tidak_sesuai') - {{ $message }} - @enderror +
@@ -322,13 +85,15 @@
-
+
@if (isset($bentukTanah)) @foreach ($bentukTanah as $item) @if (strcasecmp($item->name, 'lainnya') == 0) @@ -338,25 +103,23 @@ value="{{ $item->name }}" /> {{ $item->name }} - +
@endif @endforeach - @endif -
- @error('bentuk_tanah') - {{ $message }} - @enderror +
-
+
@if (isset($konturTanah)) @@ -369,9 +132,7 @@ @endforeach @endif
- @error('kontur_tanah') - {{ $message }} - @enderror +
@@ -379,7 +140,7 @@
-
+
@@ -393,9 +154,7 @@ @endforeach @endif
- @error('ketinggian_jalan') - {{ $message }} - @enderror +
@@ -416,17 +175,14 @@ Rata
- - @error('kontur_jalan') - {{ $message }} - @enderror +
-
+
@if (isset($posisiKavling)) @foreach ($posisiKavling as $item) @@ -442,17 +198,14 @@ value="{{ $item->name }}" /> {{ $item->name }} -
@endif @endforeach @endif -
- @error('posisi_kavling') - {{ $message }} - @enderror +
@@ -460,7 +213,7 @@
-
+
- - @error('tusuk_sate') - {{ $message }} - @enderror +
-
+
- @error('lockland') - {{ $message }} - @enderror +
@@ -506,7 +254,7 @@
-
+
@if (isset($kondisiFisikTanah)) @@ -530,9 +278,7 @@ @endforeach @endif
- @error('kondisi_fisik_tanah') - {{ $message }} - @enderror +
@@ -557,16 +303,9 @@ } - function toggleTidakSesuai(params) { - const inputData = document.querySelector(`input[name="${params}"]:checked`); - const luasTanah = document.getElementById('luas_tanah'); - if (inputData && inputData.value === 'tidak sesuai') { - luasTanah.style.display = 'block'; - } else { - luasTanah.style.display = 'none'; - } - } + + function toggleJenisAsset(params) { From d0390d3f9f0f15b6532f4f5de56b808e8efb48b7 Mon Sep 17 00:00:00 2001 From: majid76 Date: Tue, 12 Nov 2024 07:13:33 +0700 Subject: [PATCH 5/7] update form inspeksi menggunakan json --- app/Http/Controllers/SurveyorController.php | 146 +++++++++++++----- app/Http/Requests/FormSurveyorRequest.php | 9 +- app/Models/Inspeksi.php | 23 +++ ...024_11_11_153532_create_inspeksi_table.php | 42 +++++ .../surveyor/components/inspeksi.blade.php | 27 ++-- 5 files changed, 194 insertions(+), 53 deletions(-) create mode 100644 app/Models/Inspeksi.php create mode 100644 database/migrations/2024_11_11_153532_create_inspeksi_table.php diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 9368e1d..5a400ee 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -34,8 +34,9 @@ use Modules\Lpj\Models\Denah; use Modules\Lpj\Models\FotoJaminan; use Modules\Lpj\Models\Lingkungan; use Modules\Lpj\Models\LantaiUnit; -use Modules\Lpj\Models\Lantai; use Modules\Lpj\Models\Teams; +use Modules\Lpj\Models\Lantai; +use Modules\Lpj\Models\Inspeksi; use Modules\Lpj\Models\ViewUnit; use Modules\Lpj\Models\ObjekJaminan; use Modules\Lpj\Models\RuteJaminan; @@ -156,48 +157,117 @@ class SurveyorController extends Controller $data = $request->validated(); if ($data) { try { + + $formatTanahJson =[ + 'debitur_perwakilan' => $data['debitur_perwakilan'] ?? [], + 'jenis_asset' => $data['jenis_asset'] ?? null, + 'jenis_asset_tidak_sesuai' => $data['jenis_asset_tidak_sesuai'] ?? null, + 'alamat_sesuai' => $data['alamat_sesuai'] ?? null, + 'alamat_tidak_sesuai' => $data['alamat_tidak_sesuai'] ?? null, + 'nama_jalan' => $data['nama_jalan'] ?? null, + 'desa_kelurahan' => $data['desa_kelurahan'] ?? null, + 'kecamatan' => $data['kecamatan'] ?? null, + 'kota_kabupaten' => $data['kota_kabupaten'] ?? null, + 'provinsi' => $data['provinsi'] ?? null, + 'kordinat_lng' => $data['kordinat_lng'] ?? null, + 'kordinat_lat' => $data['kordinat_lat'] ?? null, + 'luas_tanah' => $data['luas_tanah'] ?? null, + 'luas_tanah_tidak_sesuai' => $data['luas_tanah_tidak_sesuai'] ?? null, + 'hadap_mata_angin' => $data['hadap_mata_angin'] ?? null, + 'hadap_mata_angin_tidak_sesuai' => $data['hadap_mata_angin_tidak_sesuai'] ?? null, + 'bentuk_tanah' => $data['bentuk_tanah'] ?? null, + 'bentuk_tanah_lainnya' => $data['bentuk_tanah_lainnya'] ?? null, + 'kontur_tanah' => $data['kontur_tanah'] ?? [], + 'ketinggian_tanah' => $data['ketinggian_tanah'] ?? [], + 'ketinggian_tanah_tidak_sesuai' => $data['ketinggian_tanah_tidak_sesuai'] ?? [], + 'posisi_kavling' => $data['posisi_kavling'] ?? [], + 'posisi_kavling_lainnya' => $data['posisi_kavling_lainnya'] ?? null, + 'tusuk_sate' => $data['tusuk_sate'] ?? null, + 'lockland' => $data['lockland'] ?? null, + 'kondisi_fisik_tanah' => $data['kondisi_fisik_tanah'] ?? [], + 'kondisi_fisik_tanah_lainnya' => $data['kondisi_fisik_tanah_lainnya'] ?? null, + ]; + + + $formatBangunanJson =[ + 'luas_tanah_bangunan' => $data['luas_tanah_bangunan'] ?? null, + 'jenis_bangunan' => $data['jenis_bangunan'] ?? null, + 'kondisi_bangunan' => $data['kondisi_bangunan'] ?? null, + 'sifat_bangunan' => $data['sifat_bangunan'] ?? null, + 'sifat_bangunan_input' => $data['sifat_bagunan_input'] ?? null, + 'spek_kategori_bagunan' => $data['spek_kategori_bagunan'] ?? null, + 'spek_bangunan' => $data['spek_bangunan'] ?? null, + 'sarana_pelengkap' => $data['sarana_pelengkap'] ?? [], + 'sarana_pelengkap_input' => $data['sarana_pelengkap_input'] ?? null, + ]; + + + $formatLingkunganJson =[ + 'jarak_jalan_utama' => $data['jarak_jalan_utama'] ?? null, + 'jalan_linkungan' => $data['jalan_linkungan'] ?? null, + 'jarak_cbd_point' => $data['jarak_cbd_point'] ?? null, + 'nama_cbd_point' => $data['nama_cbd_point'] ?? null, + 'lebar_perkerasan_jalan' => $data['lebar_perkerasan_jalan'] ?? null, + 'perkerasan_jalan' => $data['perkerasan_jalan'] ?? null, + 'lalu_lintas' => $data['lalu_lintas'] ?? null, + 'gol_mas_sekitar' => $data['gol_mas_sekitar'] ?? null, + 'tingkat_keramaian' => $data['tingkat_keramaian'] ?? null, + 'terletak_diarea' => $data['terletak_diarea'] ?? null, + 'disekitar_lokasi' => $data['disekitar_lokasi'] ?? null, + 'kondisi_bangunan_sekitar' => $data['kondisi_bangunan_sekitar'] ?? null, + 'sifat_bangunan_sekitar' => $data['sifat_bangunan_sekitar'] ?? null, + 'dekat_makam' => $data['dekat_makam'] ?? null, + 'jarak_makam' => $data['jarak_makam'] ?? null, + 'nama_makam' => $data['nama_makam'] ?? null, + 'dekat_tps' => $data['dekat_tps'] ?? null, + 'jarak_tps' => $data['jarak_tps'] ?? null, + 'nama_tps' => $data['nama_tps'] ?? null, + 'merupkan_daerah' => $data['merupkan_daerah'] ?? null, + 'fasilitas_dekat_object' => $data['fasilitas_dekat_object'] ?? null, + + ]; + + + $formatFaktaJson =[ + 'fakta_positif' => $data['fakta_positif'] ?? null, + 'fakta_negatif' => $data['fakta_negatif'] ?? null, + 'rute_menuju' => $data['rute_menuju'] ?? null, + 'batas_batas' => $data['batas_batas'] ?? null, + 'kondisi_lingkungan' => $data['kondisi_lingkungan'] ?? null, + 'kondisi_lain_bangunan' => $data['kondisi_lain_bangunan'] ?? null, + 'informasi_dokument' => $data['informasi_dokument'] ?? null, + 'peruntukan' => $data['peruntukan'] ?? null, + 'kdb' => $data['kdb'] ?? null, + 'kdh' => $data['kdh'] ?? null, + 'gsb' => $data['gsb'] ?? null, + 'max_lantai' => $data['max_lantai'] ?? null, + 'klb' => $data['klb'] ?? null, + 'gss' => $data['gss'] ?? null, + 'pelebaran_jalan' => $data['pelebaran_jalan'] ?? null, + 'nama_petugas' => $data['nama_petugas'] ?? null, + 'lat' => $data['lat'] ?? null, + 'lng' => $data['lng'] ?? null, + 'foto_tempat' => $data['foto_tempat'] ?? null, + 'keterangan' => $data['keterangan'] ?? null, + ]; + + $mergeData = array_merge($formatTanahJson, $formatBangunanJson, $formatLingkunganJson, $formatFaktaJson); + + Inspeksi::create([ + 'permohonan_id' => $request->permohonan_id, + 'data_form' => json_encode($mergeData), + 'name' => $request->type, + + ]); + + return response()->json(['message' => 'Data berhasil disimpan', - 'data' => $data], 200); + 'data' => $mergeData], 200); } catch (Exception $e) { - return response()->json(['status' => 500, 'message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); + return response()->json(['message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); } } - - - // $validatedData = $request->validated(); - // DB::beginTransaction(); - // try { - // $analisa = Analisa::create($validatedData); - - // if ($analisa) { - // $validatedData['analisa_id'] = $analisa->id; - - // switch ($validatedData['action']) { - // case 'tanah_bangunan': - // $this->handleTanahBangunan($validatedData, $request); - // break; - // case 'unit': - // $this->handleUnit($validatedData); - // break; - // default: - // throw new \Exception('Invalid action type'); - // } - - // AnalisaLingkungan::create($validatedData); - // $validatedData['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), 'foto_tempat'); - // AnalisaFakta::create($validatedData); - // } - - // DB::commit(); - // return redirect()->route('surveyor.show', [ - // 'id' => $validatedData['permohonan_id'], - // 'form' => 'inspeksi' - // ])->with('success', 'Data form surveyor berhasil disimpan'); - // } catch (Exception $e) { - // DB::rollback(); - // return response()->json(['error' => 'Failed to save data', 'details' => $e->getMessage()], 500); - // } } private function handleTanahBangunan(array $validatedData, FormSurveyorRequest $request) diff --git a/app/Http/Requests/FormSurveyorRequest.php b/app/Http/Requests/FormSurveyorRequest.php index 6a25934..0a0e032 100644 --- a/app/Http/Requests/FormSurveyorRequest.php +++ b/app/Http/Requests/FormSurveyorRequest.php @@ -93,6 +93,7 @@ class FormSurveyorRequest extends FormRequest $assetDescriptionRules = $this->getAssetDescriptionRules(); return array_merge($assetDescriptionRules, [ + 'luas_tanah' => 'required', 'luas_tanah_tidak_sesuai' => 'nullable', 'hadap_mata_angin' => 'required', @@ -120,8 +121,8 @@ class FormSurveyorRequest extends FormRequest 'action' => 'required', 'luas_tanah_bagunan' => 'required', 'jenis_bangunan' => 'required', - 'kondisi_bangunan' => 'required', - 'sifat_bangunan' => 'required', + 'kondisi_bangunan' => 'nullable', + 'sifat_bangunan' => 'required|array', 'sifat_bangunan_input' => 'nullable|array', 'nama_bagunan' => 'required|array', 'spek_kategori_bangunan' => 'required|array', @@ -172,7 +173,7 @@ class FormSurveyorRequest extends FormRequest 'sifat_bangunan_sekitar' => 'nullable', 'dekat_makam' => 'nullable', 'jarak_makam' => 'nullable', - 'nama_tpu' => 'nullable', + 'nama_makam' => 'nullable', 'dekat_tps' => 'nullable', 'jarak_tps' => 'nullable', 'nama_tpu' => 'nullable', @@ -223,6 +224,8 @@ 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', diff --git a/app/Models/Inspeksi.php b/app/Models/Inspeksi.php new file mode 100644 index 0000000..16c3629 --- /dev/null +++ b/app/Models/Inspeksi.php @@ -0,0 +1,23 @@ +id(); + $table->string('name'); + $table->json('data_form')->nullable(); + $table->json('foto_form')->nullable(); + $table->json('denah_form')->nullable(); + $table->unsignedBigInteger('permohonan_id'); + $table->boolean('status')->default(true); + $table->char('authorized_status', 1)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + $table->softDeletes(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + + $table->foreign('permohonan_id')->references('id')->on('permohonan')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('inspeksi'); + } +}; diff --git a/resources/views/surveyor/components/inspeksi.blade.php b/resources/views/surveyor/components/inspeksi.blade.php index e00e617..dc21c0a 100644 --- a/resources/views/surveyor/components/inspeksi.blade.php +++ b/resources/views/surveyor/components/inspeksi.blade.php @@ -161,7 +161,7 @@ } } if ($analisaType === 'tanah') { - $analisaType = 'kendaraan'; + $analisaType = 'tanah_bangunan'; } if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') { @@ -227,8 +227,6 @@
- - @endsection @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 From 8e9e5e4843f4f6d64492a7a9d65236ae4c3315e9 Mon Sep 17 00:00:00 2001 From: majid76 Date: Wed, 13 Nov 2024 07:34:39 +0700 Subject: [PATCH 7/7] update form foto --- app/Http/Controllers/SurveyorController.php | 59 ++++++++++++++++++- .../views/surveyor/components/foto.blade.php | 21 +++---- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 537b3fb..3d68811 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -360,6 +360,14 @@ class SurveyorController extends Controller 'lantai.*' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', 'name_lantai_unit.*' => 'nullable|string|max:255', 'foto_lantai_unit.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'name_rute_lainnya.*' => 'nullable|string', + 'foto_rute_lainnya.*' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'foto_lantai_lainnya.*' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'name_lantai_lainnya.*' => 'nullable|string|max:255', + 'foto_basement.*' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'name_basement.*' => 'nullable|string|max:255', + 'foto_gerbang' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', + 'name_gerbang' => 'nullable|string|max:255', ]); // DB::beginTransaction(); @@ -369,6 +377,9 @@ class SurveyorController extends Controller $rute_menuju_lokasi = []; $object_jaminan = []; $lingkungan = []; + $foto_lantai_unit = []; + $foto_lantai_lainnya = []; + $foto_rute_lainnya = []; foreach ($request->file('foto_rute', []) as $key => $value) { @@ -398,15 +409,61 @@ class SurveyorController extends Controller ]; } + foreach ($request->file('foto_lantai_unit', []) as $key => $value) { + $foto_lantai_unit_Path = $this->uploadFile($request->file('foto_lantai_unit.' . $key), 'foto_lantai_unit.' . $key); + $foto_lantai_unit[] = [ + 'name_lantai_unit' => $request->input('name_lantai_unit.' . $key), + 'foto_lantai_unit' => $foto_lantai_unit_Path, + + ]; + } + + foreach ($request->file('foto_rute_lainnya', []) as $key => $value) { + $foto_rute_lainnya_path = $this->uploadFile($request->file('foto_rute_lainnya.' . $key), 'foto_rute_lainnya.' . $key); + $foto_rute_lainnya[] = [ + 'name_rute_lainnya' => $request->input('name_rute_lainnya.' . $key), + 'foto_rute_lainnya' => $foto_rute_lainnya_path, + + ]; + } + + + foreach ($request->file('foto_lantai_lainnya', []) as $key => $value) { + $foto_lantai_lainnya_path = $this->uploadFile($request->file('foto_lantai_lainnya.' . $key), 'foto_lantai_lainnya.' . $key); + $foto_lantai_lainnya[] = [ + 'name_lantai_lainnya' => $request->input('name_lantai_lainnya.' . $key), + 'foto_lantai_lainnya' => $foto_lantai_lainnya_path, + + ]; + } + + + $basement = $this->uploadFile($request->file('foto_basement'), 'foto_basement'); + $gerbang = $this->uploadFile($request->file('foto_gerbang'), 'foto_gerbang'); $formatFotojson = [ 'rute_menuju_lokasi' => $rute_menuju_lokasi, 'object_jaminan' => $object_jaminan, 'lingkungan' => $lingkungan + ,'foto_lantai_unit' => $foto_lantai_unit, + 'foto_lantai_lainnya' => $foto_lantai_lainnya, + 'foto_rute_lainnya' => $foto_rute_lainnya, + 'basement' => $basement, + 'gerbang' => $gerbang ]; + $inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))->first(); + if($request->input('permohonan_id') == $inspeksi->permohonan_id){ + $inspeksi->update([ + 'foto_form' => json_encode($formatFotojson) + ]); + }else { - + Inspeksi::create([ + 'permohonan_id' => $request->input('permohonan_id'), + 'foto_form' => json_encode($formatFotojson) + ]); + } // DB::commit(); diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 1f502c4..d51f5ea 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -175,10 +175,7 @@
@endforeach @else - {{-- Foto Argis Region --}} +
@@ -188,8 +185,8 @@
- + {{-- --}} @@ -220,9 +217,9 @@
- - + + {{-- --}} @@ -394,8 +391,8 @@ Basement
- - +