From 8056256bed92325bbdc65a9ee2f4f3a9440f99b9 Mon Sep 17 00:00:00 2001 From: BTMS2 Date: Mon, 17 Feb 2025 14:46:53 +0800 Subject: [PATCH] tambah excel pada arcc --- app/Http/Controllers/CallCenterController.php | 10 + .../bycawdetailnotisperingatan.blade.php | 22 +- .../notisperingatanpertama_excel.blade.php | 277 ++++++++++++++++++ 3 files changed, 298 insertions(+), 11 deletions(-) create mode 100644 resources/views/callcenter/notisperingatanpertama_excel.blade.php diff --git a/app/Http/Controllers/CallCenterController.php b/app/Http/Controllers/CallCenterController.php index f344853..fb61038 100644 --- a/app/Http/Controllers/CallCenterController.php +++ b/app/Http/Controllers/CallCenterController.php @@ -308,6 +308,16 @@ class CallCenterController extends Controller $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')); } + elseif($request->type == 'excel') + { + $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.notisperingatanpertama_excel', compact('cawangan_info','bycawnotisperingatan','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 2929d05..7f34b8c 100644 --- a/resources/views/callcenter/bycawdetailnotisperingatan.blade.php +++ b/resources/views/callcenter/bycawdetailnotisperingatan.blade.php @@ -230,17 +230,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: 'Export to Excel', + text: 'EXCEL', + action: function ( e, dt, node, config ) { + $('#typedonwload').val('excel'); + $("#exportpdf").submit(); + // window.open("_blank"); + } + }, { className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export', titleAttr: 'Export to PDF', diff --git a/resources/views/callcenter/notisperingatanpertama_excel.blade.php b/resources/views/callcenter/notisperingatanpertama_excel.blade.php new file mode 100644 index 0000000..b86924f --- /dev/null +++ b/resources/views/callcenter/notisperingatanpertama_excel.blade.php @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Senarai Notis Peringatan Pertama Tarikh Cetak: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp +
+ + + + + + + + + + + + + + + + + + + + + @foreach ($bycawnotisperingatan as $index => $item) + + + + + + + + + + + @if($item['datagadai']['tagbaru'] == '0') + + @elseif($item['datagadai']['tagbaru'] == '1') + + @endif + + @endif + + @endif + + @endif + + @endforeach +
BilNo.RujukanNamaNo.KPNo.TelefonTempohBaki Pembiayaan (RM)Keuntungan 6Bulan (RM)Amaun Telah Bayar (RM)Keuntungan Semasa (RM)Tarikh MatangTarikh Tamat KontrakTarikh Blast
{{ $loop->iteration }}{{$item['norujukan']}}{{$item['namacust']['nama'] ?? ''}}{{$item['nokp']}}6{{$item['namacust']['telefon'] ?? ''}}{{$item['jbg']}}{{number_format($item['datagadai']['bakipjm'], 2, '.', ',')}}{{number_format($item['datagadai']['bakiupah'], 2, '.', ',')}}{{number_format($item['datagadai']['hargajualan']-$item['datagadai']['bakihargajualan'], 2, '.', ',')}}{{number_format($item['keuntungan'], 2, '.', ',')}}{{number_format($item['keuntungan']['ujrah']+$item['keuntungan']['onepercent'], 2, '.', ',')}} + @if($item['tmatang'] == null) + @else + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['tmatang']); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp + @if($item['tmatang1'] == null) + @else + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['tmatang1']); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp + @if($item['tarikhnotis1'] == null) + + @else + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['tarikhnotis1']); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp
+ + + + + + + + + + + + + + + +