diff --git a/app/Http/Controllers/ItemSearchController.php b/app/Http/Controllers/ItemSearchController.php index 49ffb7d..f08e015 100644 --- a/app/Http/Controllers/ItemSearchController.php +++ b/app/Http/Controllers/ItemSearchController.php @@ -99,22 +99,25 @@ class ItemSearchController extends Controller public function sps(Request $request) { $sps = []; - if($request->has('q')){ - $search = strtolower($request->q); - $ta = $request->ta; - $jenis = $request->jenis; - $select = DB::raw("ID,KODE_REKENING||' | '||NAMA_REKENING as name"); - $sps = Sps_pendapatan::select($select) - ->whereRaw("TAHUN=$ta AND SKPD_ID = 980 AND (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%')"); + $search = strtolower($request->q); + $ta = $request->ta; + $jenis = $request->jenis; + $select = DB::raw("ID,KODE_REKENING||' | '||NAMA_REKENING as name"); + $sps = Sps_pendapatan::select($select) + ->whereRaw("TAHUN=$ta AND SKPD_ID = 980"); - if ($jenis == "dbh"){ - $sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.01') "); - }else if($jenis == "dak"){ - $sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.03' AND SUBSTR(KODE_REKENING,1,12)='4.2.01.01.04') "); - } - $sps->orderby("KODE_REKENING"); - $sps = $sps->get(); + if (!empty($search)){ + $sps->whereRaw(" (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%') "); } + + if ($jenis == "dbh"){ + $sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.01') "); + }else if($jenis == "dak"){ + $sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.03' OR SUBSTR(KODE_REKENING,1,12)='4.2.01.01.04') "); + } + + $sps->orderby("KODE_REKENING"); + $sps = $sps->get(); return response()->json($sps); } diff --git a/app/Http/Controllers/JadwalSalurdanaController.php b/app/Http/Controllers/JadwalSalurdanaController.php index 0537e8b..da6bb34 100644 --- a/app/Http/Controllers/JadwalSalurdanaController.php +++ b/app/Http/Controllers/JadwalSalurdanaController.php @@ -85,25 +85,24 @@ class JadwalSalurdanaController extends Controller ]); } - public function index_cht_dak(Request $request,$typeDana) + public function index_cht_dak(Request $request, $typeDana) { $judul = strtoupper($typeDana); $this->setTitle("Jadwal Salur Dana $judul"); return view("jadwal_salurdana.index_".$typeDana); } - public function datatable_cht_dak(Request $request) + public function datatable_cht_dak(Request $request, $typeDana) { $post = $request->all(); $offset = $post["start"]; $limit = $post["length"]; - $src = $post["src"]; + // $src = $post["src"]; $ta = $post["ta"]; - // $typeDana = $post["type_dana"]; + $typeDanaFilter = $typeDana == "cht" ? " AND x.jenis_dana = 'DBH' AND x.sub_jenis_dana = 'CHT' ": " AND x.jenis_dana = 'DAK'"; $dataFilter=0; $sqlstr = 'SELECT x.kode_rsk, x.nama_rsk, x.jumlah_anggaran, y.* - FROM - SAMASA.BELANJA_REALISASI x + FROM SAMASA.BELANJA_REALISASI x LEFT JOIN ( SELECT * FROM ( @@ -175,12 +174,12 @@ class JadwalSalurdanaController extends Controller ON xx.IDRSK = yy.RSK_BELANJARINCI_ID ) y ON x.KODE_RSK = y.IDRSK - WHERE x.TAHUN_ANGGARAN = \''.$ta.'\' '; + WHERE x.TAHUN_ANGGARAN = \''.$ta.'\''.$typeDanaFilter; $data = DB::connection('oracle')->select(DB::raw($sqlstr.' ORDER BY x.id OFFSET '.$offset.' ROWS FETCH NEXT '.$limit.' ROWS ONLY')); - $dataTotal = count(DB::connection('oracle')->select(DB::raw($sqlstr)));; - if (!empty($src)){ + $dataTotal = count(DB::connection('oracle')->select(DB::raw($sqlstr))); + // if (!empty($src)){ //$data->whereRaw("(LOWER(NAMA_REKENING) LIKE '%".strtolower($src)."%' OR LOWER(KODE_REKENING) LIKE '%".strtolower($src)."%')"); - } + // } $dataFilter = count(DB::connection('oracle')->select(DB::raw($sqlstr))); return response()->json([ diff --git a/app/Http/Controllers/NotifikasiController.php b/app/Http/Controllers/NotifikasiController.php index 0e58ad3..d6b503b 100644 --- a/app/Http/Controllers/NotifikasiController.php +++ b/app/Http/Controllers/NotifikasiController.php @@ -41,13 +41,13 @@ class NotifikasiController extends Controller $post = $request->all(); $offset = $post["start"]; $limit = $post["length"]; - $src = $post["src"]; + //$src = $post["src"]; $dataFilter=0; $data = Notifikasi::where("userid",Auth::user()->id)->orderBy("created_at","DESC"); - if (!empty($src)){ - $data->whereRaw("(LOWER(message) LIKE '%".strtolower($src)."%')"); - } + // if (!empty($src)){ + // $data->whereRaw("(LOWER(message) LIKE '%".strtolower($src)."%')"); + // } $dataFilter = $data->count(); $dataTotal = Notifikasi::where("userid",Auth::user()->id)->count(); diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php index 29ccfd5..6b061f1 100644 --- a/app/Http/Controllers/RealisasiBelanjaController.php +++ b/app/Http/Controllers/RealisasiBelanjaController.php @@ -164,26 +164,26 @@ class RealisasiBelanjaController extends Controller $this->validate($request, [ 'file' => 'required|mimes:xls,xlsx', ]); - + $file = $request->file('file'); $subJenisDana = $request->optJenisDana; - // 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(); + $ta = $request->ta; $tujuan_upload = 'uploadFiles'; $file->move($tujuan_upload,$file->getClientOriginalName()); - // var_dump($file->getRealPath()); exit; + DB::beginTransaction(); - TempRealisasiBelanja::where("userid",Auth::user()->id)->truncate(); - Excel::import(new RealisasiBelanjaImport(strtoupper($typeDana),$subJenisDana), $tujuan_upload."/".$file->getClientOriginalName()); + TempRealisasiBelanja::where("userid",Auth::user()->id)->delete(); + Excel::import(new RealisasiBelanjaImport($ta, strtoupper($typeDana),$subJenisDana), $tujuan_upload."/".$file->getClientOriginalName()); DB::commit(); + return redirect(URL::to("/upload-realisasi-belanja/".$typeDana))->with('success','Data Rencana belanja berhasil diupload, Silahkan validasi data!'); - }catch(\Exception $e){ - throw new \Exception($e->getMessage()); + } + catch(\Exception $e) + { + // throw new \Exception($e->getMessage()); DB::rollBack(); - return redirect(URL::to("/upload-realisasi-belanja/".$typeDana))->with('error',$e->getMessage()); + abort(500, $e->getMessage()); + // return redirect(URL::to("/upload-realisasi-belanja/".$typeDana))->with('error',$e->getMessage()); } } $this->siteTitle = "Rencana Belanja"; @@ -258,7 +258,7 @@ class RealisasiBelanjaController extends Controller ]; BelanjaRealisasi::create($input); } - TempRealisasiBelanja::where("userid",Auth::user()->id)->truncate(); + TempRealisasiBelanja::where("userid",Auth::user()->id)->delete(); DB::commit(); return redirect(URL::to("/upload-realisasi-belanja/".$typeDana))->with('success','Data Realisasi belanja berhasil diupload.'); }catch(\Exception $e){ diff --git a/app/Imports/RealisasiBelanjaImport.php b/app/Imports/RealisasiBelanjaImport.php index 5e861f4..2fe6573 100644 --- a/app/Imports/RealisasiBelanjaImport.php +++ b/app/Imports/RealisasiBelanjaImport.php @@ -9,10 +9,12 @@ use Illuminate\Support\Facades\Auth; class RealisasiBelanjaImport implements ToModel, WithStartRow { use Importable; + protected $ta; protected $jenisDana; protected $subjenisDana; - public function __construct($jenisDana, $subjenisDana){ + public function __construct($ta, $jenisDana, $subjenisDana){ + $this->ta = $ta; $this->jenisDana = $jenisDana; $this->subjenisDana = $subjenisDana; } @@ -25,22 +27,22 @@ class RealisasiBelanjaImport implements ToModel, WithStartRow public function model(array $row) { return new TempRealisasiBelanja([ - "tahun_anggaran"=>$row[0], - "jenis_belanja"=>$row[1], - "sub_jenis_belanja"=>$row[2], - "kode_program"=>$row[3], - "nama_program"=>$row[4], - "kode_skpd"=>$row[5], - "nama_skpd"=>$row[6], - "kode_kegiatan"=>$row[7], - "nama_kegiatan"=>$row[8], - "kode_sub_kegiatan"=>$row[9], - "nama_sub_kegiatan"=>$row[10], - "kode_rsk"=>$row[11], - "nama_rsk"=>$row[12], - "jumlah_anggaran"=>$row[13], - "volume_satuan"=>$row[14], - "unit_satuan"=>$row[15], + "tahun_anggaran"=>$this->ta, + "jenis_belanja"=>$row[0], + "sub_jenis_belanja"=>$row[1], + "kode_program"=>$row[2], + "nama_program"=>$row[3], + "kode_skpd"=>$row[4], + "nama_skpd"=>$row[5], + "kode_kegiatan"=>$row[6], + "nama_kegiatan"=>$row[7], + "kode_sub_kegiatan"=>$row[8], + "nama_sub_kegiatan"=>$row[9], + "kode_rsk"=>$row[10], + "nama_rsk"=>$row[11], + "jumlah_anggaran"=>$row[12], + "volume_satuan"=>$row[13], + "unit_satuan"=>$row[14], "jenis_dana"=>$this->jenisDana, "sub_jenis_dana"=>$this->subjenisDana, "userid"=>Auth::user()->id diff --git a/public/css/app.css b/public/css/app.css index e5d53a0..2d849fc 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -314,10 +314,26 @@ hr{ } .card-title{ - font-weight: bold; + /* font-weight: bold; */ text-transform: uppercase; } -.content-header h1{ +.content-header h5{ color:#001f3f; -} \ No newline at end of file +} + + +/* +.content{ + padding-top: 60px !important; +} + +.content-header{ + position: fixed; + background: whitesmoke; + z-index: 999; + width: -moz-available; + width: -webkit-fill-available; + width: fill-available; +} +*/ \ No newline at end of file diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.php index 78f7733..4e2796c 100644 --- a/resources/views/errors/403.blade.php +++ b/resources/views/errors/403.blade.php @@ -7,6 +7,7 @@
Anda dilarang untuk mengakses halaman ini ! Untuk lebih lanjut Hubungi administrator!
+{{ config("app.env") == "production" ? "":$exception->getMessage() }}
@stop \ No newline at end of file diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php index 05b5d77..f496c7a 100644 --- a/resources/views/errors/404.blade.php +++ b/resources/views/errors/404.blade.php @@ -2,10 +2,11 @@ @section('content_error')Halaman yang anda akses tidak ditemukan ! Untuk lebih lanjut Hubungi administrator!
+{{ config("app.env") == "production" ? "":$exception->getMessage() }}
Terjadi kesalahan pada halaman yang anda akses! Untuk lebih lanjut Hubungi administrator!
{{ config("app.env") == "production" ? "":$exception->getMessage() }}
| ") - .append( " | "+labelGroup+" | ") - .append( ""+ separateNumberIndo(sum[0]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[0]) +" | " ) - .append( ""+ separateNumberIndo(sum[1]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[1]) +" | " ) - .append( ""+ separateNumberIndo(sum[2]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[2]) +" | " ) - .append( ""+ separateNumberIndo(sum[3]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[3]) +" | " ) - .append( ""+ separateNumberIndo(sum[4]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[4]) +" | " ) - .append( ""+ separateNumberIndo(sum[5]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[5]) +" | " ) - .append( ""+ separateNumberIndo(sum[6]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[6]) +" | " ) - .append( ""+ separateNumberIndo(sum[7]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[7]) +" | " ) - .append( ""+ separateNumberIndo(sum[8]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[8]) +" | " ) - .append( ""+ separateNumberIndo(sum[9]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[9]) +" | " ) - .append( ""+ separateNumberIndo(sum[10]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[10]) +" | " ) - .append( ""+ separateNumberIndo(sum[11]) +" | " ) - .append( ""+ separateNumberIndo(sumReal[11]) +" | " ) - .append( ""+ separateNumberIndo(total) +" | " ) - .append( ""+ separateNumberIndo(totalReal) +" | " ) - }, - startRender: function ( rows, group, index ) { - }, - dataSrc: ["kode_skpd"] - }, + // sumReal[x] = rows.data().pluck("v_bku_"+xx).reduce( function (a, b) { + // return a + b * 1; + // }, 0); + // totalReal += sumReal[x]; + // } + // let textmuted = index == 1 ? "text-muted":""; + // let labelGroup = index == 1 ?"JUMLAH | " + group : "TOTAL"; + // return $("
| ") + // .append( " | "+labelGroup+" | ") + // .append( ""+ separateNumberIndo(sum[0]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[0]) +" | " ) + // .append( ""+ separateNumberIndo(sum[1]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[1]) +" | " ) + // .append( ""+ separateNumberIndo(sum[2]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[2]) +" | " ) + // .append( ""+ separateNumberIndo(sum[3]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[3]) +" | " ) + // .append( ""+ separateNumberIndo(sum[4]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[4]) +" | " ) + // .append( ""+ separateNumberIndo(sum[5]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[5]) +" | " ) + // .append( ""+ separateNumberIndo(sum[6]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[6]) +" | " ) + // .append( ""+ separateNumberIndo(sum[7]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[7]) +" | " ) + // .append( ""+ separateNumberIndo(sum[8]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[8]) +" | " ) + // .append( ""+ separateNumberIndo(sum[9]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[9]) +" | " ) + // .append( ""+ separateNumberIndo(sum[10]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[10]) +" | " ) + // .append( ""+ separateNumberIndo(sum[11]) +" | " ) + // .append( ""+ separateNumberIndo(sumReal[11]) +" | " ) + // .append( ""+ separateNumberIndo(total) +" | " ) + // .append( ""+ separateNumberIndo(totalReal) +" | " ) + // }, + // startRender: function ( rows, group, index ) { + // }, + // dataSrc: ["kode_skpd"] + // }, scrollX: true, - scrollY: "350px", }); }); diff --git a/resources/views/jadwal_salurdana/index_dak.blade.php b/resources/views/jadwal_salurdana/index_dak.blade.php index 2183ea5..5872bcf 100644 --- a/resources/views/jadwal_salurdana/index_dak.blade.php +++ b/resources/views/jadwal_salurdana/index_dak.blade.php @@ -16,15 +16,15 @@ @section('content')