diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php index 1137f65..0f6d8c1 100644 --- a/app/Helpers/Lpj.php +++ b/app/Helpers/Lpj.php @@ -287,14 +287,26 @@ function holidays() function countPermohonanForUser($userId) { - return Penilaian::whereHas('userPenilai', function ($query) use ($userId) { + $validStatuses = ['assign', 'proses-laporan', 'done']; + + $result = Penilaian::whereHas('userPenilai', function ($query) use ($userId) { $query->where('user_id', $userId); }) - ->whereHas('permohonan', function ($query) { - $query->where('status', 'assign'); - }) - ->count(); + ->whereHas('permohonan', function ($query) use ($validStatuses) { + $query->whereIn('status', $validStatuses); + }) + ->get() + ->groupBy(function ($item) { + // Pastikan mengakses properti dari model yang valid + return $item->userPenilai->first()->user_id . '-' . $item->permohonan->id; + }) + ->map(function ($group) { + return [ + 'statuses' => $group->pluck('permohonan.status')->unique()->values()->all(), + ]; + }); + return $result->count(); } diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index d1df552..27e5c8a 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -250,8 +250,9 @@ class ActivityController extends Controller ]) ->whereHas('userPenilai', function ($q) use ($id) { $q->where('user_id', $id); - })->whereHas('permohonan', function ($q) { - $q->where('status', 'assign'); + }) + ->whereHas('permohonan', function ($q) { + $q->whereIn('status', ['assign', 'proses-laporan', 'done']); }); diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index ef8f9ff..0aa1d1c 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -22,7 +22,6 @@ use Illuminate\Support\Facades\App; use App\Helpers\Lpj; use Modules\Lpj\Http\Requests\FormSurveyorRequest; - class PenilaiController extends Controller { public $user; @@ -68,13 +67,7 @@ class PenilaiController extends Controller return view('lpj::create'); } - /** - * Store a newly created resource in storage. - */ - public function store(Request $request) - { - // - } + public function sederhana(Request $request, $id) { @@ -143,46 +136,48 @@ class PenilaiController extends Controller if ($resume) { $resumeData = json_decode($resume->resume, true); } + $forminspeksi = null; - return view('lpj::penilai.components.resume', compact('permohonan', 'resumeData')); + if ($inspeksi) { + $forminspeksi = json_decode($inspeksi->data_form, true); + } + + return view('lpj::penilai.components.resume', compact('permohonan', 'resumeData','forminspeksi')); } public function memo(Request $request) { - $permohonanId = $request->query('permohonanId'); - $documentId = $request->query('documentId'); - $inspeksiId = $request->query('inspeksiId'); - $jaminanId = $request->query('jaminanId'); + $req = $this->getRequestQueryId($request); - $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); - $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); - $penilai = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); + $data = $this->getDataPermohonanWithPenilaiAndInspeksi($req['permohonanId'], $req['documentId'], $req['jaminanId']); + $permohonan = $data['permohonan']; + + $inspeksi = Inspeksi::where('permohonan_id', $req['permohonanId'])->where('dokument_id', $req['documentId'])->first(); + $penilai = Penilai::where('permohonan_id', $req['permohonanId'])->where('dokument_id', $req['documentId'])->firstska(); $provinces = Province::all(); $basicData = $this->surveyorController->getCommonData(); - $formFoto = $formPeta = $cities = $districts = $villages= $memo = null; + $formFoto = $formPeta = $cities = $districts = $villages = $memo = null; if ($inspeksi) { $formFoto = json_decode($inspeksi->foto_form, true); $formPeta = json_decode($inspeksi->data_form, true); - if(isset($penilai->memo)) { + if (isset($penilai->memo)) { $memo = json_decode($penilai->memo); } - if(isset($memo->lokasi->province_code)){ + if (isset($memo->lokasi->province_code)) { $cities = City::where('province_code', $memo->lokasi->province_code)->get(); } - if(isset($memo->lokasi->city_code)){ + if (isset($memo->lokasi->city_code)) { $districts = District::where('city_code', $memo->lokasi->city_code)->get(); } - if(isset($memo->lokasi->district_code)) { + if (isset($memo->lokasi->district_code)) { $villages = Village::where('district_code', $memo->lokasi->district_code)->get(); } } - - - return view('lpj::penilai.components.memo', compact('permohonan', 'formFoto', 'formPeta', 'provinces', 'basicData','memo','cities', 'districts', 'villages')); + return view('lpj::penilai.components.memo', compact('permohonan', 'formFoto', 'formPeta', 'provinces', 'basicData', 'memo', 'cities', 'districts', 'villages')); } @@ -193,6 +188,7 @@ class PenilaiController extends Controller { $permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian', 'documents.inspeksi'])->find($id); + // return response()->json(['permohonan' => $permohonan]); return view('lpj::penilai.show', compact('permohonan')); } @@ -231,8 +227,26 @@ class PenilaiController extends Controller public function rap(Request $request) { + $permohonanId = $request->query('permohonanId'); - return view('lpj::penilai.components.paparan'); + $documentId = $request->query('documentId'); + $inspeksiId = $request->query('inspeksiId'); + $jaminanId = $request->query('jaminanId'); + $provinces = Province::all(); + $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); + $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); + + + $resume = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); + $lpjData = null; + $rap = null; + $forminspeksi= null; + if ($resume) { + $forminspeksi = json_decode($inspeksi->data_form, true); + $rap = json_decode($resume->rap, true); + } + + return view('lpj::penilai.components.rap-penilai', compact('permohonan', 'rap', 'provinces','forminspeksi')); } @@ -480,7 +494,7 @@ class PenilaiController extends Controller return response()->json([ 'success' => true, - 'message' => 'Berhasil menyimpan penilaian' + 'message' => 'Berhasil Megirim reported ke so' ], 200); } catch (\Exception $e) { @@ -640,6 +654,8 @@ class PenilaiController extends Controller public function print_out(Request $request) { + + $documentId = $request->query('documentId'); $jaminanId = $request->query('jaminanId'); $permohonanId = $request->query('permohonanId'); @@ -677,6 +693,7 @@ class PenilaiController extends Controller if ($lpj) { $lpjData = json_decode($lpj->lpj, true); + $memo = json_decode($lpj->memoe, true); } $inputAddress = $forminspeksi['asset']['alamat']['sesuai'] ?? $forminspeksi['asset']['alamat']['tidak sesuai']; @@ -689,36 +706,25 @@ class PenilaiController extends Controller 'province_code' => $this->getWilayahName($inputAddress['province_code'] ?? null, 'province') ]; - $laporan = $lpj->type == 'sederhana' ? true : false; + ['sederhana', 'resume']; + ['memo']; + ['rap']; + + + // $laporan = $lpj->type == ; + + // $laporanPenilai = $lpj $viewLaporan = null; - if ($laporan) { - $viewLaporan = 'penilai.components.print-out-sederhana'; - } else { - $viewLaporan = 'penilai.components.print-out-standard'; - } + // $viewLaporan = 'penilai.components.print-out-sederhana'; + // $viewLaporan = 'penilai.components.print-out-standard'; + // $viewLaporan = 'penilai.components.print-resume'; + // $viewLaporan = 'penilai.components.print-memo'; + // $viewLaporan = 'penilai.components.print-rap'; try { if ($statusLpj) { - $pdf= PDF::loadView('lpj::' . $viewLaporan, compact( - 'permohonan', - 'forminspeksi', - 'lpjData', - 'formFoto', - 'basicData', - 'inspeksi', - 'lpj', - 'statusLpj', - 'alamat', - 'dataPembanding', - 'nomorLaporan' - )); - - $pdf->setPaper('A4', 'portrait'); - return $pdf->stream(); - - } else { $pdf = PDF::loadView('lpj::' . $viewLaporan, compact( 'permohonan', 'forminspeksi', @@ -734,7 +740,28 @@ class PenilaiController extends Controller )); $pdf->setPaper('A4', 'portrait'); - return $pdf->download('laporan.pdf'); + return $pdf->stream(); + + } else { + $pdf = view('lpj::' . $viewLaporan, compact( + // $pdf = PDF::loadView('lpj::' . $viewLaporan, compact( + 'permohonan', + 'forminspeksi', + 'lpjData', + 'formFoto', + 'basicData', + 'inspeksi', + 'lpj', + 'statusLpj', + 'alamat', + 'dataPembanding', + 'nomorLaporan', + 'memo' + )); + + return $pdf; + // $pdf->setPaper('A4', 'portrait'); + // return $pdf->download('laporan.pdf'); } } catch (\Exception $e) { @@ -779,4 +806,26 @@ class PenilaiController extends Controller } + // mengambil data dari fungsi permohonan di surveyor, dan table + // penilai, inspeksi + private function getDataPermohonanWithPenilaiAndInspeksi($permohonanId, $documentId, $jaminanId) + { + return [ + 'permohonan' => $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId), + 'penilai' => Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(), + 'inspeksi' => Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first() + ]; + } + + + // pengunaan request query by id permohonan, dokument, jaminan , inspeksi + protected function getRequestQueryId(Request $request) + { + return [ + 'permohonanId' => $request->query('permohonanId'), + 'documentId' => $request->query('documentId'), + 'jaminanId' => $request->query('jaminanId'), + 'inspeksiId' => $request->query('inspeksiId') + ]; + } } diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 16f0e2e..11b3aa2 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -27,6 +27,7 @@ use Modules\Location\Models\Village; use Modules\Lpj\Models\PosisiKavling; use Modules\Lpj\Models\KondisiFisikTanah; use Modules\Lpj\Models\FotoObjekJaminan; +use Modules\Lpj\Models\Perizinan; use Modules\Lpj\Models\KetinggianTanah; use Modules\Lpj\Models\SifatBangunan; use Modules\Lpj\Models\JenisJaminan; @@ -114,7 +115,18 @@ class SurveyorController extends Controller $bentukTanah = BentukTanah::all(); // Get all inspeksi data for this permohonan - $inspeksiData = Inspeksi::where('permohonan_id', $id) + if (strtolower($permohonan->tujuanPenilaian->name) == 'rap') { + $inspeksiData = Inspeksi::where('permohonan_id', $id) + ->get() + ->keyBy('dokument_id') + ->map(function ($item) { + return [ + 'data_form' => json_decode($item->data_form, true), + 'foto_form' => json_decode($item->foto_form, true) + ]; + }); + } else { + $inspeksiData = Inspeksi::where('permohonan_id', $id) ->get() ->keyBy('dokument_id') ->map(function ($item) { @@ -125,7 +137,7 @@ class SurveyorController extends Controller 'data_pembanding' => json_decode($item->data_pembanding, true), ]; }); - + } return view('lpj::surveyor.detail', compact( 'permohonan', @@ -192,12 +204,13 @@ class SurveyorController extends Controller 'pesawat' => 'getPesawatData', 'alat-berat' => 'getAlatBeratData', 'lingkungan' => 'getLingkunganData', - 'fakta' => 'getFactData' + 'fakta' => 'getFactData', + 'rap' => 'getRapData', ]; $rules = []; $hasAssetDescriptionRules = false; - + $hasFactaDat = false; $pisah = array_filter( explode(',', $action), function ($act) use ($allowedActions) { @@ -212,15 +225,23 @@ class SurveyorController extends Controller $actionRules = $this->$method($data, $request); $rules = array_merge($rules, $actionRules); - if (in_array($act, ['apartemen-kantor', 'tanah', 'bangunan'])) { + if (in_array($act, ['apartemen-kantor', 'tanah', 'bangunan', 'rap'])) { $hasAssetDescriptionRules = true; } + + if (in_array($act, ['rap'])) { + $hasFactaData = true; + } } if ($hasAssetDescriptionRules) { $rules = array_merge($rules, $this->getAssetData($data)); } + if ($hasFactaData) { + $rules = array_merge($rules, $this->getFactData($data, $request)); + } + return $rules; } @@ -388,73 +409,73 @@ class SurveyorController extends Controller } /** - * Process a photo + * Process a photo */ - protected function processFotoLantaiUnit(Request $request, &$formatFotojson) - { - // Pastikan foto_lantai_unit sudah ada di formatFotojson - if (!isset($formatFotojson['foto_lantai_unit'])) { - $formatFotojson['foto_lantai_unit'] = []; - } - - // Ambil nama-nama lantai dari request - $lantaiNama = $request->input('lantai_nama', []); - - // Tambahan: gunakan lantai_index jika tersedia - $lantaiIndex = $request->input('lantai_index', null); - - // Cek apakah ada file foto lantai yang diunggah - $lantaiFiles = $request->file('foto_lantai_unit', []); - - // Proses setiap file foto lantai - foreach ($lantaiFiles as $index => $files) { - // Pastikan $files adalah array - if (!is_array($files)) { - $files = [$files]; - } - - // Gunakan lantai_index jika tersedia, jika tidak gunakan cara sebelumnya - $lantaiNomor = $lantaiIndex ?? ($index + 1); - - // Inisialisasi array untuk lantai ini jika belum ada - if (!isset($formatFotojson['foto_lantai_unit'][$lantaiNomor])) { - $formatFotojson['foto_lantai_unit'][$lantaiNomor] = []; - } - - foreach ($files as $fileIndex => $file) { - // Validasi file - if (!$file->isValid()) { - continue; // Lewati file yang tidak valid - } - - // Generate nama file unik - $uniqueFileName = 'lantai_unit_' . $lantaiNomor . '_' . $fileIndex . '_' . Str::random(10) . '.' . $file->getClientOriginalExtension(); - - // Simpan file dengan nama asli - $path = $file->storeAs( - 'surveyor/lantai_unit', - $uniqueFileName . '/' . time() . '_' . $file->getClientOriginalName(), - 'public' - ); - - // Buat nama foto - $fotoName = "Foto Lantai {$lantaiNomor} - " . ($fileIndex + 1); - - // Tambahkan detail foto ke array - $fotoDetail = [ - 'path' => $path, - 'name' => $fotoName - ]; - - // Tambahkan ke array foto lantai unit sesuai struktur - $formatFotojson['foto_lantai_unit'][$lantaiNomor][] = $fotoDetail; - } - } - - return $formatFotojson; - } - - + protected function processFotoLantaiUnit(Request $request, &$formatFotojson) + { + // Pastikan foto_lantai_unit sudah ada di formatFotojson + if (!isset($formatFotojson['foto_lantai_unit'])) { + $formatFotojson['foto_lantai_unit'] = []; + } + + // Ambil nama-nama lantai dari request + $lantaiNama = $request->input('lantai_nama', []); + + // Tambahan: gunakan lantai_index jika tersedia + $lantaiIndex = $request->input('lantai_index', null); + + // Cek apakah ada file foto lantai yang diunggah + $lantaiFiles = $request->file('foto_lantai_unit', []); + + // Proses setiap file foto lantai + foreach ($lantaiFiles as $index => $files) { + // Pastikan $files adalah array + if (!is_array($files)) { + $files = [$files]; + } + + // Gunakan lantai_index jika tersedia, jika tidak gunakan cara sebelumnya + $lantaiNomor = $lantaiIndex ?? ($index + 1); + + // Inisialisasi array untuk lantai ini jika belum ada + if (!isset($formatFotojson['foto_lantai_unit'][$lantaiNomor])) { + $formatFotojson['foto_lantai_unit'][$lantaiNomor] = []; + } + + foreach ($files as $fileIndex => $file) { + // Validasi file + if (!$file->isValid()) { + continue; // Lewati file yang tidak valid + } + + // Generate nama file unik + $uniqueFileName = 'lantai_unit_' . $lantaiNomor . '_' . $fileIndex . '_' . Str::random(10) . '.' . $file->getClientOriginalExtension(); + + // Simpan file dengan nama asli + $path = $file->storeAs( + 'surveyor/lantai_unit', + $uniqueFileName . '/' . time() . '_' . $file->getClientOriginalName(), + 'public' + ); + + // Buat nama foto + $fotoName = "Foto Lantai {$lantaiNomor} - " . ($fileIndex + 1); + + // Tambahkan detail foto ke array + $fotoDetail = [ + 'path' => $path, + 'name' => $fotoName + ]; + + // Tambahkan ke array foto lantai unit sesuai struktur + $formatFotojson['foto_lantai_unit'][$lantaiNomor][] = $fotoDetail; + } + } + + return $formatFotojson; + } + + private function handleFileUpload(Request $request, $paramName, &$formatFotojson) { @@ -670,10 +691,10 @@ class SurveyorController extends Controller { $permohonanId = $request->permohonan_id; $dokumentId = $request->dokument_id; - + // Normalisasi path foto $cleanRequestPath = str_replace(['storage/', 'surveyor/'], '', $request->foto_path); - + $inspeksi = Inspeksi::firstOrNew( ['permohonan_id' => $permohonanId, 'dokument_id' => $dokumentId] ); @@ -681,7 +702,7 @@ class SurveyorController extends Controller // Konversi lantai ke string untuk konsistensi $lantai = (string)$request->lantai; - + // Cek apakah lantai ada di array $pat = null; if (isset($fotoLantaiUnit['foto_lantai_unit'][$lantai])) { @@ -691,7 +712,7 @@ class SurveyorController extends Controller function ($foto) use ($cleanRequestPath) { // Normalisasi path foto yang tersimpan $storedPath = str_replace(['storage/', 'surveyor/'], '', $foto['path']); - + // Jika path cocok, hapus file dari storage if ($storedPath === $cleanRequestPath) { // Hapus file dari storage dengan berbagai kemungkinan path @@ -701,14 +722,14 @@ class SurveyorController extends Controller 'storage/' . $cleanRequestPath, $cleanRequestPath ]; - + foreach ($possiblePaths as $path) { if (Storage::disk('public')->exists($path)) { Storage::disk('public')->delete($path); break; } } - + return false; // Hapus dari array } return true; @@ -717,28 +738,28 @@ class SurveyorController extends Controller // Reset index array $fotoLantaiUnit['foto_lantai_unit'][$lantai] = array_values($fotoLantaiUnit['foto_lantai_unit'][$lantai]); - + // Hapus lantai jika tidak ada foto if (empty($fotoLantaiUnit['foto_lantai_unit'][$lantai])) { unset($fotoLantaiUnit['foto_lantai_unit'][$lantai]); } - + // Update inspeksi $inspeksi->foto_form = json_encode($fotoLantaiUnit); $inspeksi->save(); - + return response()->json([ 'success' => true, 'foto_lantai_unit' => $pat ]); } - + return response()->json([ 'success' => false, 'message' => 'gagal menghapus' ], 404); } - + private function processPhotoLainnya(Request $request, array $fields, array $existingPhotos = []) { $result = $existingPhotos; // Start with existing photos @@ -869,30 +890,40 @@ class SurveyorController extends Controller return response()->json(['buttonDisable' => true]); } + $rapComplete = false; foreach ($inspeksiRecords as $inspeksi) { - $dataForm = json_decode($inspeksi->data_form, true); - $fotoForm = json_decode($inspeksi->foto_form, true); - $denahForm = json_decode($inspeksi->denah_form, true); - $dataPembanding = json_decode($inspeksi->data_pembanding, true); + if (strtolower($inspeksi->name) === 'rap') { + $dataForm = json_decode($inspeksi->data_form, true); + $fotoForm = json_decode($inspeksi->foto_form, true); + $isInvalid = empty($dataForm) && + empty($fotoForm); + if ($isInvalid) { + return response()->json(['buttonDisable' => true]); + } + } else { + $dataForm = json_decode($inspeksi->data_form, true); + $fotoForm = json_decode($inspeksi->foto_form, true); + $denahForm = json_decode($inspeksi->denah_form, true); + $dataPembanding = json_decode($inspeksi->data_pembanding, true); - $jenisJaminan = $inspeksi->dokument->jenisJaminan->name ?? ''; + $jenisJaminan = $inspeksi->dokument->jenisJaminan->name ?? ''; - $isTanahBangunan = !in_array( - strtoupper($jenisJaminan->name ?? ''), - ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT'] - ); + $isTanahBangunan = !in_array( + strtoupper($jenisJaminan->name ?? ''), + ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT'] + ); - $isInvalid = - empty($dataForm) || - empty($fotoForm) || - (($isTanahBangunan && empty($denahForm)) || - empty($dataPembanding)); + $isInvalid = + empty($dataForm) || + empty($fotoForm) || + (($isTanahBangunan && empty($denahForm)) || + empty($dataPembanding)); - if ($isInvalid) { - return response()->json(['buttonDisable' => true]); + if ($isInvalid) { + return response()->json(['buttonDisable' => true]); + } } } - // If we get here, all checks passed return response()->json(['buttonDisable' => false]); @@ -1880,6 +1911,7 @@ class SurveyorController extends Controller 'Merupakan Daerah' => MerupakanDaerah::class, 'Jenis unit' => JenisUnit::class, 'Foto Objek Jaminan' => FotoObjekJaminan::class, + 'Perizinan' => Perizinan::class, ]; @@ -2023,7 +2055,8 @@ class SurveyorController extends Controller 'merupakan-daerah' => MerupakanDaerah::class, 'jenis-unit' => JenisUnit::class, 'perkerasan-jalan' => PerkerasanJalan::class, - 'foto-objek-jaminan' => FotoObjekJaminan::class + 'foto-objek-jaminan' => FotoObjekJaminan::class, + 'perizinan' => Perizinan::class ]; @@ -2065,12 +2098,11 @@ class SurveyorController extends Controller 'hubPenghuni' => HubunganPenghuniJaminan::all(), 'perkerasanJalan' => PerkerasanJalan::all(), 'terletakDiArea' => TerletakArea::all(), - 'tujuanPenilaian' => TujuanPenilaian::all() + 'tujuanPenilaian' => TujuanPenilaian::all(), + 'perizinan' => Perizinan::all() ]; } - - private const HEADERS = [ 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'], 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'], @@ -2100,6 +2132,7 @@ class SurveyorController extends Controller 'bentuk-unit' => ['Bentuk unit', 'bentuk-unit'], 'fasilitas-objek' => ['Fasilitas Umum Dekat Objek', 'fasilitas-objek'], 'foto-objek-jaminan' => ['Foto Objek Jaminan', 'foto-objek-jaminan'], + 'perizinan' => ['Perizinan', 'perizinan'], ]; private function getAssetData(array $data): array @@ -2338,6 +2371,39 @@ class SurveyorController extends Controller return $factData; } + private function getRapData($data, $request): array + { + $rapData = [ + 'perizinan' => $data['perizinan'] ?? null, + 'perizinan_file' => $data['perizinan_file'] ?? null, + 'brosur_price_list' => $data['brosur_price_list'] ?? null, + 'brosur_price_file' => $data['brosur_price_file'] ?? null, + 'pengalaman_developer' => $data['pengalaman_developer'] ?? null, + 'developer_anggota' => $data['developer_anggota'] ?? null, + 'lainnya_developer' => $data['lainnya_developer'] ?? null, + 'kapan_mulai_dibangun' => $data['kapan_mulai_dibangun'] ?? null, + 'kondisi_perumahan' => $data['kondisi_perumahan'] ?? null, + 'progres_pembangunan' => $data['progres_pembangunan'] ?? null, + 'kontraktor' => $data['kontraktor'] ?? null, + 'lingkungan_sekitar' => $data['lingkungan_sekitar'] ?? null, + 'komplek_disekitar' => $data['komplek_disekitar'] ?? null, + 'pusat_keramaian' => $data['pusat_keramaian'] ?? null, + 'transportasi_umum' => $data['transportasi_umum'] ?? null, + 'lainnya_kondisi' => $data['lainnya_kondisi'] ?? null, + 'partisi' => $data['partisi'] ?? null, + 'jumlah_unit' => $data['jumlah_unit'] ?? null, + 'batas_batas_perumahan' => $data['batas_batas_perumahan'] ?? null, + 'fasus_fasum' => $data['fasus_fasum'] ?? null, + 'progres_penjualan' => $data['progres_penjualan'] ?? null, + 'harga_unit' => $data['harga_unit'] ?? null, + 'target_market' => $data['target_market'] ?? null, + 'kerjasama_dengan_bank' => $data['kerjasama_dengan_bank'] ?? null, + 'rute_menuju_lokasi' => $data['rute_menuju_lokasi'] ?? null, + ]; + + return $rapData; + } + private function updateOrDeleteFile($data, $request, $fileKey) { if ($request->hasFile($fileKey)) { diff --git a/app/Http/Requests/FormSurveyorRequest.php b/app/Http/Requests/FormSurveyorRequest.php index 5089b22..cdc4658 100644 --- a/app/Http/Requests/FormSurveyorRequest.php +++ b/app/Http/Requests/FormSurveyorRequest.php @@ -43,6 +43,7 @@ class FormSurveyorRequest extends FormRequest 'apartemen-kantor' => $this->getUnitRules(), 'lingkungan' => $this->getLinkunganRules(), 'fakta' => $this->getCommonRules(), + 'rap' => $this->getRapRules() ]; $rules = []; @@ -51,7 +52,7 @@ class FormSurveyorRequest extends FormRequest foreach ($pisah as $act) { if (isset($allRules[$act])) { $rules = array_merge($rules, $allRules[$act]); - if ($act == 'tanah' || $act == 'bangunan' || $act == 'apartemen-kantor') { + if ($act == 'tanah' || $act == 'bangunan' || $act == 'apartemen-kantor' || $act == 'rap') { $hasAssetDescriptionRules = true; } } @@ -580,4 +581,51 @@ class FormSurveyorRequest extends FormRequest ]; } + private function getRapRules() + { + return [ + 'perizinan.*' => 'required', + 'perizinan_file.*' => 'required', + 'brosur_price_list.*' => 'required', + 'brosur_price_file.*' => 'required', + 'pengalaman_developer' => 'nullable', + 'developer_anggota' => 'nullable', + 'lainnya_developer.*' => 'nullable', + 'kapan_mulai_dibangun' => 'nullable', + 'kondisi_perumahan' => 'nullable', + 'progres_pembangunan' => 'nullable', + 'kontraktor' => 'nullable', + 'lingkungan_sekitar' => 'nullable', + 'komplek_disekitar' => 'nullable', + 'pusat_keramaian' => 'nullable', + 'transportasi_umum' => 'nullable', + 'lainnya_kondisi.*' => 'nullable', + 'partisi_.*' => 'nullable', + 'jumlah_unit.*' => 'nullable', + 'batas_batas_perumahan' => 'nullable', + 'fasus_fasum.*' => 'nullable', + 'progres_penjualan.*' => 'nullable', + 'harga_unit.*' => 'nullable', + 'target_market.*' => 'nullable', + 'kerjasama_dengan_bank' => 'nullable', + 'rute_menuju_lokasi' => '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|array', + + ]; + } + } diff --git a/app/Http/Requests/SurveyorRequest.php b/app/Http/Requests/SurveyorRequest.php index 658c451..f62fb3d 100644 --- a/app/Http/Requests/SurveyorRequest.php +++ b/app/Http/Requests/SurveyorRequest.php @@ -39,6 +39,7 @@ class SurveyorRequest extends FormRequest 'fasilitas-objek' => 'fasilitas_objek', 'perkerasan-jalan' => 'perkerasan_jalan', 'foto-objek-jaminan' => 'foto_objek_jaminan', + 'perizinan' => 'perizinan' ]; /** diff --git a/app/Models/Perizinan.php b/app/Models/Perizinan.php new file mode 100644 index 0000000..34048d4 --- /dev/null +++ b/app/Models/Perizinan.php @@ -0,0 +1,25 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $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('perizinan'); + } +}; diff --git a/module.json b/module.json index f1a7700..dc497b6 100644 --- a/module.json +++ b/module.json @@ -827,6 +827,17 @@ "administrator", "admin" ] + }, + { + "title": "Perizinan", + "path": "basicdata.perizinan", + "classes": "", + "attributes": [], + "permission": "", + "roles": [ + "administrator", + "admin" + ] } ] } diff --git a/resources/views/activity/progres_activity/index.blade.php b/resources/views/activity/progres_activity/index.blade.php index 7f97ae8..394708e 100644 --- a/resources/views/activity/progres_activity/index.blade.php +++ b/resources/views/activity/progres_activity/index.blade.php @@ -204,7 +204,9 @@ }, progress: { title: 'Progress', - render: (item, data) => `${data.progress || ''}`, + render: (item, data) => { + return `${data.permohonan.status}`; + } }, due_date: { title: 'Due Date', diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php index bb53d1f..7ed7549 100644 --- a/resources/views/penilai/components/foto-jaminan.blade.php +++ b/resources/views/penilai/components/foto-jaminan.blade.php @@ -1,154 +1,121 @@
- @if (isset($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi'])) - @foreach ($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi'][0] as $index => $item) -
-

- {{ $item['name'] . ' ' . $loop->index + 1 }} -

+ @php + $photoSections = [ + 'rute_menuju_lokasi' => [ + 'key' => 'rute_menuju_lokasi', + 'name_prefix' => '', + 'nested' => true + ], + 'foto_rute_lainnya' => [ + 'key' => 'name_rute_lainnya', + 'name_prefix' => '', + 'nested' => false + ], + 'object_jaminan' => [ + 'key' => 'name_objek', + 'name_prefix' => '', + 'nested' => false + ], + 'foto_lantai_unit' => [ + 'key' => 'name', + 'name_prefix' => 'Foto Lantai', + 'nested' => true + ], + 'foto_lingkungan' => [ + 'key' => 'foto_lingkungan', + 'name_prefix' => '', + 'nested' => true + ], + 'single_photos' => [ + 'foto_basement' => 'Basement', + 'foto_gerbang' => 'Gerbang', + 'pendamping' => 'Pendamping' + ] + ]; - @php - $imagePath = storage_path('app/public/' . $item['path']); - @endphp - - @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) - {{ $item['path'] }} - @endif -
- @endforeach - @endif - - @if (isset($formFoto['foto_rute_lainnya'])) - @foreach ($formFoto['foto_rute_lainnya'] as $index => $item) -
-

- {{ $item['name_rute_lainnya'] }} -

- - @php - $imagePath = storage_path('app/public/' . $item['foto_rute_lainnya']); - @endphp - - @if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_rute_lainnya']))) - {{ $item['foto_rute_lainnya'] }} - @endif -
- @endforeach - @endif - - - @if (!empty($formFoto['object_jaminan'])) - @foreach ($formFoto['object_jaminan'] as $item) - @php - $nameObjek = trim($item['name_objek'] ?? ''); - $fotoObjek = trim($item['foto_objek'] ?? ''); - $imagePath = storage_path('app/public/' . $fotoObjek); - @endphp - - @if (!empty($nameObjek) || !empty($fotoObjek)) -
- @if (!empty($nameObjek)) -

- {{ $nameObjek }} -

- @endif - - @if ($statusLpj || (!empty($fotoObjek) && file_exists($imagePath))) - {{ $nameObjek ?: 'Objek Foto' }} - @else -

Foto tidak tersedia

- @endif -
- @endif - @endforeach - @else -

Tidak ada objek jaminan yang ditemukan

- @endif - - - - @if (isset($formFoto['foto_lantai_unit'])) - @foreach ($formFoto['foto_lantai_unit'] as $index => $floorPhotos) - @foreach ($floorPhotos as $index => $item) -
-

- {{ $item['name'] ?? 'Foto Lantai ' . $floorNumber . ' - ' . ($index + 1) }} -

+ $hasPhotos = false; + @endphp + @foreach ($photoSections as $sectionKey => $sectionConfig) + @if ($sectionKey === 'single_photos') + @foreach ($sectionConfig as $photoKey => $photoName) + @if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey])) @php - $imagePath = storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $formFoto[$photoKey]); + $hasPhotos = true; @endphp +
+

