diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php new file mode 100644 index 0000000..6a4c032 --- /dev/null +++ b/app/Helpers/Lpj.php @@ -0,0 +1,41 @@ +month - 1]; + return $carbonDate->format('d') . ' ' . $month . ' ' . $carbonDate->format('Y'); +} + + +function formatRupiah($number) +{ + $number = (float) $number; + return 'Rp ' . number_format($number, 2, ',', '.'); +} + + +function formatAlamat($alamat) +{ + return ($alamat->address ? $alamat->address . ', ' : '') . + (isset($alamat->village) ? $alamat->village->name . ', ' : '') . + (isset($alamat->city) ? $alamat->city->name . ', ' : '') . + (isset($alamat->province) ? $alamat->province->name . ', ' : '') . + ($alamat->postal_code ?? ''); +} diff --git a/app/Http/Controllers/ProsesPenawaranController.php b/app/Http/Controllers/ProsesPenawaranController.php index 14be728..9063533 100644 --- a/app/Http/Controllers/ProsesPenawaranController.php +++ b/app/Http/Controllers/ProsesPenawaranController.php @@ -38,15 +38,15 @@ class ProsesPenawaranController extends Controller } // Retrieve data from the database - $query =PenawaranTender::query()->where('status','=','tender')->withCount('penawarandetails'); - + $query = PenawaranTender::query()->where('status', '=', 'tender')->withCount('penawarandetails'); + // Apply search filter if provided if ($request->has('search') && !empty($request->get('search'))) { $search = $request->get('search'); $query->where(function ($q) use ($search) { $q->where('nomor_registrasi', 'LIKE', '%' . $search . '%'); $q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%'); - + $q->orWhereRelation('tujuanPenilaianKJPP', 'name', 'LIKE', '%' . $search . '%'); $q->orWhere('status', 'LIKE', '%' . $search . '%'); }); } @@ -75,7 +75,7 @@ class ProsesPenawaranController extends Controller // Get the data for the current page //$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get(); - $data = $query->get(); + $data = $query->with(['tujuanPenilaianKJPP'])->get(); // Calculate the page count $pageCount = ceil($totalRecords / $request->get('size')); @@ -109,26 +109,24 @@ class ProsesPenawaranController extends Controller if (request()->ajax()) { $id = $request->id; $penawaran = PenawaranTender::findOrFail($id); - $penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id) - ->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id') - ->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name') - ->where('detail_penawaran.status','=',1) - ->get(); + $penawrandetails = PenawaranDetailTender::where('penawaran_id', '=', $id) + ->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id') + ->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name') + ->where('detail_penawaran.status', '=', 1) + ->get(); $data['status'] = 'success'; if ($penawaran) { - $i=0; - foreach($penawrandetails as $obj) - { + $i = 0; + foreach ($penawrandetails as $obj) { // dd($obj->dokumen_persetujuan); - if($obj->dokumen_persetujuan && Storage::disk('public')->exists($obj->dokumen_persetujuan)) - { + if ($obj->dokumen_persetujuan && Storage::disk('public')->exists($obj->dokumen_persetujuan)) { $penawrandetails_path = Storage::url($obj->dokumen_persetujuan); $penawrandetails[$i]->dokumen_persetujuan = $penawrandetails_path; $i++; } } - $kjpp=null; + $kjpp = null; $kjpp = KJPP::pluck('name', 'id'); $data['penawaran'] = $penawaran; $data['penawrandetails'] = $penawrandetails; @@ -157,33 +155,30 @@ class ProsesPenawaranController extends Controller $tindakan = null; if (request()->ajax()) { $validator = ProsesPenawaranController::rulesEditnya($request, $id); - + if ($validator['fails']) { $data['message'] = $validator['errors']; $data['status'] = 'error'; - } - else - { + } else { try { - $dataku = ['updated_by' => Auth::id(), - 'updated_at' => now(), - 'biaya_penawaran' => str_replace(".","",$request->biaya_penawaran) - ]; + $dataku = [ + 'updated_by' => Auth::id(), + 'updated_at' => now(), + 'biaya_penawaran' => str_replace(".", "", $request->biaya_penawaran) + ]; - if ($request->hasFile('dokumen_persetujuan')) - { + if ($request->hasFile('dokumen_persetujuan')) { $file_tmp = $request->file('dokumen_persetujuan'); $folderPath = 'uploads/penawaran/'; - if ($file_tmp->isValid()) - { - $myFile=$file_tmp->getClientOriginalName(); // nama file with extension + if ($file_tmp->isValid()) { + $myFile = $file_tmp->getClientOriginalName(); // nama file with extension $file_name = pathinfo($myFile, PATHINFO_FILENAME); // nama file without extension $extension = $file_tmp->getClientOriginalExtension(); // kjppID_penawaranID_namaFile_userID_time - $newFileName = $request->kjpp_rekanan_id.'_'.$id.'_'.$file_name.'_'.Auth::user()->id."_".time() .'.'. $extension; - Storage::disk('public')->put($folderPath.'/'.$newFileName,file_get_contents($file_tmp)); + $newFileName = $request->kjpp_rekanan_id . '_' . $id . '_' . $file_name . '_' . Auth::user()->id . "_" . time() . '.' . $extension; + Storage::disk('public')->put($folderPath . '/' . $newFileName, file_get_contents($file_tmp)); $newFileNameWithPath = $folderPath . $newFileName; $dataku['attachment'] = $myFile; @@ -195,26 +190,20 @@ class ProsesPenawaranController extends Controller $data['status'] = 'success'; $data['detailpenawaran_id'] = $id; $data['message'] = 'Proses Penawarn KJPP successfully'; - } - else - { + } else { $data['status'] = 'error'; $data['message'] = 'Silahkan upload file pdf'; } - } - else - { + } else { $data['status'] = 'error'; $data['message'] = 'Silahkan upload file'; } - } catch (Exception $e) { - + $data['status'] = 'error'; $data['message'] = 'Proses Penawarn KJPP failed.'; } } - } else { $data['status'] = 'error'; $data['message'] = 'no ajax request'; @@ -251,58 +240,51 @@ class ProsesPenawaranController extends Controller */ public function updateAll(Request $request, $id): JsonResponse { - // init + // init $data = array(); $dataku = array(); $model = PenawaranTender::findOrFail($id); $checkActiveDateRange = $this->checkActiveDateRangePenawaran($model->start_date, $model->end_date); - + // cek masa aktif penawaran - if($checkActiveDateRange) - { - - $checkKelengkapanDetailKJPP = $this->checkKelengkapanDetailKJPP($id); - if($checkKelengkapanDetailKJPP) - { + if ($checkActiveDateRange) { + + $checkKelengkapanDetailKJPP = $this->checkKelengkapanDetailKJPP($id); + if ($checkKelengkapanDetailKJPP) { DB::beginTransaction(); try { - $dataku = ['status' => 'tendered', + $dataku = [ + 'status' => 'tendered', 'updated_by' => Auth::id(), 'updated_at' => now() ]; - - $dataPermohonan = ['status' => 'tendered', + + $dataPermohonan = [ + 'status' => 'tendered', 'updated_by' => Auth::id(), 'updated_at' => now() ]; - - $permohonan = Permohonan::where('nomor_registrasi','=', $model->nomor_registrasi)->first(); - - $model->update($dataku); - $permohonan->update($dataPermohonan); - + + $permohonan = Permohonan::where('nomor_registrasi', '=', $model->nomor_registrasi)->first(); + + $model->update($dataku); + $permohonan->update($dataPermohonan); + DB::commit(); $data['message'] = "Sukses melakukan Proses Penawaran"; $data['status'] = 'success'; - } catch (Exception $e) { DB::rollBack(); // dd($e); $data['message'] = "Gagal melakukan Proses Penawaran"; $data['status'] = 'error'; } - - } - else - { + } else { $data['message'] = "Silahkan lengkapi data KJPP"; $data['status'] = 'error'; } - - } - else - { + } else { $data['message'] = "Penawaran sudah di tutup"; $data['status'] = 'error'; } @@ -316,57 +298,48 @@ class ProsesPenawaranController extends Controller $end_date = strtotime($end_date1); $todays_date = strtotime(now()); - $allow=true; - if ($todays_date >= $start_date && $todays_date <= $end_date) - { + $allow = true; + if ($todays_date >= $start_date && $todays_date <= $end_date) { //Penawaran dibuka - $allow=true; - } - else - { - if($todays_date < $start_date) - { + $allow = true; + } else { + if ($todays_date < $start_date) { //Penawaran Belum dibuka - $allow=true; - } - else - { + $allow = true; + } else { //Penawaran sudah ditutup - $allow=false; + $allow = false; } } - - return $allow; + return $allow; } public function checkKelengkapanDetailKJPP($id) { - $allow=true; + $allow = true; // DB::enableQueryLog(); // detail_penawaran apakah isian biaya_penawaran, attachment, dokumen_persetujuan sudah lengkap? $query = PenawaranDetailTender::select('id') - ->where('penawaran_id','=',$id) - ->where(function($query) { - $query->orWhere('biaya_penawaran', '', ""); - $query->orWhereNull('biaya_penawaran'); - - $query->orWhere('attachment', '', ""); - $query->orWhereNull('attachment'); + ->where('penawaran_id', '=', $id) + ->where(function ($query) { + $query->orWhere('biaya_penawaran', '', ""); + $query->orWhereNull('biaya_penawaran'); - $query->orWhere('dokumen_persetujuan', '', ""); - $query->orWhereNull('dokumen_persetujuan'); - })->get(); - // $sql = DB::getQueryLog(); - - - if (sizeof($query)>0) - { - $allow=false; - } + $query->orWhere('attachment', '', ""); + $query->orWhereNull('attachment'); + + $query->orWhere('dokumen_persetujuan', '', ""); + $query->orWhereNull('dokumen_persetujuan'); + })->get(); + // $sql = DB::getQueryLog(); + + + if (sizeof($query) > 0) { + $allow = false; + } return $allow; - } public function updateStatusPenawaranKJPP(Request $request, $id): JsonResponse @@ -377,19 +350,20 @@ class ProsesPenawaranController extends Controller try { $model = PenawaranDetailTender::findOrFail($id); - $data['id']=$id; + $data['id'] = $id; - $dataku = ['status' => '0', + $dataku = [ + 'status' => '0', 'updated_by' => Auth::id(), 'updated_at' => now() ]; - $model->update($dataku); + $model->update($dataku); $data['message'] = "Sukses delete Penawaran KJPP"; $data['status'] = 'success'; } catch (Exception $e) { - + // dd($e); $data['message'] = "Gagal delete Penawaran KJPP"; $data['status'] = 'error'; @@ -400,6 +374,6 @@ class ProsesPenawaranController extends Controller public function show($id) { $prosespenawaran = PenawaranTender::find($id); - return view('lpj::prosespenawaran.show', compact('id','prosespenawaran')); + return view('lpj::prosespenawaran.show', compact('id', 'prosespenawaran')); } } diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index b70a9b1..cc1822a 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -7,6 +7,22 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Modules\Lpj\Models\Permohonan; +use Modules\Lpj\Models\Branch; +use Modules\Lpj\Models\Surveyor; +use Modules\Lpj\Models\BentukTanah; +use Modules\Lpj\Models\KonturTanah; +use Modules\Location\Models\Province; +use Modules\Lpj\Models\PosisiKavling; +use Modules\Lpj\Models\KondisiFisikTanah; +use Modules\Lpj\Models\KetinggianTanah; +use Modules\Lpj\Models\SifatBangunan; +use Modules\Lpj\Models\JenisBangunan; +use Modules\Lpj\Models\KondisiBangunan; +use Modules\Lpj\Models\SpekBangunan; +use Modules\Lpj\Models\SpekKategoritBangunan; +use Modules\Lpj\Models\SaranaPelengkap; +use Modules\Lpj\Models\ArahMataAngin; +use Modules\Lpj\Http\Requests\SurveyorRequest; class SurveyorController extends Controller { @@ -19,21 +35,7 @@ class SurveyorController extends Controller return view('lpj::surveyor.index'); } - /** - * Show the form for creating a new resource. - */ - public function create() - { - return view('lpj::create'); - } - /** - * Store a newly created resource in storage. - */ - public function store(Request $request): RedirectResponse - { - // - } /** * Show the specified resource. @@ -49,10 +51,46 @@ class SurveyorController extends Controller 'debiture.village', 'branch', 'tujuanPenilaian', - 'penilaian' + 'penilaian', + 'documents', ], )->findOrFail($id); - return view('lpj::surveyor.detail', compact('permohonan')); + + $surveyor = $id; + $branches = Branch::all(); + $provinces = Province::all(); + $bentukTanah = BentukTanah::all(); + $konturTanah = KonturTanah::all(); + $posisiKavling = PosisiKavling::all(); + $ketinggianTanah = KetinggianTanah::all(); + $kondisiFisikTanah = KondisiFisikTanah::all(); + $jenisBangunan = JenisBangunan::all(); + $kondisiBangunan = KondisiBangunan::all(); + $sifatBangunan = SifatBangunan::all(); + $spekKategoriBagunan = SpekKategoritBangunan::all(); + $spekBangunan = SpekBangunan::all(); + $saranaPelengkap = SaranaPelengkap::all(); + $arahMataAngin = ArahMataAngin::all(); + + + return view('lpj::surveyor.detail', compact( + 'permohonan', + 'surveyor', + 'branches', + 'provinces', + 'bentukTanah', + 'konturTanah', + 'posisiKavling', + 'kondisiFisikTanah', + 'ketinggianTanah', + 'kondisiBangunan', + 'jenisBangunan', + 'sifatBangunan', + 'spekKategoriBagunan', + 'spekBangunan', + 'saranaPelengkap', + 'arahMataAngin', + )); } /** @@ -131,10 +169,372 @@ class SurveyorController extends Controller ]); } /** - * Remove the specified resource from storage. + * Form inspeksi. */ - public function destroy($id) + + public function formInspeksi($id) { - // + $permohonan = Permohonan::with( + [ + 'user', + 'debiture.province', + 'debiture.city', + 'debiture.district', + 'debiture.village', + 'branch', + 'tujuanPenilaian', + 'penilaian' + ], + )->findOrFail($id); + $branches = Branch::all(); + $provinces = Province::all(); + + return view('lpj::surveyor.detail', compact('permohonan', 'branches', 'provinces')); } + + /** + * Denah. + */ + + public function denah($id) + { + $permohonan = Permohonan::with( + [ + 'user', + 'debiture.province', + 'debiture.city', + 'debiture.district', + 'debiture.village', + 'branch', + 'tujuanPenilaian', + 'penilaian' + ], + )->findOrFail($id); + $surveyor = $id; + $branches = Branch::all(); + $provinces = Province::all(); + + return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces')); + } + + /** + * Foto. + */ + + public function foto($id) + { + $permohonan = Permohonan::with( + [ + 'user', + 'debiture.province', + 'debiture.city', + 'debiture.district', + 'debiture.village', + 'branch', + 'tujuanPenilaian', + 'penilaian' + ], + )->findOrFail($id); + $surveyor = $id; + $branches = Branch::all(); + $provinces = Province::all(); + + return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces')); + } + + /** + * Data pembanding. + */ + + public function dataPembanding($id) + { + $permohonan = Permohonan::with( + [ + 'user', + 'debiture.province', + 'debiture.city', + 'debiture.district', + 'debiture.village', + 'branch', + 'tujuanPenilaian', + 'penilaian' + ], + )->findOrFail($id); + $surveyor = $id; + $branches = Branch::all(); + $provinces = Province::all(); + + return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces')); + } + + + public function data(Request $request) + { + + $type = $request->route('type'); + + $headers = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'], + ]; + + $header = $headers[$type] ?? ''; + + return view('lpj::surveyor.data.index', compact('header')); + } + + + public function createData($type) + { + + $headers = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'], + ]; + + + $header = $headers[$type] ?? ''; + return view('lpj::surveyor.data.form', compact('header')); + } + + + public function storeData(SurveyorRequest $request, $type) + { + + $validate = $request->validated(); + if ($validate) { + + $type = $request->route('type'); + + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + ]; + + if (!array_key_exists($type, $modelClasses)) { + return redirect() + ->route('basicdata.'. $type .'.index') + ->with('error', 'Invalid type specified.'); + } + + $modelClass = $modelClasses[$type]; + $data = $request->all(); + $data['status'] = true; + $modelClass::create($data); + + return redirect() + ->route('basicdata.' . $type .'.index') + ->with('success', 'created successfully'); + } + } + + + public function editData($type, $id) + { + $dataMap = [ + 'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah', BentukTanah::class], + 'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah', KonturTanah::class], + 'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling', PosisiKavling::class], + 'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah', KetinggianTanah::class], + 'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah', KondisiFisikTanah::class], + 'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan', JenisBangunan::class], + 'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan', KondisiBangunan::class], + 'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan', SifatBangunan::class], + 'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class], + 'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class], + 'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class], + ]; + + + if (!array_key_exists($type, $dataMap)) { + return redirect()->back()->with('error', 'Invalid type specified.'); + } + + [$headers, $routeName, $modelClass] = $dataMap[$type]; + + $header = $dataMap[$type] ?? ''; + $model = $modelClass::findOrFail($id); + + return view('lpj::surveyor.data.form', compact('header', 'model')); + } + + + public function updateData(SurveyorRequest $request, $type, $id) + { + $validate = $request->validated(); + if ($validate) { + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + + ]; + + // Check if the provided type exists in the modelClasses + if (!array_key_exists($type, $modelClasses)) { + return redirect() + ->route('basicdata.' . $type . '.index') + ->with('error', 'Invalid type specified.'); + } + $modelClass = $modelClasses[$type]; + $model = $modelClass::findOrFail($id); + $model->update($validate); + + // Redirect back with a success message + return redirect() + ->route('basicdata.' . $type . '.index') + ->with('success', 'Updated successfully'); + } + + + } + + + + public function dataForDatatablesData(Request $request, $type) + { + if (is_null($this->user) || !$this->user->can('jenis_aset.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + + $models = [ + 'Bentuk Tanah' => BentukTanah::class, + 'Kontur Tanah' => KonturTanah::class, + 'Posisi Kavling' => PosisiKavling::class, + 'Ketinggian Tanah' => KetinggianTanah::class, + 'Kondisi Fisik Tanah' => KondisiFisikTanah::class, + 'Jenis Bangunan' => JenisBangunan::class, + 'Kondisi Bangunan' => KondisiBangunan::class, + 'Sifat Bangunan' => SifatBangunan::class, + // 'Spek Kategori Bangunan' => SpekKategoritBangunan::class, + // 'Spek Bangunan' => SpekBangunan::class, + 'Sarana Pelengkap' => SaranaPelengkap::class, + ]; + + + if (array_key_exists($type, $models)) { + $query = $models[$type]::query(); + } else { + throw new InvalidArgumentException("Invalid type: $type"); + } + + + // Apply search filter if provided + if ($request->has('search') && !empty($request->get('search'))) { + $search = $request->get('search'); + $query->where(function ($q) use ($search) { + $q->where('code', 'LIKE', "%$search%"); + $q->orWhere('name', 'LIKE', "%$search%"); + }); + } + + // Apply sorting if provided + if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) { + $order = $request->get('sortOrder'); + $column = $request->get('sortField'); + $query->orderBy($column, $order); + } + + // Get the total count of records + $totalRecords = $query->count(); + + // Apply pagination if provided + if ($request->has('page') && $request->has('size')) { + $page = $request->get('page'); + $size = $request->get('size'); + $offset = ($page - 1) * $size; // Calculate the offset + + $query->skip($offset)->take($size); + } + + // Get the filtered count of records + $filteredRecords = $query->count(); + + // Get the data for the current page + $data = $query->get(); + + // Calculate the page count + $pageCount = ceil($totalRecords / $request->get('size')); + + // Calculate the current page number + $currentPage = 0 + 1; + + // Return the response data as a JSON object + return response()->json([ + 'draw' => $request->get('draw'), + 'recordsTotal' => $totalRecords, + 'recordsFiltered' => $filteredRecords, + 'pageCount' => $pageCount, + 'page' => $currentPage, + 'totalCount' => $totalRecords, + 'data' => $data, + ]); + } + + public function destroy($id, $type) + { + try { + + $modelClasses = [ + 'bentuk-tanah' => BentukTanah::class, + 'kontur-tanah' => KonturTanah::class, + 'posisi-kavling' => PosisiKavling::class, + 'ketinggian-tanah' => KetinggianTanah::class, + 'kondisi-fisik-tanah' => KondisiFisikTanah::class, + 'jenis-bangunan' => JenisBangunan::class, + 'kondisi-bangunan' => KondisiBangunan::class, + 'sifat-bangunan' => SifatBangunan::class, + 'sarana-pelengkap' => SaranaPelengkap::class, + ]; + + + if (!array_key_exists($type, $modelClasses)) { + return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400); + } + + $modelClass = $modelClasses[$type]; + $model = $modelClass::findOrFail($id); + + $model->delete(); + return response()->json(['success' => true, 'message' => 'deleted successfully']); + } catch (ModelNotFoundException $e) { + return response()->json(['success' => false, 'message' => 'not found.'], 404); + } catch (Exception $e) { + return response()->json(['success' => false, 'message' => 'Failed to delete.'], 500); + } + } + + } diff --git a/app/Http/Controllers/TenderController.php b/app/Http/Controllers/TenderController.php index 22d6e1c..1ec30cb 100644 --- a/app/Http/Controllers/TenderController.php +++ b/app/Http/Controllers/TenderController.php @@ -395,11 +395,6 @@ class TenderController extends Controller ]); } - public function proses_penawaran_index() - { - return view('lpj::proses_penawaran/index'); - } - // Tambahkan method untuk API di controller public function checkPenawaranExistence($nomor_registrasi) { diff --git a/app/Http/Requests/SurveyorRequest.php b/app/Http/Requests/SurveyorRequest.php new file mode 100644 index 0000000..c86fb8a --- /dev/null +++ b/app/Http/Requests/SurveyorRequest.php @@ -0,0 +1,64 @@ +input('action'); + + $uniqueTable = [ + 'bentuk-tanah' => 'bentuk_tanah', + 'kontur-tanah' => 'kontur_tanah', + 'posisi-kavling' => 'posisi_kavling', + 'ketinggian-tanah' => 'ketinggian_tanah', + 'kondisi-fisik-tanah' => 'kondisi_fisik_tanah', + 'kondisi-bangunan' => 'kondisi_bangunan', + 'sifat-bangunan' => 'sifat_bangunan', + 'sarana-pelengkap' => 'sarana_pelengkap', + 'lalu_lintas_lokasi' => 'lalu_lintas_lokasi', + 'tingkat-keramaian' => 'tingkat_keramaian', + ]; + + + + $rules = [ + 'name' => 'required|max:255', + + ]; + + $id = $this->route('id'); + + if ($this->method() == 'PUT' || $this->method() == 'PATCH') { + $rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id; + } else { + + $rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code'; + } + return $rules; + } + + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } + + protected function prepareForValidation() + { + $this->merge([ + 'status' => true, + ]); + } +} diff --git a/app/Models/BentukTanah.php b/app/Models/BentukTanah.php new file mode 100644 index 0000000..38729af --- /dev/null +++ b/app/Models/BentukTanah.php @@ -0,0 +1,24 @@ +hasMany(PenawaranDetailTender::class, 'penawaran_id'); } + + // menambahkan relasi tujuan penilaian KJPP + public function tujuanPenilaianKJPP() + { + return $this->hasMany(TujuanPenilaianKJPP::class, 'id', 'tujuan_penilaian_kjpp_id'); + } } diff --git a/app/Models/PerkerasanJalan.php b/app/Models/PerkerasanJalan.php new file mode 100644 index 0000000..2f59e92 --- /dev/null +++ b/app/Models/PerkerasanJalan.php @@ -0,0 +1,22 @@ +belongsTo(SpekKategoriBangunan::class, 'spek_kategori_bangunan_id'); + } + + protected static function newFactory(): SpekBangunanFactory + { + //return SpekBangunanFactory::new(); + } + +} diff --git a/app/Models/SpekKategoritBangunan.php b/app/Models/SpekKategoritBangunan.php new file mode 100644 index 0000000..78b91e1 --- /dev/null +++ b/app/Models/SpekKategoritBangunan.php @@ -0,0 +1,28 @@ +hasMany(SpekBangunan::class, 'spek_kategori_bangunan_id'); + } + protected static function newFactory(): SpekKategoritBangunanFactory + { + //return SpekKategoritBangunanFactory::new(); + } +} diff --git a/app/Models/TingkatKeramaian.php b/app/Models/TingkatKeramaian.php new file mode 100644 index 0000000..19e6221 --- /dev/null +++ b/app/Models/TingkatKeramaian.php @@ -0,0 +1,22 @@ +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('bentuk_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php b/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php new file mode 100644 index 0000000..8cb2a13 --- /dev/null +++ b/database/migrations/2024_10_14_073319_create_kontur_tanah_table.php @@ -0,0 +1,37 @@ +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('kontur_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php b/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php new file mode 100644 index 0000000..5054b87 --- /dev/null +++ b/database/migrations/2024_10_14_073412_create_ketinggian_tanah_table.php @@ -0,0 +1,37 @@ +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('ketinggian_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php b/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php new file mode 100644 index 0000000..cdffe4d --- /dev/null +++ b/database/migrations/2024_10_14_073508_create_kontur_jalan_table.php @@ -0,0 +1,37 @@ +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('kontur_jalan'); + } +}; diff --git a/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php b/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php new file mode 100644 index 0000000..0a7ca0e --- /dev/null +++ b/database/migrations/2024_10_14_073527_create_posisi_kavling_table.php @@ -0,0 +1,37 @@ +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('posisi_kavling'); + } +}; diff --git a/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php b/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php new file mode 100644 index 0000000..32c021e --- /dev/null +++ b/database/migrations/2024_10_14_073550_create_kondisi_fisik_tanah_table.php @@ -0,0 +1,37 @@ +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('kondisi_fisik_tanah'); + } +}; diff --git a/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php b/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php new file mode 100644 index 0000000..8411dae --- /dev/null +++ b/database/migrations/2024_10_14_073631_create_jenis_bangunan_table.php @@ -0,0 +1,37 @@ +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('jenis_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php b/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php new file mode 100644 index 0000000..f7000b3 --- /dev/null +++ b/database/migrations/2024_10_14_073643_create_kondisi_bangunan_table.php @@ -0,0 +1,37 @@ +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('kondisi_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php b/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php new file mode 100644 index 0000000..e3ecf76 --- /dev/null +++ b/database/migrations/2024_10_14_073701_create_sifat_bangunan_table.php @@ -0,0 +1,37 @@ +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('sifat_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php b/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php new file mode 100644 index 0000000..1280a00 --- /dev/null +++ b/database/migrations/2024_10_14_074216_create_spek_kategori_bangunan_table.php @@ -0,0 +1,36 @@ +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('spek_kategori_bangunan'); + } +}; diff --git a/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php b/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php new file mode 100644 index 0000000..1cb8557 --- /dev/null +++ b/database/migrations/2024_10_14_074227_create_spek_bangunan_table.php @@ -0,0 +1,42 @@ +id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->foreignId('spek_kategori_bangunan_id')->constrained('spek_kategori_bangunan')->onDelete('cascade'); + $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::table('spek_bangunan', function (Blueprint $table) { + $table->dropForeign(['spek_kategori_bangunan_id']); + }); + Schema::dropIfExists('spek_bangunan'); + + } +}; diff --git a/database/migrations/2024_10_14_074246_create_spek_sarana_table.php b/database/migrations/2024_10_14_074246_create_spek_sarana_table.php new file mode 100644 index 0000000..1ba0692 --- /dev/null +++ b/database/migrations/2024_10_14_074246_create_spek_sarana_table.php @@ -0,0 +1,37 @@ +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('sarana_pelengkap'); + } +}; diff --git a/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php b/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php new file mode 100644 index 0000000..c064c5d --- /dev/null +++ b/database/migrations/2024_10_14_074326_create_perkerasan_jalan_table.php @@ -0,0 +1,37 @@ +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('perkerasan_jalan'); + } +}; diff --git a/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php b/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php new file mode 100644 index 0000000..4937eee --- /dev/null +++ b/database/migrations/2024_10_14_074403_create_lalu_lintas_lokasi_table.php @@ -0,0 +1,37 @@ +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('lalu_lintas_lokasi'); + } +}; diff --git a/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php b/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php new file mode 100644 index 0000000..d55bf01 --- /dev/null +++ b/database/migrations/2024_10_14_074432_create_gol_mas_sekitar_table.php @@ -0,0 +1,37 @@ +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('gol_mas_sekitar'); + } +}; diff --git a/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php b/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php new file mode 100644 index 0000000..fccbaa6 --- /dev/null +++ b/database/migrations/2024_10_14_074528_create_tingkat_keramaian_table.php @@ -0,0 +1,37 @@ +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('tingkat_keramaian'); + } +}; diff --git a/module.json b/module.json index 7b033cf..427bfca 100644 --- a/module.json +++ b/module.json @@ -6,7 +6,9 @@ "keywords": [], "priority": 0, "providers": ["Modules\\Lpj\\Providers\\LpjServiceProvider"], - "files": [], + "files": [ + "app/Helpers/Lpj.php" + ], "menu": { "main": [ { @@ -96,7 +98,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "so"] + "roles": ["administrator", "senior-officer"] }, { "title": "Team Activity", @@ -105,7 +107,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"] + "roles": ["senior-officer"] }, { "title": "Otorisator", @@ -114,7 +116,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"], + "roles": ["senior-officer"], "sub": [ { "title": "Pelaporan", @@ -122,7 +124,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"] + "roles": ["senior-officer"] }, { "title": "Pembayaran", @@ -130,7 +132,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"] + "roles": ["senior-officer"] }, { "title": "Pembatalan", @@ -138,7 +140,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"] + "roles": ["senior-officer"] }, { "title": "SLA", @@ -146,10 +148,19 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["so"] + "roles": ["ssenior-officero"] } ] }, + { + "title": "Surveyor", + "path": "surveyor", + "icon": "ki-filled ki-questionnaire-tablet text-lg", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, { "title": "Activity", @@ -158,7 +169,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin"] + "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin","surveyor"] }, { "title": "Laporan", @@ -167,7 +178,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "so"] + "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "senior-officer"] } ], "master": [ @@ -178,7 +189,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin"], + "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "surveyor"], "sub": [ { "title": "Cabang", @@ -282,7 +293,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "admin", "so"] + "roles": ["administrator", "admin", "senior-officer"] }, { "title": "Staff Appraisal", @@ -290,7 +301,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "so"] + "roles": ["administrator", "senior-officer"] }, { "title": "Jenis Penilaian", @@ -298,7 +309,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "admin", "so"] + "roles": ["administrator", "admin", "senior-officer"] }, { "title": "KJPP", @@ -308,6 +319,14 @@ "permission": "", "roles": ["administrator", "admin"] }, + { + "title": "Jenis Laporan", + "path": "basicdata.jenis_laporan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["Administrator", "admin"] + }, { "title": "Tujuan Penilaian KJPP", "path": "basicdata.tujuan_penilaian_kjpp", @@ -323,7 +342,81 @@ "attributes": [], "permission": "", "roles": ["administrator", "admin"] - } + }, + { + "title": "Bentuk Tanah", + "path": "basicdata.bentuk-tanah", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Kontur Tanah", + "path": "basicdata.kontur-tanah", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Posisi Kavling", + "path": "basicdata.posisi-kavling", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Ketinggian Tanah", + "path": "basicdata.ketinggian-tanah", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Kondisi Fisik Tanah", + "path": "basicdata.kondisi-fisik-tanah", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Jenis Bangunan", + "path": "basicdata.jenis-bangunan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Kondisi Bangunan", + "path": "basicdata.kondisi-bangunan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + { + "title": "Sifat Bangunan", + "path": "basicdata.sifat-bangunan", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + }, + + { + "title": "Sarana Pelengkap", + "path": "basicdata.sarana-pelengkap", + "classes": "", + "attributes": [], + "permission": "", + "roles": ["surveyor"] + } + ] } ], diff --git a/resources/views/Ijin_usaha/index.blade.php b/resources/views/Ijin_usaha/index.blade.php index 2d225d5..f3c7564 100644 --- a/resources/views/Ijin_usaha/index.blade.php +++ b/resources/views/Ijin_usaha/index.blade.php @@ -68,7 +68,6 @@ @endsection @push('scripts') - - - \ No newline at end of file + diff --git a/resources/views/authorization/index.blade.php b/resources/views/authorization/index.blade.php index 320d9bb..9c7a782 100644 --- a/resources/views/authorization/index.blade.php +++ b/resources/views/authorization/index.blade.php @@ -74,7 +74,6 @@ @endsection @push('scripts') - --}} @endpush diff --git a/resources/views/region/index.blade.php b/resources/views/region/index.blade.php index 2d0bd32..c510753 100644 --- a/resources/views/region/index.blade.php +++ b/resources/views/region/index.blade.php @@ -64,7 +64,6 @@ @push('scripts') - --}} +@endpush + + +
+ @if (isset($debitur->id)) + + @method('PUT') + @endif + @csrf + + + @if (false) + @include('lpj::surveyor.components.apartemen-kantor') + @else + @include('lpj::surveyor.components.tanah-bangunan') + @endif + + +
+
+

