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/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 0c936a0..3d68811 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -34,7 +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\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; @@ -121,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( @@ -151,38 +155,123 @@ class SurveyorController extends Controller */ public function store(FormSurveyorRequest $request) { - $validatedData = $request->validated(); - DB::beginTransaction(); - try { - $analisa = Analisa::create($validatedData); - if ($analisa) { - $validatedData['analisa_id'] = $analisa->id; + $data = $request->validated(); + if ($data) { + try { - 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); + + $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, + 'merupakan_daerah' => $data['merupakan_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_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, + ]; + + $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(['success' => true, 'message' => 'Data berhasil disimpan', + 'data' => $mergeData], 200); + } catch (Exception $e) { + + return response()->json(['success' => false, 'message' => 'Data gagal disimpan: ' . $e->getMessage()], 500); } - - 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); } } @@ -271,31 +360,117 @@ 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(); + // 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 = []; + $foto_lantai_unit = []; + $foto_lantai_lainnya = []; + $foto_rute_lainnya = []; - $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, + + ]; + } + + 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(); + + 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); } } @@ -518,8 +693,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'); }); @@ -544,7 +720,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); @@ -567,8 +743,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,7 +782,9 @@ class SurveyorController extends Controller ->where('jenis_jaminan_id', $jaminanId) ->first(); - // return response()->json($permohonan); + + $inpeksi = Inspeksi::where('permohonan_id', $id)->get(); + $forminspeksi = json_decode($inpeksi[0]->data_form, true); return view('lpj::surveyor.components.inspeksi', compact( @@ -626,7 +810,9 @@ class SurveyorController extends Controller 'golMasySekitar', 'tingkatKeramaian', 'laluLintasLokasi', - 'perkerasanJalan' + 'perkerasanJalan', + 'link_url_region', + 'forminspeksi' )); } @@ -654,7 +840,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')); } @@ -740,11 +929,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()); } } } @@ -779,6 +966,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/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..e003a36 100644 --- a/app/Http/Requests/FormSurveyorRequest.php +++ b/app/Http/Requests/FormSurveyorRequest.php @@ -19,10 +19,11 @@ class FormSurveyorRequest extends FormRequest */ public function rules(): array { - $commonRules = $this->getCommonRules(); + $commonRules = $this->getBangunanRules(); $actionSpecificRules = $this->getActionSpecificRules(); return array_merge($commonRules, $actionSpecificRules); + return $actionSpecificRules; } /** @@ -31,44 +32,29 @@ class FormSurveyorRequest extends FormRequest private function getCommonRules(): array { return [ - 'jenis_jaminan_id' => 'required', - 'type' => 'required', - 'permohonan_id' => 'required', - 'luas' => 'required', - 'jarak_jalan_utama' => 'required', - 'alamat' => 'required', - 'jarak_cbd_point' => 'required', - 'lebar_perkerasan_jalan' => 'required', - 'perkerasan_jalan' => 'required', - 'lalu_lintas' => 'required', - 'gol_mas_sekitar' => 'required', - 'tingkat_keramaian' => 'required', - 'terletak_diarea' => 'required', - 'disekitar_lokasi' => 'required', - 'dekat_makam' => 'required', - 'dekat_tps' => 'required', - 'merupakan_daerah' => 'required', - 'fasilitas_dekat_object' => 'required', - 'fakta_positif' => 'required', - 'fakta_negatif' => 'required', - 'rute_menuju' => 'required', - 'batas_batas' => 'required', - 'kondisi_linkungan' => 'required', - 'kondisi_lain_bangunan' => 'required', - 'informasi_dokument' => 'required', - 'peruntukan' => 'required', - 'kdb' => 'required', - 'kdh' => 'required', - 'gsb' => 'required', - 'max_lantai' => 'required', - 'klb' => 'required', - 'gss' => 'required', - 'pelebaran_jalan' => 'required', - 'nama_petugas' => 'required', - 'lat' => 'required|numeric', - 'lng' => 'required|numeric', - 'foto_tempat' => 'required', - 'keterangan' => 'required', + 'fakta_positif' => 'nullable|array', + 'fakta_negatif' => 'nullable|array', + 'rute_menuju' => 'nullable', + 'batas_batas' => 'nullable|array', + 'kondisi_linkungan' => 'nullable|array', + 'kondisi_lain_bangunan' => 'nullable|array', + 'informasi_dokument' => 'nullable', + 'peruntukan' => 'nullable', + 'kdb' => 'nullable', + 'kdh' => 'nullable', + 'gsb' => 'nullable', + 'max_lantai' => 'nullable', + 'klb' => 'nullable', + 'gss' => 'nullable', + 'pelebaran_jalan' => 'nullable', + 'nama_petugas' => 'nullable', + 'lat' => 'nullable|numeric', + 'lng' => 'nullable|numeric', + 'foto_gistaru' => 'nullable', + 'foto_bhumi' => 'nullable', + 'foto_argis_region' => 'nullable', + 'foto_tempat' => 'nullable', + 'keterangan' => 'nullable', ]; } @@ -80,54 +66,181 @@ class FormSurveyorRequest extends FormRequest $action = $this->input('action'); switch ($action) { - case 'tanah_bangunan': - return $this->getTanahBangunanRules(); + case 'tanah': + return $this->getTanahRules(); case 'unit': return $this->getUnitRules(); + case 'kapal': + return $this->getUnitRules(); + case 'kendaraan': + return $this->getUnitRules(); + case 'mesin': + return $this->getUnitRules(); + case 'bangunan': + return $this->getTanahBangunanRules(); + case 'tanah_bangunan': + return array_merge($this->getAssetDescriptionRules(),$this->getTanahRules(), $this->getBangunanRules(), $this->getLinkunganRules(), $this->getCommonRules()); + + case 'alat-berat': + return $this->getUnitRules(); default: return []; } } /** - * Get rules specific to tanah_bangunan action. + * Get rules specific to tanah action. */ - private function getTanahBangunanRules(): array + + public function getTanahRules(): array { - return [ - 'action' => 'required', - 'bentuk_tanah' => 'required', - 'kontur_tanah' => 'required', - 'posisi_kavling' => 'required', - 'ketinggian_jalan' => 'required', - 'kondisi_fisik_tanah' => 'required', + return [ + 'luas_tanah' => 'required', + 'luas_tanah_tidak_sesuai' => 'nullable', + 'hadap_mata_angin' => 'required', + 'hadap_mata_angin_tidak_sesuai' => 'nullable', + 'bentuk_tanah' => 'nullable|array', + 'bentuk_tanah_lainnya' => 'nullable', + 'kontur_tanah' => 'required|array', + 'ketinggian_jalan' => 'required|array', 'kontur_jalan' => 'required', - 'kondisi_bangunan' => 'required', - 'sifat_bangunan' => 'required', - 'sarana_pelengkap' => 'required', - 'luas_tanah_bagunan' => 'required', + 'posisi_kavling' => 'required|array', + 'posisi_kavling_lainnya' => 'nullable', 'tusuk_sate' => 'required', - 'name.*' => 'required|string', - 'kategori.*' => 'required|string', 'lockland' => 'required', - 'jenis_bangunan' => 'required', - 'kondisi_bangunan' => 'required', + 'kondisi_fisik_tanah' => 'required|array', ]; } /** + * Get rules specific to Bangunan action. + */ + + private function getBangunanRules(): array + { + return [ + 'action' => 'required', + 'luas_tanah_bagunan' => 'required', + 'jenis_bangunan' => 'required', + 'kondisi_bangunan' => 'nullable', + 'sifat_bangunan' => 'required|array', + 'sifat_bangunan_input' => 'nullable|array', + 'nama_bagunan' => 'required|array', + 'spek_kategori_bangunan' => 'required|array', + 'spek_kategori_bangunan.*' => 'required|string', + 'sarana_pelengkap' => 'required', + 'sarana_pelengkap_input' => 'nullable|array', + ]; + } + + /** * Get rules specific to unit action. */ private function getUnitRules(): array { - return [ + return [ 'action' => 'required', - 'jenis_unit' => 'required', - 'kondisi_unit' => 'required', - 'posisi_unit' => 'required', - 'lantai' => 'required', - 'view' => 'required', - 'bentuk_unit' => 'required', + 'luas_unit' => 'required', + 'luas_unit_tidak_sesuai' => 'nullable', + 'jenis_unit' => 'required|array', + 'kondisi_unit' => 'required|array', + 'posisi_unit' => 'required|array', + 'lantai' => 'required|array', + 'view' => 'required|array', + 'bentuk_unit' => 'required|array', ]; } + + /** + * Get rules specific to Linkungan action. + */ + + private function getLinkunganRules(): array + { + return [ + 'action' => 'required', + 'jarak_jalan_utama' => 'nullable', + 'jalan_linkungan' => 'nullable', + 'jarak_cbd_point' => 'nullable', + 'nama_cbd_point' => 'nullable', + 'lebar_perkerasan_jalan' => 'nullable', + 'perkerasan_jalan' => 'nullable', + 'lalu_lintas' => 'nullable', + 'gol_mas_sekitar' => 'nullable', + 'tingkat_keramaian' => 'nullable', + 'terletak_diarea' => 'nullable', + 'disekitar_lokasi' => 'nullable', + 'kondisi_bangunan_sekitar' => 'nullable', + 'sifat_bangunan_sekitar' => 'nullable', + 'dekat_makam' => 'nullable', + 'jarak_makam' => 'nullable', + 'nama_makam' => 'nullable', + 'dekat_tps' => 'nullable', + 'jarak_tps' => 'nullable', + 'nama_tpu' => 'nullable', + 'merupakan_daerah' => 'nullable', + 'fasilitas_dekat_object' => 'nullable', + ]; + } + + 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', + ]; + } + + + private function getAssetDescriptionRules(): array +{ + return [ + 'permohonan_id' => 'required', + 'type' => 'required', + 'debitur_perwakilan' => 'required|array', + 'jenis_asset' => 'required', + 'jenis_asset_tidak_sesuai' => 'nullable', + 'alamat_sesuai' => 'required', + 'alamat_tidak_sesuai' => 'nullable', + 'nama_jalan' => 'nullable', + 'desa_kelurahan' => 'nullable', + 'kecamatan' => 'nullable', + 'kota_kabupaten' => 'nullable', + 'provinsi' => 'nullable', + 'kordinat_lng' => 'nullable', + 'kordinat_lat' => 'nullable', + ]; +} + + } diff --git a/app/Http/Requests/PenilaianRequest.php b/app/Http/Requests/PenilaianRequest.php index a3c1db0..99e979a 100644 --- a/app/Http/Requests/PenilaianRequest.php +++ b/app/Http/Requests/PenilaianRequest.php @@ -25,15 +25,12 @@ class PenilaianRequest extends FormRequest ]; } - - return [ 'jenis_penilaian_id' => 'required|max:255', 'teams_id' => 'required|max:255', '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/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/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 @@ +hasMany(Penilaian::class, 'penilaian_id', 'id'); + return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id'); } protected static function newFactory(): PenilaianTeamFactory 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_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/database/migrations/2024_11_11_153532_create_inspeksi_table.php b/database/migrations/2024_11_11_153532_create_inspeksi_table.php new file mode 100644 index 0000000..e291dd2 --- /dev/null +++ b/database/migrations/2024_11_11_153532_create_inspeksi_table.php @@ -0,0 +1,42 @@ +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/database/migrations/2024_11_13_101804_create_penilaian_team_table.php b/database/migrations/2024_11_13_101804_create_penilaian_team_table.php new file mode 100644 index 0000000..30005af --- /dev/null +++ b/database/migrations/2024_11_13_101804_create_penilaian_team_table.php @@ -0,0 +1,38 @@ +id(); + $table->unsignedBigInteger('penilaian_id'); + $table->unsignedBigInteger('team_id'); + $table->unsignedBigInteger('user_id')->nullable(); + $table->string('role'); + $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(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('penilaian_team'); + } + }; diff --git a/module.json b/module.json index be26736..406f42d 100644 --- a/module.json +++ b/module.json @@ -559,6 +559,14 @@ "attributes": [], "permission": "", "roles": ["administrator","surveyor"] + }, + { + "title": "Perkerasan jalan", + "path": "basicdata.perkerasan-jalan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["administrator","surveyor"] } 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 @@ + 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/apartemen-kantor.blade.php b/resources/views/surveyor/components/apartemen-kantor.blade.php index 28cb7e8..40d53a9 100644 --- a/resources/views/surveyor/components/apartemen-kantor.blade.php +++ b/resources/views/surveyor/components/apartemen-kantor.blade.php @@ -1,4 +1,11 @@ -
+ + +@include('lpj::surveyor.components.header') + +
+
+ +

Analisa Unit

@@ -31,44 +38,40 @@
- + {{ $item->name }} + + @endforeach @endif - - - @error('jenis_unit') - {{ $message }} - @enderror +
+ +
- + {{ $item->name }} + + @endforeach @endif - - - @error('kondisi_unit') - {{ $message }} - @enderror +
+ +
@@ -77,20 +80,20 @@
- + {{ $item->name }} + @endforeach @endif - - - @error('posisi_unit') - {{ $message }} - @enderror +
+ +
@@ -100,20 +103,21 @@
- + {{ $item->name }} + @endforeach @endif - - - @error('lantai') - {{ $message }} - @enderror +
+ +
@@ -122,41 +126,42 @@
- + {{ $item->name }} + @endforeach @endif - - - @error('view') - {{ $message }} - @enderror +
+ +
- + {{ $item->name }} + @endforeach @endif - - - @error('bentuk_unit') - {{ $message }} - @enderror +
+ +
+ diff --git a/resources/views/surveyor/components/bangunan.blade.php b/resources/views/surveyor/components/bangunan.blade.php index 524aace..d82bee0 100644 --- a/resources/views/surveyor/components/bangunan.blade.php +++ b/resources/views/surveyor/components/bangunan.blade.php @@ -1,181 +1,195 @@ -{{-- @if ($analisaType == 'tanah_bangunan') --}} -
-
-

Analisa Bangunan

-
-
-
- -
-
- - -
- - @error('luas_tanah_bagunan') - {{ $message }} - @enderror -
+
+
+
+

Analisa Bangunan

- - - -
- -
- - - @error('jenis_bangunan') - {{ $message }} - @enderror -
-
- - -
- -
- - - @error('kondisi_bangunan') - {{ $message }} - @enderror -
-
- - -
- -
- - - @error('sifat_bangunan') - {{ $message }} - @enderror -
-
- - -
+
- + +
+
+ + +
+ +
+
-
-
- -
- @if (@isset($spekKategoriBagunan)) - @foreach ($spekKategoriBagunan as $item) -
- -
- - @error('name') - {{ $message }} - @enderror -
+ +
+ +
+
+ @if (isset($jenisBangunan)) + @foreach ($jenisBangunan as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ + +
+ @endif + @endforeach + @endif +
+ + + +
+
+ + +
+ +
+
+ @if (isset($kondisiBangunan)) + @foreach ($kondisiBangunan as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ +
- @endforeach - @endif + @endif + @endforeach + @endif +
+ +
+
+ + +
+ +
+
+ @if (isset($sifatBangunan)) + @foreach ($sifatBangunan as $item) +
+ + +
+ @endforeach + @endif +
+ +
+
+ + + + +
+
+ +
+
+ +
+ @if (@isset($spekKategoriBagunan)) + @foreach ($spekKategoriBagunan as $item) +
+ + +
+
+ @foreach ($spekBangunan as $spek) + @if ($spek->spek_kategori_bangunan_id == $item->id) + + @endif + @endforeach +
+ + +
+
+ @endforeach + @endif +
+
-
+ +
+ +
-
- + + +
+ +
+
+ @if (isset($saranaPelengkap)) + @foreach ($saranaPelengkap as $item) +
+ + +
+ @endforeach + @endif +
+ +
-
- - -
- -
- - - @error('sarana_pelengkap') - {{ $message }} - @enderror -
-
-
-
-{{-- @endif --}} - @push('scripts') diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 0293a06..d51f5ea 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -5,7 +5,6 @@ @endsection --}} @section('content') -
@@ -20,211 +19,353 @@
- @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 + + +
+
+ + +
+ + {{-- --}} + + +
+ +
+ @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 }} @@ -462,61 +472,99 @@ {{ $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 +
+
+
+ + +
+ +
+ + + {{-- +
+
--}}
- diff --git a/resources/views/surveyor/components/lingkungan.blade.php b/resources/views/surveyor/components/lingkungan.blade.php new file mode 100644 index 0000000..c66fcf3 --- /dev/null +++ b/resources/views/surveyor/components/lingkungan.blade.php @@ -0,0 +1,308 @@ +
+ +
+ + +
+

Analisis Lingkungan

+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+ +
+
+ @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 +
+ +
+
+ + +
+ +
+
+ @if (isset($tingkatKeramaian)) + @foreach ($tingkatKeramaian as $item) + + @endforeach + @endif +
+ +
+
+ + +
+ +
+
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+ +
+
+ +
+ +
+
+
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ @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 +
+ +
+
+ +
+
+
+ + +@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..c47792e 100644 --- a/resources/views/surveyor/components/tanah.blade.php +++ b/resources/views/surveyor/components/tanah.blade.php @@ -1,248 +1,371 @@ -
-
-

Analisa Tanah

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

Analisa Tanah

- - -
- -
- - - @error('hadapMataAngin') - {{ $message }} - @enderror +
+
+
+ + + +
+ +
+
+
-
- -
- -
- + Sesuai + + + + + + - - @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 -
-
- - - -
- -
-
- - + +
+ +
+
+ @if (isset($bentukTanah)) + @foreach ($bentukTanah as $item) + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ + +
+ @else + + @endif + @endforeach + @endif +
+
- - @error('tusuk_sate') - {{ $message }} - @enderror
-
- -
- -
-
- - + + +
+ +
+ +
+ @if (isset($konturTanah)) + @foreach ($konturTanah as $item) + + @endforeach + @endif +
+
- @error('lockland') - {{ $message }} - @enderror
-
- -
- -
- - @error('kondisi_fisik_tanah') - {{ $message }} - @enderror + +
+ +
+ + +
+ @if (isset($ketinggianTanah)) + @foreach ($ketinggianTanah as $item) + + @endforeach + @endif +
+ +
+
+ + + +
+ +
+
+ + +
+ +
+
+ +
+ +
+
+ @if (isset($posisiKavling)) + @foreach ($posisiKavling as $item) + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ + +
+ @endif + @endforeach + @endif +
+ +
+
+ + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + + +
+ +
+
+ @if (isset($kondisiFisikTanah)) + @foreach ($kondisiFisikTanah as $item) + + + + @if (strcasecmp($item->name, 'lainnya') == 0) +
+ +
+ @endif + @endforeach + @endif +
+ +
+ +@push('scripts') + +@endpush 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 diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 4d80059..370ecc3 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -459,6 +459,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) {