+ {{ $photoName }} +

- @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) - {{ $item['path'] }} - @endif -
- @endforeach - @endforeach - @endif - - @if (isset($formFoto['foto_lingkungan']['foto_lingkungan'])) - @foreach ($formFoto['foto_lingkungan']['foto_lingkungan'][0] as $index => $item) -
-

- {{ $item['name'] . ' ' . $loop->index + 1 }} -

- - @php - $imagePath = storage_path('app/public/' . $item['path']); - @endphp - - @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) - {{ $item['path'] }} + @if ($statusLpj || file_exists($imagePath)) + {{ $photoName }} + @endif +
@endif -
- @endforeach - @endif - - @if (isset($formFoto['foto_basement'])) -
-

- Basement -

- + @endforeach + @else @php - $imagePath = storage_path('app/public/' . $formFoto['foto_basement']); + $sectionData = $formFoto[$sectionKey] ?? null; @endphp - @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_basement']))) - {{ $formFoto['foto_basement'] }} + @if (!empty($sectionData)) + @if ($sectionConfig['nested']) + @if (isset($sectionData[$sectionConfig['key']][0])) + @foreach ($sectionData[$sectionConfig['key']][0] as $index => $item) + @php + $imagePath = storage_path('app/public/' . $item['path']); + $hasPhotos = true; + @endphp +
+