Analisis Lingkungan

+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ +
+ + + @error('perkerasanJalan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('laluLintasDepanLoaksi') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('golHidupSekitar') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('tingkatKeramaian') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('tataLetakArea') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ + @error('telahAdaBagunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('merupakanDaerah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('fasilitasUmumDekat') + {{ $message }} + @enderror +
+
+
+
+ + +
+
+

Analisis Fakta

+
+
+
+ +
+ + @error('faktorPositif') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('faktorNegatif') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('ruteMenuju') + {{ $message }} + @enderror +
+
+ +
+ +
+
+
+ +
+
+ +
+
+ + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kondisiLainTerkaitLingkungan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kondisiLainTerkaitBangunan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('informasiTerkaitDokumen') + {{ $message }} + @enderror +
+
+ +
+
+ + +
+ +
+

Informasi Dinas Tata Ruang

+
+ + +
+ +
+ +
+ + @error('peruntukan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('kdb') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + @error('kdh') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gsb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('maxLantai') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('klb') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('gss') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('pelebaranJalan') + {{ $message }} + @enderror +
+
+ +
+ +
+ + @error('petugasTK') + {{ $message }} + @enderror +
+
+
+ + +
+
+ +
+
+ + + +
+
+ +
+ +
+ + +
+
+

Catatan yang Perlu Diperhatikan

+ +
+
+
+ +
+ + +
+ +
+ + +@push('scripts') + + + + + +@endpush diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php new file mode 100644 index 0000000..9d39cd3 --- /dev/null +++ b/resources/views/surveyor/components/foto.blade.php @@ -0,0 +1,89 @@ +
+ @if (isset($debitur->id)) + + @method('PUT') + @endif + @csrf + +
+
+

Rute Menuju Lokasi

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

Objeck Jaminan

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

Linkungan

+ + + +
+
+ + +
+
+ +
+ + +@push('script') + + + +@endpush diff --git a/resources/views/surveyor/components/tanah-bangunan.blade.php b/resources/views/surveyor/components/tanah-bangunan.blade.php new file mode 100644 index 0000000..3ccb72f --- /dev/null +++ b/resources/views/surveyor/components/tanah-bangunan.blade.php @@ -0,0 +1,384 @@ +
+
+

Analisa Tanah

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('konturTanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('ketinggianTanah') + {{ $message }} + @enderror +
+
+ + + + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('posisiKavling') + {{ $message }} + @enderror +
+
+ + + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+
+
+ +
+
+

Analisa Bangunan

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('jenisBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('kondisiBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('sifatBangunan') + {{ $message }} + @enderror +
+
+ + +
+ +
+ +
+ @if (@isset($spekKategoriBagunan)) + @foreach ($spekKategoriBagunan as $item) +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror + +
+
+ @endforeach + + @endif + + + + +
+ + + +
+
+ + + + +
+ +
+ + + @error('saranaPelengkap') + {{ $message }} + @enderror +
+
+ +
+
diff --git a/resources/views/surveyor/data/form.blade.php b/resources/views/surveyor/data/form.blade.php new file mode 100644 index 0000000..26c6d14 --- /dev/null +++ b/resources/views/surveyor/data/form.blade.php @@ -0,0 +1,63 @@ +@extends('layouts.main') + +{{-- @section('breadcrumbs') + {{ Breadcrumbs::render(request()->route()->getName()) }} +@endsection --}} + +@section('content') +
+ @if (isset($model->id)) +
+ + @method('PUT') + @else + + @endif + @csrf +
+ +
+

+ {{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} {{ $header[0] }} +

+ +
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
+
+
+
+@endsection diff --git a/resources/views/surveyor/data/index.blade.php b/resources/views/surveyor/data/index.blade.php new file mode 100644 index 0000000..e359e7a --- /dev/null +++ b/resources/views/surveyor/data/index.blade.php @@ -0,0 +1,153 @@ +@extends('layouts.main') + +{{-- @section('breadcrumbs') + {{ Breadcrumbs::render('surveyor.bentuk-tanah') }} +@endsection --}} + +@section('content') +
+
+
+

+ Daftar {{$header[0]}} +

+
+
+ +
+
+
+ Export to Excel + + @php + $href = route('basicdata.createData', ['type' => $header[1]]); + @endphp + + Tambah {{$header[0]}} +
+
+
+
+
+ + + + + + + + + +
+ + + Code + + + Jenis Aset + + Action
+
+ +
+
+
+@endsection + +@push('scripts') + + +@endpush + diff --git a/resources/views/surveyor/detail.blade.php b/resources/views/surveyor/detail.blade.php index 885d5fb..6e9754f 100644 --- a/resources/views/surveyor/detail.blade.php +++ b/resources/views/surveyor/detail.blade.php @@ -148,15 +148,51 @@
- {{--
-

- Data Jaminan -

-
--}} +
+ -
-
+
+ @if(request()->routeIs('surveyor.show',$surveyor)) + @include('lpj::surveyor.components.form-inspeksi') + + @elseif(request()->routeIs('surveyor.denah',$surveyor)) + + @include('lpj::surveyor.components.denah') + + @elseif(request()->routeIs('surveyor.foto', $surveyor)) + @include('lpj::surveyor.components.foto') + + @elseif(request()->routeIs('surveyor.data-pembanding', $surveyor)) + + @include('lpj::surveyor.components.data-pembanding') + @endif +
+
@endsection + +@push('scripts') + + + +@endpush diff --git a/resources/views/surveyor/index.blade.php b/resources/views/surveyor/index.blade.php index 6006e88..04827dc 100644 --- a/resources/views/surveyor/index.blade.php +++ b/resources/views/surveyor/index.blade.php @@ -22,13 +22,13 @@
-
-
- Surveyor -
+ + +

- {{-- Daftar {{}} --}} + Surveyor

@@ -44,10 +44,6 @@
-
- -
diff --git a/resources/views/teams/index.blade.php b/resources/views/teams/index.blade.php index de782ec..a81d67c 100644 --- a/resources/views/teams/index.blade.php +++ b/resources/views/teams/index.blade.php @@ -68,7 +68,6 @@ @push('scripts') -