From 27858b277db895dea558a3752e6a78deaa3a7667 Mon Sep 17 00:00:00 2001 From: Ilham Wara Nugroho Date: Wed, 11 Feb 2026 16:14:02 +0700 Subject: [PATCH] update --- .../Master/TabelDataController.php | 131 +++++++++++++++ .../Master/TabelDataKolomController.php | 148 +++++++++++++++++ app/Models/Master/TabelData.php | 15 ++ app/Models/Master/TabelDataKolom.php | 15 ++ ..._061057_create_master_table_data_table.php | 32 ++++ ..._061840_create_table_data_koloms_table.php | 35 ++++ resources/views/auth/login.blade.php | 7 +- resources/views/layouts/app.blade.php | 4 +- .../modules/dashboard/dashboard.blade.php | 156 ++++++++++++------ .../modules/master/tabel-data/form.blade.php | 61 +++++++ .../modules/master/tabel-data/index.blade.php | 88 ++++++++++ .../master/tabel-data/kolom/form.blade.php | 69 ++++++++ .../master/tabel-data/kolom/index.blade.php | 88 ++++++++++ routes/modules/modules.php | 16 ++ 14 files changed, 805 insertions(+), 60 deletions(-) create mode 100644 app/Http/Controllers/Master/TabelDataController.php create mode 100644 app/Http/Controllers/Master/TabelDataKolomController.php create mode 100644 app/Models/Master/TabelData.php create mode 100644 app/Models/Master/TabelDataKolom.php create mode 100644 database/migrations/2026_02_11_061057_create_master_table_data_table.php create mode 100644 database/migrations/2026_02_11_061840_create_table_data_koloms_table.php create mode 100644 resources/views/modules/master/tabel-data/form.blade.php create mode 100644 resources/views/modules/master/tabel-data/index.blade.php create mode 100644 resources/views/modules/master/tabel-data/kolom/form.blade.php create mode 100644 resources/views/modules/master/tabel-data/kolom/index.blade.php diff --git a/app/Http/Controllers/Master/TabelDataController.php b/app/Http/Controllers/Master/TabelDataController.php new file mode 100644 index 0000000..36e9334 --- /dev/null +++ b/app/Http/Controllers/Master/TabelDataController.php @@ -0,0 +1,131 @@ +route, 'module',true); + + $data['breadcrumbs'] = [ + ['name' => 'Dashboard','url' => url('dashboard')], + ['name' => 'Master Data'], + ['name' => 'Tabel Data','active' => true], + ]; + + $data['title'] = $this->title; + $data['route'] = $this->route; + + return view($this->template.'.index',$data); + } + + public function grid(Request $request) + { + + $data = TabelData::orderBy('MsTabelDataId','ASC')->get(); + // $data = User::with(['group'])->orderBy('id','DESC')->get(); + $_data = []; + + + foreach ($data as $key => $row) { + + $action = ''; + + if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){ + $action .= '
'; + $action .= ''; + $action .= ''; + if((session('group_id') == 1) || (session('group_alias') == 'admin')){ + // $action .= ''; + } + $action .= '
'; + } + + $_data[] = [ + 'no' => $key+1, + 'id' => encode_id($row->MsTabelDataId), + 'name' => @$row->name, + 'key' => @$row->key, + 'tahun' => @$row->tahun, + 'nomor_tabel' => @$row->nomor_tabel, + 'jml_kolom' => TabelDataKolom::where('ms_tabel_data_id',$row->MsTabelDataId)->count(), + 'action' => @$action, + ]; + + } + + // return response()->json($_data); // Return the data as a JSON response + return response()->json($_data); + + } + + public function update($id = null) + { + $data['breadcrumbs'] = [ + ['name' => 'Dashboard','url' => url('dashboard')], + ['name' => 'Master Data'], + ['name' => 'Tabel Data','active' => true], + ]; + + $keyId = decode_id($id); + $data['title'] = $this->title; + $data['route'] = $this->route; + $data['keyId'] = $id; + // $data['item'] = TabelData::where('MsTabelDataId',$keyId)->first(); + + return view($this->template.'.form',$data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/app/Http/Controllers/Master/TabelDataKolomController.php b/app/Http/Controllers/Master/TabelDataKolomController.php new file mode 100644 index 0000000..1b84370 --- /dev/null +++ b/app/Http/Controllers/Master/TabelDataKolomController.php @@ -0,0 +1,148 @@ +route, 'module',true); + + $data['breadcrumbs'] = [ + ['name' => 'Dashboard','url' => url('dashboard')], + ['name' => 'Master Data'], + ['name' => 'Tabel Data'], + ['name' => 'Tabel Data Kolom','active' => true], + ]; + + $data['title'] = $this->title; + $data['route'] = $this->route; + $data['keyId'] = $id; + + return view($this->template.'.index',$data); + } + + public function grid(Request $request,$id = null) + { + + $data = TabelDataKolom::where('ms_tabel_data_id',decode_id($id))->orderBy('order','ASC')->get(); + // $data = User::with(['group'])->orderBy('id','DESC')->get(); + $_data = []; + + + foreach ($data as $key => $row) { + + $action = ''; + + if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){ + $action .= '
'; + $action .= ''; + if((session('group_id') == 1) || (session('group_alias') == 'admin')){ + // $action .= ''; + } + $action .= '
'; + } + + $_data[] = [ + 'no' => $key+1, + 'id' => encode_id($row->MsTabelDataKolomId), + 'name' => @$row->name, + 'key' => @$row->key, + 'order' => @$row->order, + 'action' => @$action, + ]; + + } + + // return response()->json($_data); // Return the data as a JSON response + return response()->json($_data); + + } + + public function update($id = null,$kolomId = null) + { + $data['breadcrumbs'] = [ + ['name' => 'Dashboard','url' => url('dashboard')], + ['name' => 'Master Data'], + ['name' => 'Tabel Data','active' => true], + ]; + + $keyId = decode_id($kolomId); + $data['title'] = $this->title; + $data['route'] = $this->route; + $data['keyId'] = $kolomId; + $data['tabelId'] = $id; + $data['item'] = TabelDataKolom::where('MsTabelDataKolomId',$keyId)->first(); + + return view($this->template.'.form',$data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + if(@$request->secure_id){ + $item = TabelDataKolom::find(decode_id($request->secure_id)); + $item->name = $request->name; + $item->key = $request->key; + $item->order = $request->order; + $item->save(); + }else{ + $item = new TabelDataKolom; + $item->ms_tabel_data_id = decode_id($request->tabelId); + $item->name = $request->name; + $item->key = $request->key; + $item->order = $request->order; + $item->save(); + } + + return redirect()->back()->with([ + 'message' => 'Berhasil update data', + 'type' => 'success', + ]); + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/app/Models/Master/TabelData.php b/app/Models/Master/TabelData.php new file mode 100644 index 0000000..9415d03 --- /dev/null +++ b/app/Models/Master/TabelData.php @@ -0,0 +1,15 @@ +id('MsTabelDataId'); + $table->string('nomor_tabel')->nullable(); + $table->year('tahun'); + $table->string('name'); + $table->string('key')->nullable(); + $table->timestampsTz(); + $table->softdeletesTz(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('ms_table_data'); + } +}; diff --git a/database/migrations/2026_02_11_061840_create_table_data_koloms_table.php b/database/migrations/2026_02_11_061840_create_table_data_koloms_table.php new file mode 100644 index 0000000..a9e0fdd --- /dev/null +++ b/database/migrations/2026_02_11_061840_create_table_data_koloms_table.php @@ -0,0 +1,35 @@ +id('MsTabelDataKolomId'); + $table->integer('ms_tabel_data_id'); + $table->string('name')->nullable(); + $table->string('key')->nullable(); + $table->string('order')->nullable(); + $table->integer('status')->default(1); + $table->timestampsTz(); + $table->softdeletesTz(); + + $table->foreign('ms_tabel_data_id')->references('MsTabelDataId')->on('ms_tabel_data')->cascadeOnDelete(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('table_data_koloms'); + } +}; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index cc01b80..bef989d 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -3,7 +3,7 @@ - Login | DIKPLHD + Login | SLHD @@ -36,8 +36,9 @@
-

DIKPLHD

-

Dinas Lingkungan Hidup Provinsi DKI Jakarta

+

SLHD

+

Status Lingkungan Hidup Daerah

+ {{--

Dinas Lingkungan Hidup Provinsi DKI Jakarta

--}}
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index fcf4ff7..1ac648e 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -3,7 +3,7 @@ - DIKPLHD | Dinas Lingkungan Hidup + SLHD | Dinas Lingkungan Hidup @@ -148,7 +148,7 @@ logo
-

DIKPLHD

+

SLHD

Dinas Lingkungan Hidup Provinsi DKI Jakarta

diff --git a/resources/views/modules/dashboard/dashboard.blade.php b/resources/views/modules/dashboard/dashboard.blade.php index fe083a9..2a10b31 100644 --- a/resources/views/modules/dashboard/dashboard.blade.php +++ b/resources/views/modules/dashboard/dashboard.blade.php @@ -1,65 +1,93 @@ @extends('layouts.master') +@section('css') + + +@endsection @section('content') -
-

Dashboard

-
- +{{--
--}} + {{--

Dashboard

--}} +{{--
--}} -@if((session('group_id') == 1) || (session('group_alias') == 'admin')) -
- @foreach($group as $dataGroup) - alias == 'dinas'){ - $bg = 'success'; - // }elseif(@$dataGroup->alias == 'biro'){ - // $bg = 'warning'; - // }elseif(@$dataGroup->alias == 'badan'){ - // $bg = 'danger'; - // }elseif(@$dataGroup->alias == 'deputi'){ - // $bg = 'info'; - // } - - ?> -