+ {{ $sectionConfig['name_prefix'] ? + ($sectionConfig['name_prefix'] . ' ' . ($index + 1)) : + ($item['name'] ?? 'Foto ' . ($index + 1)) + }} +

+ + @if ($statusLpj || file_exists($imagePath)) + {{ $item['path'] }} + @endif +
+ @endforeach + @endif + @else + @foreach ($sectionData as $index => $item) + @php + $name = $item[$sectionConfig['key']] ?? ''; + $photoPath = $sectionKey === 'object_jaminan' ? + ($item['foto_objek'] ?? '') : + ($item['foto_rute_lainnya'] ?? ''); + + $imagePath = storage_path('app/public/' . $photoPath); + @endphp + + @if (!empty($name) || !empty($photoPath)) + @php $hasPhotos = true; @endphp +
+ @if (!empty($name)) +

+ {{ $name }} +

+ @endif + + @if ($statusLpj || (file_exists($imagePath) && !empty($photoPath))) + {{ $name ?: 'Foto' }} + @endif +
+ @endif + @endforeach + @endif @endif -
- @endif + @endif + @endforeach - @if (isset($formFoto['foto_gerbang'])) -
-

- Gerbang -

- - @php - $imagePath = storage_path('app/public/' . $formFoto['foto_gerbang']); - @endphp - - @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_gerbang']))) - {{ $formFoto['foto_gerbang'] }} - @endif -
- @endif - - @if (isset($formFoto['pendamping'])) -
-

