diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php new file mode 100644 index 0000000..5be59bd --- /dev/null +++ b/app/Http/Controllers/RealisasiBelanjaController.php @@ -0,0 +1,178 @@ +siteTitle = "Realisasi Belanja"; + parent::__construct(); + } + + public function index() + { + return view('realisasi_belanja.index') + ->with('i', (request()->input('page', 1) - 1) * 10); + } + + public function create() + { + // if (!Auth::user()->can("Tambah SKPP")){ + // abort(403, 'Youre not allowed to visit this page!'); + // } + $this->setSubtitle("Tambah Data"); + return view('realisasi_belanja.create'); + } + + public function store(Request $request) + { + try{ + $date = date("Ymd"); + DB::beginTransaction(); + + $req = $request->all(); + $data["tahun"] = $req["txt_ta"]; + $data["id_sps"] = $req["txt_id_sps"]; + $txt_rek_sps = explode("|",$req["txt_rek_sps"]); + $data["kode_rekening_sps"] = $txt_rek_sps[0]; + $data["nama_rekening_sps"] = $txt_rek_sps[1]; + $data["simtrad4_uraian"] = $req["txt_simtrad4_uraian"]; + $data["simtrad4_kotor"] = replaceMoney($req["txt_simtrad4_kotor"]); + $data["simtrad4_potongan"] = replaceMoney($req["txt_simtrad4_potongan"]); + $data["simtrad4_bersih"] = replaceMoney($req["txt_simtrad4_bersih"]); + $data["simtrad4_sp2d_bun"] = $req["txt_simtrad4_sp2d_bun"]; + $data["created_by"] = Auth::user()->id; + //var_dump($data); exit; + DbhPendapatanRealisasi::create($data); + DB::commit(); + + return redirect()->route('realisasi-pendapatan.index') + ->with('success','Realisasi Pendapatan berhasil dibuat.'); + }catch(\Exception $e){ + + DB::rollBack(); + return redirect()->route('realisasi-pendapatan.create') + ->with('error',$e->getMessage()); + } + } + + public function edit(DbhPendapatanRealisasi $realisasi_belanja) + { + $this->setSubtitle("Ubah Data"); + return view('realisasi_belanja.edit',compact('realisasi_belanja')); + } + + public function update(Request $request, DbhPendapatanRealisasi $realisasi_belanja) + { + try{ + + DB::beginTransaction(); + + $req = $request->all(); + $data["tahun"] = $req["txt_ta"]; + $data["id_sps"] = $req["txt_id_sps"]; + $txt_rek_sps = explode("|",$req["txt_rek_sps"]); + $data["kode_rekening_sps"] = $txt_rek_sps[0]; + $data["nama_rekening_sps"] = $txt_rek_sps[1]; + $data["simtrad4_uraian"] = $req["txt_simtrad4_uraian"]; + $data["simtrad4_kotor"] = replaceMoney($req["txt_simtrad4_kotor"]); + $data["simtrad4_potongan"] = replaceMoney($req["txt_simtrad4_potongan"]); + $data["simtrad4_bersih"] = replaceMoney($req["txt_simtrad4_bersih"]); + $data["simtrad4_sp2d_bun"] = $req["txt_simtrad4_sp2d_bun"]; + $data["updated_by"] = Auth::user()->id; + $realisasi_belanja->update($data); + + DB::commit(); + + return redirect()->route('realisasi-pendapatan.index') + ->with('success','Realisasi Pendapatan berhasil diubah.'); + }catch(Throwable $e){ + + DB::rollBack(); + return redirect()->route('tx-salurdana.index') + ->with('error','Realisasi Pendapatan gagal diubah!'); + } + } + + public function datatable(Request $request) + { + $post = $request->all(); + $offset = $post["start"]; + $limit = $post["length"]; + $src = $post["src"]; + $ta = $post["ta"]; + + $dataFilter=0; + $data = DbhPendapatanRealisasi::orderBy("created_at","ASC"); + if (!empty($src)){ + $data->whereRaw("(LOWER(simtrad4_uraian) LIKE '%".strtolower($src)."%')"); + } + $dataFilter = $data->count(); + $dataTotal = DbhPendapatanRealisasi::count(); + + return response()->json([ + "recordsTotal" => $dataTotal, + "recordsFiltered" => $dataFilter, + "data"=> $data->skip($offset)->take($limit)->get() + ]); + } + + public function destroy(DbhPendapatanRealisasi $realisasi_belanja) + { + try{ + DB::beginTransaction(); + $realisasi_belanja->delete(); + DB::commit(); + return redirect()->route('realisasi-pendapatan.index') + ->with('success','Data Realisasi Pendapatan berhasil dihapus!'); + + }catch(Throwable $e){ + + DB::rollBack(); + return redirect()->route('realisasi-pendapatan.index') + ->with('error','Data Realisasi Pendapatan gagal dihapus.'); + } + } + + public function show(DbhPendapatanRealisasi $realisasi_belanja) + { + // if (!Auth::user()->can("Lihat SKPP")){ + // abort(403, 'Youre not allowed to visit this page!'); + // } + $this->setSubtitle("Detail Data"); + return view('realisasi_belanja.show',compact("realisasi_belanja")); + } + + public function upload(Request $request) + { + $method = $request->method(); + $this->setSubtitle("Upload Data"); + if ($request->isMethod('post')) { + $req = $request->all(); + try{ + $this->validate($request, [ + 'file' => 'required', + ]); + + $file = $request->file('file'); + // echo 'File Name: '.$file->getClientOriginalName(); + // echo 'File Extension: '.$file->getClientOriginalExtension(); + // echo 'File Real Path: '.$file->getRealPath(); + // echo 'File Size: '.$file->getSize(); + // echo 'File Mime Type: '.$file->getMimeType(); + $tujuan_upload = 'uploadFiles'; + $file->move($tujuan_upload,$file->getClientOriginalName()); + }catch(\Exception $e){ + } + } + return view('realisasi_belanja.upload'); + } + +} diff --git a/config/database.php b/config/database.php index 5906394..ab3414f 100644 --- a/config/database.php +++ b/config/database.php @@ -15,7 +15,7 @@ return [ | */ - 'default' => env('DB_CONNECTION', 'mysql'), + 'default' => env('DB_CONNECTION', 'Samasa'), /* |-------------------------------------------------------------------------- @@ -91,6 +91,18 @@ return [ 'prefix_indexes' => true, ], + 'Samasa' => [ + 'driver' => 'oracle', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1521'), + 'database' => env('DB_DATABASE', 'xe'), + 'service_name' => env('DB_SERVICENAME', 'xe'), + 'username' => env('DB_USERNAME', 'hr'), + 'password' => env('DB_PASSWORD', 'hr'), + 'charset' => '', + 'prefix' => '', + ], + 'oracle' => [ 'driver' => 'oracle', 'host' => env('ORA_HOST', 'localhost'), diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index b7ac422..d46a08b 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -14,8 +14,8 @@ class DatabaseSeeder extends Seeder public function run() { // \App\Models\User::factory(10)->create(); - //$this->call(PermissionSeeder::class); - //$this->call(RolesTableSeeder::class); + // $this->call(PermissionSeeder::class); + // $this->call(RolesTableSeeder::class); $this->call(UsersTableSeeder::class); } } diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php index 935d136..c143b45 100644 --- a/database/seeders/UsersTableSeeder.php +++ b/database/seeders/UsersTableSeeder.php @@ -17,46 +17,46 @@ class UsersTableSeeder extends Seeder */ public function run() { - User::truncate(); + // User::truncate(); - $user = new User; - $user->name = "Superadmin"; - $user->nrk = "superadmin"; - $user->password = Hash::make('superadmin123!'); - $user->save(); + // $user = new User; + // $user->name = "Superadmin"; + // $user->nrk = "superadmin"; + // $user->password = Hash::make('superadmin123!'); + // $user->save(); - $user->assignRole('superadmin'); + // $user->assignRole('superadmin'); - $user = new User; - $user->name = "admin"; - $user->nrk = "admin"; - $user->password = Hash::make('admin321!'); - $user->save(); + // $user = new User; + // $user->name = "admin"; + // $user->nrk = "admin"; + // $user->password = Hash::make('admin321!'); + // $user->save(); - $user->assignRole('admin'); + // $user->assignRole('admin'); - $user = new User; - $user->name = "anggaran"; - $user->nrk = "anggaran"; - $user->password = Hash::make('anggaran321'); - $user->save(); + // $user = new User; + // $user->name = "anggaran"; + // $user->nrk = "anggaran"; + // $user->password = Hash::make('anggaran321'); + // $user->save(); - $user->assignRole('anggaran'); + // $user->assignRole('anggaran'); - $user = new User; - $user->name = "skpd"; - $user->nrk = "skpd"; - $user->password = Hash::make('skpd321'); - $user->save(); + // $user = new User; + // $user->name = "skpd"; + // $user->nrk = "skpd"; + // $user->password = Hash::make('skpd321'); + // $user->save(); - $user->assignRole('skpd'); + // $user->assignRole('skpd'); - $user = new User; - $user->name = "bendahara"; - $user->nrk = "bendahara"; - $user->password = Hash::make('bendahara321'); - $user->save(); + // $user = new User; + // $user->name = "bendahara"; + // $user->nrk = "bendahara"; + // $user->password = Hash::make('bendahara321'); + // $user->save(); - $user->assignRole('bendahara'); + // $user->assignRole('bendahara'); } } diff --git a/public/uploadFiles/#1 10 Sebab Penggugur Dosa.pdf b/public/uploadFiles/#1 10 Sebab Penggugur Dosa.pdf new file mode 100644 index 0000000..3cc73cf Binary files /dev/null and b/public/uploadFiles/#1 10 Sebab Penggugur Dosa.pdf differ diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index 870b1d1..2e9657a 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -7,7 +7,7 @@ --}}
-
+