diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php index 2d2a379..6a4c032 100644 --- a/app/Helpers/Lpj.php +++ b/app/Helpers/Lpj.php @@ -1,10 +1,41 @@ address ? $alamat->address . ', ' : '') . - (isset($alamat->village) ? $alamat->village->name.', ' : '') . - (isset($alamat->city) ? $alamat->city->name.', ' : '') . - (isset($alamat->province) ? $alamat->province->name.', ' : '') . - ($alamat->postal_code ?? ''); - } +use Carbon\Carbon; + +function formatTanggalIndonesia($date) +{ + $carbonDate = Carbon::parse($date); + $indonesianMonths = [ + 'Januari', + 'Februari', + 'Maret', + 'April', + 'Mei', + 'Juni', + 'Juli', + 'Agustus', + 'September', + 'Oktober', + 'November', + 'Desember', + ]; + $month = $indonesianMonths[$carbonDate->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 5a19d19..cc1822a 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -8,7 +8,21 @@ 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 { @@ -21,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. @@ -51,16 +51,46 @@ class SurveyorController extends Controller 'debiture.village', 'branch', 'tujuanPenilaian', - 'penilaian' + 'penilaian', + 'documents', ], )->findOrFail($id); $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')); + return view('lpj::surveyor.detail', compact( + 'permohonan', + 'surveyor', + 'branches', + 'provinces', + 'bentukTanah', + 'konturTanah', + 'posisiKavling', + 'kondisiFisikTanah', + 'ketinggianTanah', + 'kondisiBangunan', + 'jenisBangunan', + 'sifatBangunan', + 'spekKategoriBagunan', + 'spekBangunan', + 'saranaPelengkap', + 'arahMataAngin', + )); } /** @@ -238,7 +268,273 @@ class SurveyorController extends Controller } + 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 de218f6..7977c0c 100644 --- a/module.json +++ b/module.json @@ -189,7 +189,7 @@ "classes": "", "attributes": [], "permission": "", - "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin"], + "roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "surveyor"], "sub": [ { "title": "Cabang", @@ -342,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/penawaran/show.blade.php b/resources/views/penawaran/show.blade.php index 3abf675..1e7b935 100644 --- a/resources/views/penawaran/show.blade.php +++ b/resources/views/penawaran/show.blade.php @@ -1,35 +1,3 @@ -@php - function formatTanggalIndonesia($date) - { - $carbonDate = \Carbon\Carbon::parse($date); - $indonesianMonths = [ - 'Januari', - 'Februari', - 'Maret', - 'April', - 'Mei', - 'Juni', - 'Juli', - 'Agustus', - 'September', - 'Oktober', - 'November', - 'Desember', - ]; - $month = $indonesianMonths[$carbonDate->month - 1]; - return $carbonDate->format('d') . ' ' . $month . ' ' . $carbonDate->format('Y'); - } - - function formatRupiah($number) - { - // Convert to float if the input is a string - $number = (float) $number; - - return 'Rp ' . number_format($number, 2, ',', '.'); - } -@endphp - - @extends('layouts.main') @section('breadcrumbs') @@ -199,4 +167,6 @@ - @endsection + + +@endsection diff --git a/resources/views/penilaian/form.blade.php b/resources/views/penilaian/form.blade.php index cd60966..07e7061 100644 --- a/resources/views/penilaian/form.blade.php +++ b/resources/views/penilaian/form.blade.php @@ -473,95 +473,6 @@ @endsection @push('scripts') - {{-- --}} @endpush diff --git a/resources/views/surveyor/components/apartemen-kantor.blade.php b/resources/views/surveyor/components/apartemen-kantor.blade.php new file mode 100644 index 0000000..b9c021a --- /dev/null +++ b/resources/views/surveyor/components/apartemen-kantor.blade.php @@ -0,0 +1,156 @@ +
+
+

Analisa Unit

+
+
+ + +
+ +
+
+ + +
+ + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ + +
+ +
+ + + @error('bentuk_tanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('konturTanah') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('ketinggianTanah') + {{ $message }} + @enderror +
+
+ + + + +
+ +
+ + + @error('posisiKavling') + {{ $message }} + @enderror +
+
+ + + +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+ +
+ +
+ + + @error('kondisiFisikTanah') + {{ $message }} + @enderror +
+
+
+
diff --git a/resources/views/surveyor/components/denah.blade.php b/resources/views/surveyor/components/denah.blade.php index 13986e2..07b158a 100644 --- a/resources/views/surveyor/components/denah.blade.php +++ b/resources/views/surveyor/components/denah.blade.php @@ -6,9 +6,20 @@ @csrf
-
- +
+ +
+
+ + + +
+ +
+
diff --git a/resources/views/surveyor/components/form-inspeksi.blade.php b/resources/views/surveyor/components/form-inspeksi.blade.php index 1619bd1..009e534 100644 --- a/resources/views/surveyor/components/form-inspeksi.blade.php +++ b/resources/views/surveyor/components/form-inspeksi.blade.php @@ -3,7 +3,7 @@ @endpush -
@if (isset($debitur->id)) @@ -12,649 +12,244 @@ @csrf -
-
-

Analisa Tanah

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

Analisa Bangunan

-
-
-
- - -
- - -
-
- - -
- -
- - - - - -
- - -
- -
-
- - -
- -
- - - - - -
-
- - -
- -
-
- - -
-
- - -
-
- - -
-
-
- - -
- -
- - - - -
- - -
-
- - -
-
-
- - -
- -
-
- - -
-
- - -
-
- - -
- -
- - -
-
- - -
-
-
- -
-
- + @if (false) + @include('lpj::surveyor.components.apartemen-kantor') + @else + @include('lpj::surveyor.components.tanah-bangunan') + @endif

Analisis Lingkungan

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

Lalulintas Depan Lokasi

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

Golongan Hidup Sekitar

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

Tingkat Keramaian

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

Terletak di Area

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

Struktur Letak

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

Dekat Makam

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

Dekat Tps

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

Merupakan daerah

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

Fasilitas Umum Ddekat Object

-
- - - - - - + +
+ +
+ + + @error('fasilitasUmumDekat') + {{ $message }} + @enderror
@@ -665,69 +260,90 @@

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
@@ -735,69 +351,121 @@
-
+

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 +
- +
+
- - -
+ +
@@ -805,9 +473,128 @@

Catatan yang Perlu Diperhatikan

- +
+
+ + +
+ + + +@push('scripts') + + + + + +@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 ee4a892..6e9754f 100644 --- a/resources/views/surveyor/detail.blade.php +++ b/resources/views/surveyor/detail.blade.php @@ -176,14 +176,7 @@ @include('lpj::surveyor.components.data-pembanding') @endif
-
- - -
+
@endsection diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 8b5a8b5..8e753e1 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -416,11 +416,6 @@ Breadcrumbs::for('tender.penawaran.editPenawaran', function (BreadcrumbTrail $tr $trail->push('Penawaran Ulang', route('tender.penawaran.editPenawaran', $noreg)); }); -Breadcrumbs::for('tender.proses.penawaran', function (BreadcrumbTrail $trail) { - $trail->parent('tender'); - $trail->push('Data Proses Penawaran', route('tender.proses_penawaran.index')); -}); - Breadcrumbs::for('tender.penawaran.ulang', function (BreadcrumbTrail $trail) { $trail->parent('tender'); diff --git a/routes/web.php b/routes/web.php index b3bb461..40bb21b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -357,7 +357,33 @@ Route::middleware(['auth'])->group(function () { Route::resource('jenis_laporan', JenisLaporanController::class); // End Activity Jenis Laporan route + // basic data surveyor + Route::get('datatablesSurveyory/{type}', [SurveyorController::class, 'dataForDatatablesData'])->name('datatablesSurveyory'); + Route::get('createData/{type}', [SurveyorController::class, 'createData'])->name('createData'); + Route::get('/{type}/{id}', [SurveyorController::class, 'editData'])->name('editData'); + Route::post('storeData/{type}', [SurveyorController::class, 'storeData'])->name('storeData'); + Route::put('updateData/{type}/{id}', [SurveyorController::class, 'updateData'])->name('updateData'); + Route::delete('deleteData/{id}/{type}', [SurveyorController::class, 'destroy'])->name('deleteData'); + $headers = [ + 'bentuk-tanah' => 'Bentuk Tanah', + 'kontur-tanah' => 'Kontur Tanah', + 'posisi-kavling' => 'Posisi Kavling', + 'ketinggian-tanah' => 'Ketinggian Tanah', + 'kondisi-fisik-tanah' => 'Kondisi Fisik Tanah', + 'jenis-bangunan' => 'Jenis Bangunan', + 'kondisi-bangunan' => 'Kondisi Bangunan', + 'sifat-bangunan' => 'Sifat Bangunan', + // 'spek-bangunan' => 'Speksifikasi Bangunan', + // 'spek-kategori-bagunan' => 'Speksifikasi Kategori Bangunan', + 'sarana-pelengkap' => 'Sarana Pelengkap', + ]; + + foreach ($headers as $type => $header) { + Route::get($type, [SurveyorController::class, 'data']) + ->name($type . '.index') + ->defaults('type', $type); + } }); Route::name('permohonan.')->prefix('permohonan')->group(function () { @@ -439,11 +465,6 @@ Route::middleware(['auth'])->group(function () { Route::get('penawaran/ulang/datatables', [TenderController::class, 'datatablesPenawaranUlang'])->name( 'penawaran.ulang.datatables', ); - - // Proses Penawaran - Route::get('proses_penawaran', [TenderController::class, 'proses_penawaran_index'])->name( - 'proses_penawaran.index', - ); }); Route::name('penilaian.')->prefix('penilaian')->group(function () { @@ -507,7 +528,6 @@ Route::middleware(['auth'])->group(function () { Route::get('foto/{id}', [SurveyorController::class, 'foto'])->name('foto'); Route::get('data-pembanding/{id}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding'); }); - }); require __DIR__ . '/registrasi.php';