- Pendamping -

- - @php - $imagePath = storage_path('app/public/' . $formFoto['pendamping']); - @endphp - - @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['pendamping']))) - {{ $formFoto['pendamping'] }} - @endif + @if (!$hasPhotos) +
+

Tidak ada foto yang tersedia

@endif
diff --git a/resources/views/penilai/components/foto-lampiran.blade.php b/resources/views/penilai/components/foto-lampiran.blade.php index 7d05979..5882d84 100644 --- a/resources/views/penilai/components/foto-lampiran.blade.php +++ b/resources/views/penilai/components/foto-lampiran.blade.php @@ -1,3 +1,4 @@ +@if (isset($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi']))

@@ -22,6 +23,7 @@ @endif

+@endif @if (isset($formFoto['foto_rute_lainnya']))
@@ -50,6 +52,7 @@
@endif +@if (isset($formFoto['object_jaminan']))

@@ -74,10 +77,11 @@ @endif

+@endif @if (isset($formFoto['foto_lantai_unit']))
-
+

Lantai

@@ -90,7 +94,7 @@

{{ $item['name'] ?? 'Foto Lantai ' . ($floorIndex + 1) . ' - ' . ($index + 1) }}

-
+
Gambar {{ $floorIndex + 1 }}-{{ $index + 1 }} @@ -106,6 +110,7 @@
@endif +@if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))

