diff --git a/app/Http/Controllers/Admin/MstJenisBelanjaController.php b/app/Http/Controllers/Admin/MstJenisBelanjaController.php
new file mode 100644
index 0000000..1c2ec2f
--- /dev/null
+++ b/app/Http/Controllers/Admin/MstJenisBelanjaController.php
@@ -0,0 +1,155 @@
+siteTitle = "Master Jenis Belanja";
+ parent::__construct();
+ }
+
+ public function index()
+ {
+ $data = null;
+ // $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
+ return view('admin.mst_jenis_belanja.index',compact('data'))
+ ->with('i', (request()->input('page', 1) - 1) * 10);
+ }
+
+ public function create()
+ {
+ $this->setSubtitle("Tambah Data");
+ return view('admin.mst_jenis_belanja.create');
+ }
+
+ public function create_sub(MstJenisBelanja $MstJenisBelanja)
+ {
+ $this->setSubtitle("Tambah Data Sub Jenis Belanja [".$MstJenisBelanja->name." ] ");
+ return view('admin.mst_jenis_belanja.create_sub',compact("MstJenisBelanja"));
+ }
+
+ public function store(Request $request)
+ {
+ $request->validate([
+ 'name' => 'required',
+ ]);
+
+ $req = $request->all();
+ MstJenisBelanja::where("name", $req["name"])->delete();
+ $data["name"] = $req["name"];
+ $data["description"] = $req["description"];
+ MstJenisBelanja::create($data);
+
+ return redirect("/admin/MstJenisBelanja")->with('success','Jenis Belanja berhasil dibuat.');
+ }
+
+ public function store_sub(Request $request)
+ {
+ $request->validate([
+ 'name' => 'required',
+ 'id_jenis_belanja' => 'required'
+ ]);
+
+ $req = $request->all();
+ MstSubJenisBelanja::where("name", $req["name"])->where("id_jenis_belanja", $req["id_jenis_belanja"])->delete();
+ $data["id_jenis_belanja"] = $req["id_jenis_belanja"];
+ $data["name"] = $req["name"];
+ $data["description"] = $req["description"];
+ MstSubJenisBelanja::create($data);
+
+ return redirect("/admin/MstJenisBelanja/".$data["id_jenis_belanja"])->with('success','Sub Jenis Belanja berhasil dibuat.');
+ }
+
+ public function show(MstJenisBelanja $MstJenisBelanja)
+ {
+ $SubJenisBelanja = MstSubJenisBelanja::where("id_jenis_belanja",$MstJenisBelanja->id)->get();
+ $this->setSubtitle("Detail Jenis Belanja");
+ return view('admin.mst_jenis_belanja.show',compact('MstJenisBelanja','SubJenisBelanja'));
+ }
+
+ public function edit(User $user)
+ {
+ $this->setSubtitle("Ubah Data");
+ return view('admin.mst_jenis_belanja.edit',compact('user'));
+ }
+
+ public function update(Request $request, User $user)
+ {
+ $request->validate([
+ 'name' => 'required',
+ 'opt_role' => 'required'
+ ]);
+
+ $requestAll = $request->all();
+ $requestAll["role_name"] = $requestAll["opt_role"];
+ $user->update($requestAll);
+
+ $user->roles()->detach();
+ // $user->removeRole($requestAll["opt_role"]);
+ $user->assignRole($requestAll["opt_role"]);
+
+ return redirect()->route('users.index')
+ ->with('success','Data Jenis Belanja berhasil diubah!');
+ }
+
+ public function destroy(User $user)
+ {
+ $user->delete();
+
+ return redirect()->route('users.index')
+ ->with('success','Data Jenis Belanja berhasil dihapus!');
+ }
+
+ public function datatable(Request $request)
+ {
+ $post = $request->all();
+ $offset = $post["start"];
+ $limit = $post["length"];
+ $src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
+ $select = DB::raw("ID,NAME,DESCRIPTION");
+ $sqlstr = MstJenisBelanja::select($select);
+ $dataTotal = $sqlstr->count();
+ $data = $sqlstr->orderBy("ID");
+ if (!empty($src)){
+ $data->whereRaw(" ( lower(NAME) like '%$src%' OR lower(DESCRIPTION) like '%$src%' ) ");
+ }
+ $dataFilter = $data->count();
+
+ return response()->json([
+ "recordsTotal" => $dataTotal,
+ "recordsFiltered" => $dataFilter,
+ "data"=> $data->skip($offset)->take($limit)->get()
+ ]);
+ }
+
+ public function datatableSubJenisBelanja(Request $request, $id)
+ {
+ $post = $request->all();
+ $offset = $post["start"];
+ $limit = $post["length"];
+ $src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
+ $select = DB::raw("ID,NAME,DESCRIPTION");
+ $sqlstr = MstSubJenisBelanja::select($select)->where("id_jenis_belanja", $id);
+ $dataTotal = $sqlstr->count();
+ $data = $sqlstr->orderBy("ID");
+ if (!empty($src)){
+ $data->whereRaw(" ( lower(NAME) like '%$src%' OR lower(DESCRIPTION) like '%$src%' ) ");
+ }
+ $dataFilter = $data->count();
+
+ return response()->json([
+ "recordsTotal" => $dataTotal,
+ "recordsFiltered" => $dataFilter,
+ "data"=> $data->skip($offset)->take($limit)->get()
+ ]);
+ }
+
+}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index e8cedb6..d624a85 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -58,8 +58,7 @@ class Controller extends BaseController
public function readNotif($idUnik)
{
- $notif = Notifikasi::where(["id_unik"=>$idUnik, "userid"=>Auth::user()->id])->firstOrNew();
- $notif->update(["is_read"=>1]);
+ Notifikasi::query()->where(["id_unik"=>$idUnik, "userid"=>Auth::user()->id])->update(["is_read"=>1]);
}
}
diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php
index f5389f7..ba75d8b 100644
--- a/app/Http/Controllers/RealisasiBelanjaController.php
+++ b/app/Http/Controllers/RealisasiBelanjaController.php
@@ -50,7 +50,6 @@ class RealisasiBelanjaController extends Controller
public function submit(Request $request, $id)
{
-
$BelanjaRealisasi = BelanjaRealisasi::where("id", $id)->firstOrNew();
// var_dump($BelanjaRealisasi->kode_rsk,$BelanjaRealisasi->kode_sub_kegiatan); exit;
$this->setTitle("Realisasi Belanja");
@@ -67,22 +66,24 @@ class RealisasiBelanjaController extends Controller
$vwAKB = VwAkbSpdRealRsk::where("I_IDRSK",$BelanjaRealisasi->kode_rsk)->firstorNew();
$BelanjaRealisasiKontrak = BelanjaRealisasiKontrak::where("belanja_realisasi_id",$id)->get();
$vwSPD = DB::select(DB::raw(
- "SELECT x.I_SPDNO_DOK, x.D_SPDNO, z.V_SPP AS JML
+ "SELECT x.I_SPDNO_DOK, x.D_SPDNO, sum(z.V_SPP) AS JML
FROM NEWSIPKD.TMSPD x
LEFT JOIN NEWSIPKD.TMSPPRINCIBLJ y ON x.I_ID = y.I_IDSPD
LEFT JOIN NEWSIPKD.TMSPPRINCIBLJRSK z ON y.I_IDSPP = z.I_IDSPP
- WHERE z.I_IDRSK=".$BelanjaRealisasi->kode_rsk
+ WHERE z.I_IDRSK=".$BelanjaRealisasi->kode_rsk."GROUP BY x.I_SPDNO_DOK, x.D_SPDNO ORDER BY x.D_SPDNO "
));
- $vwSP2D = DB::select(DB::raw('SELECT x.I_ID as IDSP2D, x.I_IDOPD,x.I_SP2DNO_DOK,
- TO_CHAR(x.D_SP2D_SAH,\'DD-MM-YYYY\') AS D_SP2D_SAH,x.V_SPP
+ $vwSP2D = DB::select(DB::raw('SELECT x.I_ID as IDSP2D, x.I_SP2DNO_DOK,
+ TO_CHAR(x.D_SP2D_SAH,\'DD-MM-YYYY\') AS D_SP2D_SAH, sum(y.V_SPP) as V_SPP
FROM NEWSIPKD.TMSP2D x
- LEFT JOIN NEWSIPKD.TMSPPRINCIBLJRSK y
- ON x.I_IDSPP = y.I_IDSPP
- WHERE C_SP2D_SAH=1 AND y.I_IDRSK='.$BelanjaRealisasi->kode_rsk.' ORDER BY x.D_SP2D_SAH ' )
+ LEFT JOIN NEWSIPKD.V_SPPBLJRSK y
+ ON x.I_ID = y.I_IDSP2D
+ WHERE y.I_IDRSK='.$BelanjaRealisasi->kode_rsk.' GROUP BY x.I_ID, x.I_SP2DNO_DOK,x.D_SP2D_SAH ORDER BY x.D_SP2D_SAH ' )
);
$unitSatuan = UnitSatuan::orderBy("id")->get();
- return view('realisasi_belanja.submit', compact("BelanjaRealisasi","BelanjaRealisasiKontrak","vwAKB","vwSPD","vwSP2D","unitSatuan"));
+ $jmlRealisasi = DB::select(DB::raw("SELECT sum(REALISASI) as jml FROM NEWSIPKD.VW_BKU_REALISASI_RSK WHERE IDRSK = ".$BelanjaRealisasi->kode_rsk));
+ $jmlRealisasi = $jmlRealisasi[0]->jml;
+ return view('realisasi_belanja.submit', compact("BelanjaRealisasi","BelanjaRealisasiKontrak","vwAKB","vwSPD","vwSP2D","unitSatuan","jmlRealisasi"));
}
public function datatable(Request $request)
diff --git a/app/Http/Controllers/RealisasiPendapatanController.php b/app/Http/Controllers/RealisasiPendapatanController.php
index c2e28b8..2b6852d 100644
--- a/app/Http/Controllers/RealisasiPendapatanController.php
+++ b/app/Http/Controllers/RealisasiPendapatanController.php
@@ -196,7 +196,7 @@ class RealisasiPendapatanController extends Controller
$userAnggaran = array_column($userAnggaran,"id");
$url = URL::to("/realisasi-pendapatan/".$realisasiId);
$message = "Realisasi Pendapatan dengan No. SP2D BUN ".$data["simtrad4_sp2d_bun"]." telah divalidasi oleh Bidang Perben!";
- $this->sendNotif("anggaran", "bendahara", $userAnggaran, $message, $url, "Realisasi Pendapatan", $data->id);
+ $this->sendNotif("bendahara", "anggaran", $userAnggaran, $message, $url, "Realisasi Pendapatan", $data->id);
return redirect(URL::to("/realisasi-pendapatan"))->with('success','STS berhasil diinput.');
}catch(\Exception $e){
diff --git a/app/Models/MstJenisBelanja.php b/app/Models/MstJenisBelanja.php
new file mode 100644
index 0000000..cb7f1cc
--- /dev/null
+++ b/app/Models/MstJenisBelanja.php
@@ -0,0 +1,18 @@
+id();
+ $table->string('name');
+ $table->string('description');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('mst_jenis_belanja');
+ }
+}
diff --git a/database/migrations/2022_08_24_143614_create_mst_sub_jenis_belanja_table.php b/database/migrations/2022_08_24_143614_create_mst_sub_jenis_belanja_table.php
new file mode 100644
index 0000000..164d29a
--- /dev/null
+++ b/database/migrations/2022_08_24_143614_create_mst_sub_jenis_belanja_table.php
@@ -0,0 +1,34 @@
+id();
+ $table->integer('id_jenis_belanja');
+ $table->string('name');
+ $table->string('description');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('mst_sub_jenis_belanja');
+ }
+}
diff --git a/resources/views/admin/mapping_dbh_skpd/index.blade.php b/resources/views/admin/mapping_dbh_skpd/index.blade.php
index fcc46e2..73373f1 100644
--- a/resources/views/admin/mapping_dbh_skpd/index.blade.php
+++ b/resources/views/admin/mapping_dbh_skpd/index.blade.php
@@ -124,44 +124,6 @@
"processing": "
",
},
});
-
- $(document).on("click",".chk-upload", function(){
- let val = $(this).val();
- let reset = $(this).prop("checked") == 1 ?0:1;
- location.href = "{{ URL::to("/admin/users") }}/"+val+"/lock-upload/"+reset;
- });
-
- $("#btn_lock_all").on("click", function(){
- let test = Swal.fire({
- title: 'Fitur upload data akan dikunci untuk semua user!?',
- showDenyButton: true,
- showCancelButton: false,
- confirmButtonText: 'Ya',
- denyButtonText: "Tidak",
- icon: "warning",
- }).then((result) => {
- /* Read more about isConfirmed, isDenied below */
- if (result.isConfirmed) {
- location.href = "{{ URL::to("/admin/users") }}/lock-upload-all/0/0";
- }
- })
- });
-
- $("#btn_reset_lock_all").on("click", function(){
- let test = Swal.fire({
- title: 'Fitur upload data akan direset untuk semua user!?',
- showDenyButton: true,
- showCancelButton: false,
- confirmButtonText: 'Ya',
- denyButtonText: "Tidak",
- icon: "warning",
- }).then((result) => {
- /* Read more about isConfirmed, isDenied below */
- if (result.isConfirmed) {
- location.href = "{{ URL::to("/admin/users") }}/lock-upload-all/0/1";
- }
- })
- });
});
@endsection
diff --git a/resources/views/admin/mst_jenis_belanja/create.blade.php b/resources/views/admin/mst_jenis_belanja/create.blade.php
new file mode 100644
index 0000000..ce88599
--- /dev/null
+++ b/resources/views/admin/mst_jenis_belanja/create.blade.php
@@ -0,0 +1,49 @@
+@php
+ $siteBreadcumb = [
+ ["url"=>"/admin/mst-hak","label"=>$siteTitle],
+ ["url"=>"/admin/mst-hak","label"=>$sitesubTitle]
+ ];
+@endphp
+
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
@php echo $sitesubTitle; @endphp
+
+
+
+
+
+
+@endsection
+@section('scripts')
+
+@endsection
\ No newline at end of file
diff --git a/resources/views/admin/mst_jenis_belanja/create_sub.blade.php b/resources/views/admin/mst_jenis_belanja/create_sub.blade.php
new file mode 100644
index 0000000..cf68745
--- /dev/null
+++ b/resources/views/admin/mst_jenis_belanja/create_sub.blade.php
@@ -0,0 +1,50 @@
+@php
+ $siteBreadcumb = [
+ ["url"=>"/admin/mst-hak","label"=>$siteTitle],
+ ["url"=>"/admin/mst-hak","label"=>$sitesubTitle]
+ ];
+@endphp
+
+@extends('layouts.app')
+
+@section('content')
+
+
+
+
@php echo $sitesubTitle; @endphp
+
+
+
+
+
+
+ @csrf
+
+
+
+@endsection
+@section('scripts')
+
+@endsection
\ No newline at end of file
diff --git a/resources/views/admin/mst_jenis_belanja/index.blade.php b/resources/views/admin/mst_jenis_belanja/index.blade.php
new file mode 100644
index 0000000..67ce262
--- /dev/null
+++ b/resources/views/admin/mst_jenis_belanja/index.blade.php
@@ -0,0 +1,112 @@
+@php
+ $siteBreadcumb = [
+ ["url"=>"/admin/users","label"=>$siteTitle],
+ ["url"=>"/admin/users","label"=>$sitesubTitle]
+ ];
+@endphp
+
+@extends('layouts.empty')
+
+@section('styles')
+
+
+
+
+
+@endsection
+
+@section('content')
+
+
+
+
+
+
+ No
+ Nama
+ Deskripsi
+ Action
+
+
+
+
+
+
+ @section('scripts')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @endsection
+@stop
\ No newline at end of file
diff --git a/resources/views/admin/mst_jenis_belanja/show.blade.php b/resources/views/admin/mst_jenis_belanja/show.blade.php
new file mode 100644
index 0000000..71155e4
--- /dev/null
+++ b/resources/views/admin/mst_jenis_belanja/show.blade.php
@@ -0,0 +1,136 @@
+@php
+ $siteBreadcumb = [
+ ["url"=>"/admin/users","label"=>$siteTitle],
+ ["url"=>"/admin/users","label"=>$sitesubTitle]
+ ];
+@endphp
+
+@section('styles')
+
+
+
+
+
+@endsection
+
+@extends('layouts.empty')
+
+@section('content')
+
+
+
+
+
+
+
+ No
+ Nama
+ Deskripsi
+ Action
+
+
+
+
+
+@endsection
+@section('scripts')
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
\ No newline at end of file
diff --git a/resources/views/jadwal_salurdana/index_cht.blade.php b/resources/views/jadwal_salurdana/index_cht.blade.php
index fb1e0c2..d1fce29 100644
--- a/resources/views/jadwal_salurdana/index_cht.blade.php
+++ b/resources/views/jadwal_salurdana/index_cht.blade.php
@@ -293,7 +293,7 @@
"processing": "
",
},
fixedColumns: {
- left: 2,
+ left: 3,
},
scrollX:true,
});
diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php
index b488a26..d9eb3b9 100644
--- a/resources/views/login.blade.php
+++ b/resources/views/login.blade.php
@@ -15,7 +15,6 @@
Sistem Informasi Dana Transfer Provinsi DKI Jakarta
@if(session('errors'))
- Something it's wrong:
@foreach ($errors->all() as $error)
{{ $error }}
@@ -38,7 +37,7 @@