diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index fb32197..e8cedb6 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,6 +9,7 @@ use Illuminate\Routing\Controller as BaseController; use View; use App\Models\Notifikasi; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\URL; class Controller extends BaseController { @@ -23,6 +24,7 @@ class Controller extends BaseController View::share ( 'sitesubTitle' , $this->sitesubTitle ); View::share ( 'siteBreadcumb' , $this->siteBreadcumb ); View::share ( 'iconTitle' , $this->IconTitle ); + View::share ( 'baseUrl', URL::to("/") ); } public function setTitle($name){ diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php index fa709a4..9de671b 100644 --- a/app/Http/Controllers/RealisasiBelanjaController.php +++ b/app/Http/Controllers/RealisasiBelanjaController.php @@ -14,6 +14,8 @@ use App\Models\VwAkbSpdRealRsk; use App\Models\UnitSatuan; use App\Models\Sp2d; use App\Imports\RealisasiBelanjaImport; +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; class RealisasiBelanjaController extends Controller { @@ -83,7 +85,7 @@ class RealisasiBelanjaController extends Controller $post = $request->all(); $offset = $post["start"]; $limit = $post["length"]; - $src = $post["src"]; + //$src = $post["src"]; $ta = $post["ta"]; $JenisDana = $post["jenis_dana"]; $SubJenisDana = $post["sub_jenis_dana"]; @@ -450,4 +452,61 @@ class RealisasiBelanjaController extends Controller echo "File tidak ditemukan!"; } } + + public function download(Request $request) + { + $post = $request->all(); + $sps = isset($post["sps"])?$post["sps"]:""; + $ta = $post["ta"]; + + $data = BelanjaRealisasi::orderBy("created_at","ASC"); + if (!empty($sps)){ + $data->where("id_sps",$sps); + } + + $fileName = 'Realisasi-belanja.xlsx'; + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->setCellValue(getAlphabetCell(0).'1', 'Kode SKPD'); + $sheet->setCellValue(getAlphabetCell(1).'1', 'Nama SKPD'); + $sheet->setCellValue(getAlphabetCell(2).'1', 'Kode Program'); + $sheet->setCellValue(getAlphabetCell(3).'1', 'Nama Program'); + $sheet->setCellValue(getAlphabetCell(4).'1', 'Kode Sub Kegiatan'); + $sheet->setCellValue(getAlphabetCell(5).'1', 'Sub Kegiatan'); + $sheet->setCellValue(getAlphabetCell(6).'1', 'Kode Rinci Sub Kegiatan'); + $sheet->setCellValue(getAlphabetCell(7).'1', 'Rinci Sub Kegiatan'); + $sheet->setCellValue(getAlphabetCell(8).'1', 'Anggaran'); + $sheet->setCellValue(getAlphabetCell(9).'1', 'Volume'); + $sheet->setCellValue(getAlphabetCell(10).'1', 'Unit'); + $sheet->setCellValue(getAlphabetCell(11).'1', 'Realisasi'); + $sheet->setCellValue(getAlphabetCell(12).'1', 'Volume'); + $sheet->setCellValue(getAlphabetCell(13).'1', 'Unit'); + + $rows = 2; + foreach ($data->get() as $val){ + $sheet->setCellValue(getAlphabetCell(0) . $rows, $val["kode_skpd"]); + $sheet->setCellValue(getAlphabetCell(1) . $rows, $val["nama_skpd"]); + $sheet->setCellValue(getAlphabetCell(2) . $rows, $val["kode_program"]); + $sheet->setCellValue(getAlphabetCell(3) . $rows, $val["nama_program"]); + $sheet->setCellValue(getAlphabetCell(4) . $rows, $val["kode_sub_kegiatan"]); + $sheet->setCellValue(getAlphabetCell(5) . $rows, $val["nama_sub_kegiatan"]); + $sheet->setCellValue(getAlphabetCell(6) . $rows, $val["kode_rsk"]); + $sheet->setCellValue(getAlphabetCell(7) . $rows, $val["nama_rsk"]); + $sheet->setCellValue(getAlphabetCell(8) . $rows, $val["jumlah_anggaran"]); + $sheet->setCellValue(getAlphabetCell(9) . $rows, $val["volume_satuan"]); + $sheet->setCellValue(getAlphabetCell(10) . $rows, $val["unit_satuan"]); + $sheet->setCellValue(getAlphabetCell(11) . $rows, $val["jumlah_realisasi"]); + $sheet->setCellValue(getAlphabetCell(12) . $rows, $val["volume_satuan_realisasi"]); + $sheet->setCellValue(getAlphabetCell(13) . $rows, $val["unit_satuan_realisasi"]); + $rows++; + } + + $writer = new Xlsx($spreadsheet); + $writer->save("downloadFiles/".$fileName); + $headers = [ + 'Content-Type' => 'application/vnd.ms-excel', + 'Content-Disposition' => 'attachment;filename='.$fileName + ]; + return response()->download("downloadFiles/".$fileName, $fileName, $headers); + } } diff --git a/app/Http/Controllers/RealisasiPendapatanController.php b/app/Http/Controllers/RealisasiPendapatanController.php index 4d0499c..b6e0b32 100644 --- a/app/Http/Controllers/RealisasiPendapatanController.php +++ b/app/Http/Controllers/RealisasiPendapatanController.php @@ -10,6 +10,8 @@ use Maatwebsite\Excel\Facades\Excel; use App\Models\PendapatanRealisasi; use App\Models\Sps_pendapatan; use App\Models\User; +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; class RealisasiPendapatanController extends Controller { @@ -122,13 +124,13 @@ class RealisasiPendapatanController extends Controller $post = $request->all(); $offset = $post["start"]; $limit = $post["length"]; - $src = $post["src"]; + $sps = $post["sps"]; $ta = $post["ta"]; $dataFilter=0; $data = PendapatanRealisasi::orderBy("created_at","ASC"); - if (!empty($src)){ - $data->whereRaw("(LOWER(simtrad4_uraian) LIKE '%".strtolower($src)."%')"); + if (!empty($sps)){ + $data->where("id_sps",$sps); } $dataFilter = $data->count(); $dataTotal = PendapatanRealisasi::count(); @@ -204,4 +206,55 @@ class RealisasiPendapatanController extends Controller } } + public function download(Request $request) + { + $post = $request->all(); + $sps = isset($post["sps"])?$post["sps"]:""; + $ta = $post["ta"]; + + $data = PendapatanRealisasi::orderBy("created_at","ASC"); + if (!empty($sps)){ + $data->where("id_sps",$sps); + } + + $fileName = 'Realisasi-pendapatan.xlsx'; + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->setCellValue(getAlphabetCell(0).'1', 'Uraian'); + $sheet->setCellValue(getAlphabetCell(1).'1', 'Kotor'); + $sheet->setCellValue(getAlphabetCell(2).'1', 'Potongan'); + $sheet->setCellValue(getAlphabetCell(3).'1', 'Bersih'); + $sheet->setCellValue(getAlphabetCell(4).'1', 'SP2D BUN'); + $sheet->setCellValue(getAlphabetCell(5).'1', 'TGL SP2D BUN'); + $sheet->setCellValue(getAlphabetCell(6).'1', 'TGL STS'); + $sheet->setCellValue(getAlphabetCell(7).'1', 'NO STS'); + $sheet->setCellValue(getAlphabetCell(8).'1', 'Kode Akun'); + $sheet->setCellValue(getAlphabetCell(9).'1', 'Nama Akun'); + $sheet->setCellValue(getAlphabetCell(10).'1', 'Jumlah'); + + $rows = 2; + foreach ($data->get() as $val){ + $sheet->setCellValue(getAlphabetCell(0) . $rows, $val["simtrad4_uraian"]); + $sheet->setCellValue(getAlphabetCell(1) . $rows, $val["simtrad4_kotor"]); + $sheet->setCellValue(getAlphabetCell(2) . $rows, $val["simtrad4_potongan"]); + $sheet->setCellValue(getAlphabetCell(3) . $rows, $val["simtrad4_bersih"]); + $sheet->setCellValue(getAlphabetCell(4) . $rows, $val["simtrad4_sp2d_bun"]); + $sheet->setCellValue(getAlphabetCell(5) . $rows, $val["simtrad4_tgl_sp2d_bun"]); + $sheet->setCellValue(getAlphabetCell(6) . $rows, $val["rkud_tgl"]); + $sheet->setCellValue(getAlphabetCell(7) . $rows, $val["rkud_no_sts"]); + $sheet->setCellValue(getAlphabetCell(8) . $rows, $val["rkud_kode_akun"]); + $sheet->setCellValue(getAlphabetCell(9) . $rows, $val["rkud_nama_akun"]); + $sheet->setCellValue(getAlphabetCell(10) . $rows, $val["rkud_jumlah"]); + $rows++; + } + + $writer = new Xlsx($spreadsheet); + $writer->save("downloadFiles/".$fileName); + $headers = [ + 'Content-Type' => 'application/vnd.ms-excel', + 'Content-Disposition' => 'attachment;filename='.$fileName + ]; + return response()->download("downloadFiles/".$fileName, $fileName, $headers); + } + } diff --git a/resources/views/jadwal_salurdana/index.blade.php b/resources/views/jadwal_salurdana/index.blade.php index df33a62..68783eb 100644 --- a/resources/views/jadwal_salurdana/index.blade.php +++ b/resources/views/jadwal_salurdana/index.blade.php @@ -7,11 +7,11 @@ @extends('layouts.app') @section('styles') - - - - - + + + + + @endsection @section('card_header') @@ -108,22 +108,22 @@ @stop @section('scripts') - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + diff --git a/resources/views/notifikasi/index.blade.php b/resources/views/notifikasi/index.blade.php index 6c337d6..32c62f1 100644 --- a/resources/views/notifikasi/index.blade.php +++ b/resources/views/notifikasi/index.blade.php @@ -8,10 +8,10 @@ @section('styles') - - - - + + + + @endsection @section('card_header') @@ -48,20 +48,20 @@ @stop @section('scripts') - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index 9198aec..636dff5 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -7,12 +7,12 @@ {{ config('app.name','E-SAMASA') }} {{ isset($siteTitle)?" | ".$siteTitle:"" }} - - - - - - + + + + + + @yield('styles') diff --git a/resources/views/partials/top_menu.blade.php b/resources/views/partials/top_menu.blade.php index e5790c0..ba7843d 100644 --- a/resources/views/partials/top_menu.blade.php +++ b/resources/views/partials/top_menu.blade.php @@ -8,7 +8,7 @@ diff --git a/resources/views/realisasi_belanja/index.blade.php b/resources/views/realisasi_belanja/index.blade.php index 01c2c4d..932ac64 100644 --- a/resources/views/realisasi_belanja/index.blade.php +++ b/resources/views/realisasi_belanja/index.blade.php @@ -8,10 +8,10 @@ @section('styles') - - - - + + + + @endsection @section('card_header') @@ -22,48 +22,51 @@ @stop @section('content') -
-
-
- - +
+ @csrf +
+
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
+ {{--
+
+ + +
+
--}}
-
-
- - -
-
-
+ @@ -92,20 +95,20 @@
@stop @section('scripts') - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/resources/views/realisasi_belanja/submit.blade.php b/resources/views/realisasi_belanja/submit.blade.php index cc18b01..412da40 100644 --- a/resources/views/realisasi_belanja/submit.blade.php +++ b/resources/views/realisasi_belanja/submit.blade.php @@ -7,10 +7,10 @@ @section('styles') - - - - + + + + @endsection @extends('layouts.empty') @@ -123,51 +123,53 @@
-
-
- KONTRAK can("Create Kontrak")?'[ Tambah Kontrak ]':'' ?>
- - - - - - - - can("Create Kontrak")){ ?> - - - - - $kontrak){ ?> - - - - - - - can("Create Kontrak")){ ?> - - - - nominal_kontrak); } ?> - - - - - - -
NoNomor KontrakTanggalJumlahFile
{{ $key+1 }}{{ $kontrak->nomor_kontrak }}{{ date("d-m-Y",strtotime($kontrak->tgl_kontrak)) }}{{ separateNumberIndo($kontrak->nominal_kontrak) }}file_kontrak)?"-":"id ."/download-kontrak")."'>".$kontrak->file_kontrak."" ?> -
- - - - -
-
TOTAL KONTRAK{{ separateNumberIndo($totalKontrak) }} 
+ jenis_dana) == "DAK") { ?> +
+
+ KONTRAK can("Create Kontrak")?'[ Tambah Kontrak ]':'' ?>
+ + + + + + + + can("Create Kontrak")){ ?> + + + + + $kontrak){ ?> + + + + + + + can("Create Kontrak")){ ?> + + + + nominal_kontrak); } ?> + + + + + + +
NoNomor KontrakTanggalJumlahFile
{{ $key+1 }}{{ $kontrak->nomor_kontrak }}{{ date("d-m-Y",strtotime($kontrak->tgl_kontrak)) }}{{ separateNumberIndo($kontrak->nominal_kontrak) }}file_kontrak)?"-":"id ."/download-kontrak")."'>".$kontrak->file_kontrak."" ?> +
+ + + + +
+
TOTAL KONTRAK{{ separateNumberIndo($totalKontrak) }} 
+
-
+
REALISASI
@@ -190,22 +192,22 @@
@endsection @section('scripts2') - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/routes/web.php b/routes/web.php index b3a4b8a..9f0b4b4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -47,6 +47,7 @@ Route::group(['middleware' => 'auth'], function () { Route::post('/datatable', [RealisasiPendapatanController::class,'datatable']); Route::post('/{realisasiId}/sts', [RealisasiPendapatanController::class,'sts']); Route::get('/rinci-dbh', [RealisasiPendapatanController::class,'rinciDBH']); + Route::post('/download', [RealisasiPendapatanController::class,'download']); }); Route::resource('realisasi-pendapatan', RealisasiPendapatanController::class); @@ -72,6 +73,7 @@ Route::group(['middleware' => 'auth'], function () { Route::get('/{idKontrak}/kontrak/update', [RealisasiBelanjaController::class,'kontrakUpdate']); Route::put('/{idKontrak}/kontrak', [RealisasiBelanjaController::class,'kontrakUpdate']); Route::get('/{kode}/download-kontrak', [RealisasiBelanjaController::class,'downloadKontrak']); + Route::post('/download', [RealisasiBelanjaController::class,'download']); }); Route::resource('realisasi-belanja', RealisasiBelanjaController::class);