@@ -128,8 +133,8 @@ @endforeach @endif

-
+@endif @if (isset($formFoto['foto_basement']))
@@ -147,7 +152,7 @@
- +
@@ -202,7 +207,7 @@
- +
@@ -231,7 +236,7 @@
- +
@@ -267,7 +272,7 @@ $adaFoto = false;
- +
@if (isset($forminspeksi)) @forelse ($fotoTypes as $type) @@ -278,7 +283,7 @@ $adaFoto = false; @if ($imagePath && file_exists(storage_path('app/public/' . $imagePath))) {{ $type }} + class="w-full h-auto object-cover"> @endif

{{ Str::title(str_replace('_', ' ', $type)) }}

@@ -289,4 +294,4 @@ $adaFoto = false;
-@endif \ No newline at end of file +@endif diff --git a/resources/views/penilai/components/print-memo.blade.php b/resources/views/penilai/components/print-memo.blade.php new file mode 100644 index 0000000..dc44a8d --- /dev/null +++ b/resources/views/penilai/components/print-memo.blade.php @@ -0,0 +1,344 @@ + + + + + + + + + Laporan Penilai Jaminan + + + + + + + + +
+ + + + +
+

MEMO ANTAR KANTOR

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Kepada:{{ $memo['kepada'] ?? '' }}
Dari:{{ $memo['dari'] ?? '' }}
No:{{ $memo['nomor_memo'] ?? '' }}
Tanggal:
Perihal:{{ $memo['perihal'] ?? '' }}
+ + + + + +
+ Menindak lanjuti permintann penilaian jaminan dari {{ $permohonan->user->name }} AO Cabang Ternate + tanggal , dapat di sampaikan sebagai berikut: +
+ + + + + +
+

