diff --git a/app/Http/Controllers/CallCenterController.php b/app/Http/Controllers/CallCenterController.php index 9a1e263..e1d4741 100644 --- a/app/Http/Controllers/CallCenterController.php +++ b/app/Http/Controllers/CallCenterController.php @@ -298,6 +298,16 @@ class CallCenterController extends Controller } } + elseif($request->type == 'pdf') + { + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + $bycawnotisperingatan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/bycawnotisperingatan/'.$kodcaw.'/'.$notisid)->json(); + return view('callcenter.pdfbycawdetailnotisperingatan', compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid','cawangan_detail','tarikh_cetak')); + } return view('callcenter.bycawdetailnotisperingatan',compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid')); } @@ -533,6 +543,17 @@ class CallCenterController extends Controller $pdf=PDF::loadView('callcenter.suratnotisperingatankedua', compact('cawangan_info','api_url','cawangan_detail','datanotiskedua','fasa','tarikh_cetak'))->setPaper('A4','potrait'); return $pdf->download('notisperingatankedua_'.$tarikh_cetak.'_'.$fasa.'.pdf'); + } + elseif($request->type == 'pdflist') + { + + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); + $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + $bycawnotisperingatankedua = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/bycawnotisperingatankedua/'.$kodcaw.'/'.$notisid)->json(); + + return view('callcenter.pdfbycawdetailnotisperingatankedua', compact('cawangan_info','bycawnotisperingatankedua','kodcaw','notisid','cawangan_detail','tarikh_cetak')); + } return view('callcenter.bycawdetailnotisperingatan',compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid')); } diff --git a/resources/views/callcenter/bycawdetailnotisperingatan.blade.php b/resources/views/callcenter/bycawdetailnotisperingatan.blade.php index 7c2e1e1..41ecc90 100644 --- a/resources/views/callcenter/bycawdetailnotisperingatan.blade.php +++ b/resources/views/callcenter/bycawdetailnotisperingatan.blade.php @@ -237,16 +237,16 @@ // // window.open("_blank"); // } // }, - // { - // className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export', - // titleAttr: 'Export to PDF', - // text: 'PDF', - // action: function ( e, dt, node, config ) { - // $('#typedonwload').val('pdf'); - // $("#exportpdf").submit(); - // } + { + className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export', + titleAttr: 'Export to PDF', + text: 'CETAK SENARAI', + action: function ( e, dt, node, config ) { + $('#typedonwload').val('pdf'); + $("#exportpdf").submit(); + } - // }, + }, { className: 'btn btn-outline-info pl-4 pr-4 btn-sm export', target: "_blank", diff --git a/resources/views/callcenter/bycawdetailnotisperingatankedua.blade.php b/resources/views/callcenter/bycawdetailnotisperingatankedua.blade.php index 156114e..ebea1ef 100644 --- a/resources/views/callcenter/bycawdetailnotisperingatankedua.blade.php +++ b/resources/views/callcenter/bycawdetailnotisperingatankedua.blade.php @@ -70,7 +70,7 @@ #details th { padding: 8px; - font-size: 14px; + font-size: 12px; } #details tr:nth-child(even) { @@ -259,17 +259,17 @@ dom: 'Bfrtip', buttons: [ - // { - // className: 'btn btn-outline-success pl-4 pr-4 btn-sm export', - // target: "_blank", - // titleAttr: 'Export to Excel', - // text: 'EXCEL', - // action: function ( e, dt, node, config ) { - // $('#typedonwload').val('excel'); - // $("#exportpdf").submit(); - // // window.open("_blank"); - // } - // }, + { + className: 'btn btn-outline-success pl-4 pr-4 btn-sm export', + target: "_blank", + titleAttr: 'Cetak Senarai', + text: 'CETAK SENARAI', + action: function ( e, dt, node, config ) { + $('#typedonwload').val('pdflist'); + $("#exportpdf").submit(); + // window.open("_blank"); + } + }, { className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export', titleAttr: 'Surat Berdaftar', diff --git a/resources/views/callcenter/notisperingatankedua.blade.php b/resources/views/callcenter/notisperingatankedua.blade.php index 5be0254..dd27e08 100644 --- a/resources/views/callcenter/notisperingatankedua.blade.php +++ b/resources/views/callcenter/notisperingatankedua.blade.php @@ -99,7 +99,7 @@