Identitas Deitur & Hubungan dan Penghuni

+
+ + + + + + + + + @if (@isset($dokumen)) + @foreach ($dokumen->detail as $details) + + + + + + @endforeach + @endif + + + + + + + + + + + + + + + + + + + @php + $cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai'; + + $luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null; + @endphp + + + + +
Nama Calon Debiture:{{ $permohonan->debiture->name ?? '' }}
{{ $details->jenisLegalitasJaminan->name ?? '' }} + : + @if (isset($detail->dokumen_jaminan)) + @php + $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) + ? json_decode($detail->dokumen_nomor) + : ($detail->dokumen_nomor + ? [$detail->dokumen_nomor] + : []); + @endphp + @foreach ($dokumen_jaminan as $index => $dokumen) +
+ @if (!empty($dokumen_nomor)) + + {{ $dokumen_nomor[$index] }} + @endif +
+
+ @endforeach + @endif +
Atas Nama:{{ $permohonan->debiture->name ?? '' }}
Tanggal Terbit Sertifikat:
Surat Ukur No:
Luas Tanah:{{ $luas ?? '' }}
+ + + + + +
+

Loaksi Jaminan

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Terletak di: {{ $alamat['address'] ?? '' }}
Kelurahan:{{ $alamat['village_code'] ?? '' }}
Kecamatan:{{ $alamat['district_code'] ?? '' }}
Kota: {{ $alamat['city_code'] ?? '' }}
Propinsi:{{ $alamat['province_code'] ?? '' }}
Titik Kordinat:{{ $alamat['province_code'] ?? '' }}
+ + + + + + +
+

HASIL INSPEKSI

+
+ + + + +
+

KESIMPULAN DAN SARAN

+
+ + + + + + +
Demikian Kami Sampaikan, aatas perhatiannya kami ucapkan terimakasih
+ + + + + + + + + + + + + +
{{ $penilai->userPenilaiTeam->name ?? '' }}
+ Appraisal +
{{ $senior_officer->name ?? '' }}
+ SO Region +
{{ $senior_officer->name ?? '' }}
+ EO Appraisal +
{{ $senior_officer->name ?? '' }}
+ Deputy Director +
+ + + +
+ + + + + + + +
FOTO JAMINAN
+ @include('lpj::penilai.components.foto-jaminan') +
+
+ + + + + + diff --git a/resources/views/penilai/components/print-out-rap.blade.php b/resources/views/penilai/components/print-out-rap.blade.php new file mode 100644 index 0000000..dc44a8d --- /dev/null +++ b/resources/views/penilai/components/print-out-rap.blade.php @@ -0,0 +1,344 @@ + + + + + + + + + Laporan Penilai Jaminan + + + + + + + + +
+ + + + +
+

MEMO ANTAR KANTOR

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Kepada:{{ $memo['kepada'] ?? '' }}
Dari:{{ $memo['dari'] ?? '' }}
No:{{ $memo['nomor_memo'] ?? '' }}
Tanggal:
Perihal:{{ $memo['perihal'] ?? '' }}
+ + + + + +
+ Menindak lanjuti permintann penilaian jaminan dari {{ $permohonan->user->name }} AO Cabang Ternate + tanggal , dapat di sampaikan sebagai berikut: +
+ + + + + +
+

Identitas Deitur & Hubungan dan Penghuni

+
+ + + + + + + + + @if (@isset($dokumen)) + @foreach ($dokumen->detail as $details) + + + + + + @endforeach + @endif + + + + + + + + + + + + + + + + + + + @php + $cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai'; + + $luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null; + @endphp + + + + +
Nama Calon Debiture:{{ $permohonan->debiture->name ?? '' }}
{{ $details->jenisLegalitasJaminan->name ?? '' }} + : + @if (isset($detail->dokumen_jaminan)) + @php + $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) + ? json_decode($detail->dokumen_nomor) + : ($detail->dokumen_nomor + ? [$detail->dokumen_nomor] + : []); + @endphp + @foreach ($dokumen_jaminan as $index => $dokumen) +
+ @if (!empty($dokumen_nomor)) + + {{ $dokumen_nomor[$index] }} + @endif +
+
+ @endforeach + @endif +
Atas Nama:{{ $permohonan->debiture->name ?? '' }}
Tanggal Terbit Sertifikat:
Surat Ukur No:
Luas Tanah:{{ $luas ?? '' }}
+ + + + + +
+

Loaksi Jaminan

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Terletak di: {{ $alamat['address'] ?? '' }}
Kelurahan:{{ $alamat['village_code'] ?? '' }}
Kecamatan:{{ $alamat['district_code'] ?? '' }}
Kota: {{ $alamat['city_code'] ?? '' }}
Propinsi:{{ $alamat['province_code'] ?? '' }}
Titik Kordinat:{{ $alamat['province_code'] ?? '' }}
+ + + + + + +
+

HASIL INSPEKSI

+
+ + + + +
+

KESIMPULAN DAN SARAN

+
+ + + + + + +
Demikian Kami Sampaikan, aatas perhatiannya kami ucapkan terimakasih
+ + + + + + + + + + + + + +
{{ $penilai->userPenilaiTeam->name ?? '' }}
+ Appraisal +
{{ $senior_officer->name ?? '' }}
+ SO Region +
{{ $senior_officer->name ?? '' }}
+ EO Appraisal +
{{ $senior_officer->name ?? '' }}
+ Deputy Director +
+ + + +
+ + + + + + + +
FOTO JAMINAN
+ @include('lpj::penilai.components.foto-jaminan') +
+
+ + + + + + diff --git a/resources/views/penilai/components/print-resume.blade.php b/resources/views/penilai/components/print-resume.blade.php new file mode 100644 index 0000000..324d2b2 --- /dev/null +++ b/resources/views/penilai/components/print-resume.blade.php @@ -0,0 +1,301 @@ + + + + + + + + + Laporan Penilai Jaminan + + + + + + + + +
+ + + + +
+

Resume + Penilaian +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pemohon:
Atas Nama Cadeb:
Aset:
Lokasi Objek:
Dokumen: + + @if (@isset($dokumen)) + @foreach ($dokumen->detail as $details) + + + + @endforeach + @endif +
{{ $details->jenisLegalitasJaminan->name ?? '' }} + @if (isset($detail->dokumen_jaminan)) + @php + $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) + ? json_decode($detail->dokumen_nomor) + : ($detail->dokumen_nomor + ? [$detail->dokumen_nomor] + : []); + @endphp + @foreach ($dokumen_jaminan as $index => $dokumen) +
+ @if (!empty($dokumen_nomor)) + + {{ $dokumen_nomor[$index] }} + @endif +
+
+ @endforeach + @endif +
+
Luas Tanah:
Tanggal Kunjungan:
Luast Lahan:
+ + + + + +
+

Faktor Positif

+
+ + + + + +
+

Faktor negatif

+
+ + + + +
+

Nilai Pasar Wajar

+
+ + + + + + + + + + + +
+ Keterangan + + Nilai Pasar Wajar + + Nilai Likudasi +
+ + + Nilai Pasar Wajar + + Nilai Likudasi +
+ + + + +
+

lain lain

+
+ + + + + + +
Demikian Kami Sampaikan, atas perhatiannya kami ucapkan terimakasih
+ + + + + + + + + +
{{ $penilai->userPenilaiTeam->name ?? '' }}
+ Appraisal +
{{ $senior_officer->name ?? '' }}
+ SO Region +
+ + + +
+ + + + + + + +
FOTO JAMINAN
+ @include('lpj::penilai.components.foto-jaminan') +
+
+ + + + + + diff --git a/resources/views/penilai/components/rap-penilai.blade.php b/resources/views/penilai/components/rap-penilai.blade.php new file mode 100644 index 0000000..acab50f --- /dev/null +++ b/resources/views/penilai/components/rap-penilai.blade.php @@ -0,0 +1,15 @@ +@extends('layouts.main') + +@section('breadcrumbs') + {{-- {{ Breadcrumbs::render(request()->route()->getName()) }} + --}} + RAP +@endsection + +@section('content') +
+ @include('lpj::assetsku.includenya') + @include('lpj::surveyor.components.header') + @include('lpj::surveyor.components.rap') +
+@endsection diff --git a/resources/views/penilai/show.blade.php b/resources/views/penilai/show.blade.php index 3d60152..b484ba1 100644 --- a/resources/views/penilai/show.blade.php +++ b/resources/views/penilai/show.blade.php @@ -228,8 +228,7 @@ - - +{{-- untuk laporan standart itu non kerjasama tapi sederhanan in kerjasama --}} - {{-- @@ -516,6 +515,10 @@ } + function checkLaporan(){ + + } + @include('lpj::surveyor.js.utils') diff --git a/resources/views/surveyor/components/card-tambah.blade.php b/resources/views/surveyor/components/card-tambah.blade.php index 09323ea..2472ee5 100644 --- a/resources/views/surveyor/components/card-tambah.blade.php +++ b/resources/views/surveyor/components/card-tambah.blade.php @@ -1,4 +1,7 @@
+ + + @foreach ($permohonan->debiture->documents as $dokumen) @php $jaminanId = $dokumen->id; @@ -6,27 +9,28 @@ $tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT']; - - $href = [ [ 'label' => 'form inspeksi', - 'url' => route('surveyor.inspeksi', [ - 'id' => $permohonan->id, - ]) . "?form=create-inspeksi&inspeksi={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", + 'url' => + route('surveyor.inspeksi', [ + 'id' => $permohonan->id, + ]) . + "?form=create-inspeksi&inspeksi={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", 'show' => true, 'icon' => !empty($currentInspeksi['data_form']), ], ]; if (!in_array(strtoupper($dokumen->jenisJaminan->name), $tanahBangunanTypes)) { - $denahLabel = strtoupper($dokumen->jenisJaminan->name); $href[] = [ 'label' => 'denah ' . $denahLabel, - 'url' => route('surveyor.denah', [ - 'id' => $permohonan->id - ]) . "?form=create-denah&denah={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", + 'url' => + route('surveyor.denah', [ + 'id' => $permohonan->id, + ]) . + "?form=create-denah&denah={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", 'show' => true, 'icon' => !empty($currentInspeksi['denah_form']), ]; @@ -35,36 +39,43 @@ $href = array_merge($href, [ [ 'label' => 'foto', - 'url' => route('surveyor.foto', [ - 'id' => $permohonan->id - ]) . "?form=create-foto&foto={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", + 'url' => + route('surveyor.foto', [ + 'id' => $permohonan->id, + ]) . + "?form=create-foto&foto={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", 'show' => true, 'icon' => !empty($currentInspeksi['foto_form']), ], [ 'label' => 'data pembanding', - 'url' => route('surveyor.data-pembanding', [ - 'id' => $permohonan->id - ]) . "?form=data-pembanding&pembanding={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", + 'url' => + route('surveyor.data-pembanding', [ + 'id' => $permohonan->id, + ]) . + "?form=data-pembanding&pembanding={$permohonan->id}&dokument={$jaminanId}&jenisjaminan={$dokumen->jenisJaminan->id}", 'show' => true, 'icon' => !empty($currentInspeksi['data_pembanding']), ], ]); @endphp -
- - - -
- -
+ viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg"> + + + +
+ +
@@ -74,27 +85,80 @@
- @foreach ($href as $item) - @if ($item['show']) - -
-
-

- {{ $item['label'] }} -

+ @if (strtolower($permohonan->tujuanPenilaian->name) == 'rap') +
+
+
+

+ Form Inspeksi RAP +

+
+ +
+
+
+
+
-
-
-
- +
+
+ +
+
+

+ Foto +

+
+
+
+
+
+ +
+
+
+
+ @else + @foreach ($href as $item) + @if ($item['show']) + +
+
+

+ {{ $item['label'] }} +

-
- - @endif - @endforeach +
+
+
+ +
+
+
+ + @endif + @endforeach + @endif
@endforeach
diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 4152b41..0401e18 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -616,14 +616,6 @@ }, error: function(xhr, status, error) { console.error('Gagal memuat foto:', error); - - // Tampilkan pesan error - Swal.fire({ - icon: 'error', - title: 'Gagal Memuat Foto', - text: 'Terjadi kesalahan saat mengambil foto. Silakan coba lagi.', - confirmButtonText: 'OK' - }); }, complete: function() { // Sembunyikan loading indicator diff --git a/resources/views/surveyor/components/header.blade.php b/resources/views/surveyor/components/header.blade.php index 4068cfb..0368573 100644 --- a/resources/views/surveyor/components/header.blade.php +++ b/resources/views/surveyor/components/header.blade.php @@ -1,18 +1,27 @@
+ @php + $title = $title ?? 'Form Inspeksi'; + @endphp

- Form Inspeksi + {{ $title }}

-
-

Order Penilaian

-
diff --git a/resources/views/surveyor/components/informasi.blade.php b/resources/views/surveyor/components/informasi.blade.php index 57a2052..dcc3a47 100644 --- a/resources/views/surveyor/components/informasi.blade.php +++ b/resources/views/surveyor/components/informasi.blade.php @@ -122,7 +122,8 @@
+ -
+
diff --git a/resources/views/surveyor/components/inspeksi.blade.php b/resources/views/surveyor/components/inspeksi.blade.php index 4f39b16..c02209c 100644 --- a/resources/views/surveyor/components/inspeksi.blade.php +++ b/resources/views/surveyor/components/inspeksi.blade.php @@ -11,6 +11,13 @@ @csrf + + @if (strtolower($permohonan->tujuanPenilaian->name) == 'rap') + + + @include('lpj::surveyor.components.header') + @include('lpj::surveyor.components.rap') + @else @foreach ($permohonan->debiture->documents as $dokumen) @if ($dokumen->jenisJaminan) @php @@ -36,8 +43,7 @@ @endif @endif @endforeach - - + @endif
+ @endforeach> + @else +
+ +
+ + @endif +
+ +
+
+
+ +
+
+ +
+
+

+ KONDISI, LINGKUNGAN DAN PROGRESS PEMBANGUNAN +

+
+
+
+
+ +
+ @if (!empty($forminspeksi['kapan_mulai_dibangun'])) +
+ + +
+ @else +
+ + +
+ @endif +
+
+ +
+ +
+ @if (!empty($forminspeksi['kondisi_perumahan'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ + + +
+ +
+ @if (!empty($forminspeksi['progres_pembangunan'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ +
+ +
+ @if (!empty($forminspeksi['kontraktor'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ +
+ +
+ @if (!empty($forminspeksi['lingkungan_sekitar'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ +
+ +
+ @if (!empty($forminspeksi['komplek_disekitar'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ +
+ +
+ @if (!empty($forminspeksi['pusat_keramaian'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+ +
+ +
+ @if (!empty($forminspeksi['transportasi_umum'])) +
+ +
+ @else +
+ + +
+ @endif + +
+
+
+ +
+ @if (!empty($forminspeksi['lainnya_kondisi'])) + @foreach ($forminspeksi['lainnya_kondisi'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+
+ +
+ +
+
+ +
+
+

+ PARTISI BANGUNAN +

+
+
+
+ @if (isset($basicData['spekKategoriBangunan'])) + @foreach ($basicData['spekKategoriBangunan'] as $item) +
+ +
+ + @error($item->name) + + @enderror +
+
+ @endforeach + @endif +
+
+
+ +
+
+

+ JUMLAH UNIT, BLOK, TYPE DAN LUAS BANGUNAN +

+
+
+
+
+ @if (!empty($forminspeksi['jumlah_unit'])) + @foreach ($forminspeksi['jumlah_unit'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+
+ +
+
+ +
+
+

+ BATAS-BATAS PERUMAHAN +

+
+
+
+
+ @if (!empty($forminspeksi['batas_batas_perumahan'])) + @foreach ($forminspeksi['batas_batas_perumahan'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+
+ +
+
+ +
+
+

+ FASOS/FASUM +

+
+
+ +
+
+ @if (!empty($forminspeksi['fasus_fasum'])) + @foreach ($forminspeksi['fasus_fasum'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif +
+
+ +
+
+ +
+
+

+ PROGRES PENJUALAN SAAT INI +

+
+
+
+
+ @if (!empty($forminspeksi['progres_penjualan'])) + @foreach ($forminspeksi['progres_penjualan'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif +
+
+ +
+
+ +
+
+

+ HARGA UNIT +

+
+
+
+
+ @if (!empty($forminspeksi['harga_unit'])) + @foreach ($forminspeksi['harga_unit'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+
+ +
+
+
+
+

+ TARGET MARKET +

+
+
+
+
+ @if (!empty($forminspeksi['target_market'])) + @foreach ($forminspeksi['target_market'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+
+ +
+
+
+
+

+ KERJASAMA DENGAN BANK LAIN +

+
+
+
+ +
+ @if (!empty($forminspeksi['kerjasama_dengan_bank'])) + @foreach ($forminspeksi['kerjasama_dengan_bank'] as $index => $positif) +
+ + +
+ @endforeach + @else +
+ + +
+ @endif + +
+ +
+ +
+
+
+
+

+ RUTE MENUJU LOKASI +

+
+
+
+ +
+ @if (!empty($forminspeksi['rute_menuju_lokasi'])) + +
+ + +
+ + @else +
+ + +
+ @endif + +
+
+ +
+
+@include('lpj::surveyor.components.informasi') diff --git a/resources/views/surveyor/index.blade.php b/resources/views/surveyor/index.blade.php index 4bf99f5..8589ba6 100644 --- a/resources/views/surveyor/index.blade.php +++ b/resources/views/surveyor/index.blade.php @@ -4,9 +4,6 @@ {{ Breadcrumbs::render('surveyor') }} @endsection @section('content') - @push('styles') - @endpush -
@@ -94,6 +91,98 @@
+ + + + + + @endsection @@ -165,16 +254,16 @@ if (data.penilaian.waktu_penilaian == null && data.penilaian.authorized_status == null) { actionHtml += ` - + `; } else { actionHtml += ` - + - @@ -212,94 +301,3 @@ @endpush - - - - - diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index cc19394..32f7500 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -496,6 +496,7 @@ 'bentuk-unit' => 'Bentuk unit', 'fasilitas-objek' => 'Fasilitas Umum Dekat Objek', 'foto-objek-jaminan' => 'Foto Objek Jaminan', + 'perizinan' => 'Perizinan', ]; diff --git a/routes/web.php b/routes/web.php index 5b8f67a..9d41ae1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -313,6 +313,7 @@ Route::middleware(['auth'])->group(function () { 'bentuk-unit' => 'Bentuk unit', 'fasilitas-objek' => 'Fasilitas Umum Dekat Objek', 'foto-objek-jaminan' => 'Foto Objek Jaminan', + 'perizinan' => 'Perizinan' ];