From 31edc79bff0f4ecb438ffd937ddd8b89d55be914 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Wed, 1 Mar 2023 17:17:00 +0800 Subject: [PATCH] add excel by sag --- app/Http/Controllers/NotisController.php | 18 ++- .../excel/listnotis_excelbysag.blade.php | 109 ++++++++++++++++++ .../views/jananotis/senarainotis.blade.php | 25 +++- 3 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 resources/views/excel/listnotis_excelbysag.blade.php diff --git a/app/Http/Controllers/NotisController.php b/app/Http/Controllers/NotisController.php index 99e7eab1..cf09c0f4 100644 --- a/app/Http/Controllers/NotisController.php +++ b/app/Http/Controllers/NotisController.php @@ -257,7 +257,8 @@ class NotisController extends Controller $marhun = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id') ->where('lelong_id','=',$lelong_id) - ->where('lelongbid.kodcaw','=',$user->kodcaw); + ->where('lelongbid.kodcaw','=',$user->kodcaw) + ->orderBy('norujukan'); $arraynorujukan = $marhun->pluck('norujukan')->toArray(); $datalelong = $marhun->get(); @@ -288,6 +289,14 @@ class NotisController extends Controller // dd($marhuns[$index1]['nama']); } + $listsaglelong = Gadai::on($datalelong[0]['kodcaw'])->whereIn('norujukan', $arraynorujukan) + ->get(); + foreach($listsaglelong as $index2=>$sag){ + $nokp = Customer::where('kpbaru','=',$sag['nokp']) + ->orWhere('kplama','=',$sag['nokp']) + ->first(); + $listsaglelong[$index2]['nama'] = $nokp; + } if($request->type == 'excel') { @@ -295,6 +304,13 @@ class NotisController extends Controller return view('excel.listnotis_excel',compact('marhuns','lelong_id','bayaran','listsag','caw')); } + elseif($request->type == 'excelbysag') + { + + return view('excel.listnotis_excelbysag',compact('listsaglelong','lelong_id','bayaran','listsag','caw')); + + } + else { $pdf = PDF::loadView('pdf.listnotis',compact('marhuns','lelong_id','bayaran','listsag','caw')) diff --git a/resources/views/excel/listnotis_excelbysag.blade.php b/resources/views/excel/listnotis_excelbysag.blade.php new file mode 100644 index 00000000..729e0f42 --- /dev/null +++ b/resources/views/excel/listnotis_excelbysag.blade.php @@ -0,0 +1,109 @@ + + + + + + + + +
+ + {{--
+
+ PKB LOGO +
--}} + +
+

{{$caw['caw_name']}}
+ {{$caw['alamat1']}}
+ {{$caw['alamat2']}}
+ No Tel: {{$caw['notel']}}
+ No Faks: {{$caw['nofaks']}} +


+
+
+
+ + + + + + + + + + + + + + + + + + @foreach($listsaglelong as $index2=> $notis) + {{-- {{dd($notis['nama']['nama'])}} --}} + + + + + + + + + + + + + @endforeach + + + + + + + + \ No newline at end of file diff --git a/resources/views/jananotis/senarainotis.blade.php b/resources/views/jananotis/senarainotis.blade.php index eba4ff31..7fe792e0 100644 --- a/resources/views/jananotis/senarainotis.blade.php +++ b/resources/views/jananotis/senarainotis.blade.php @@ -37,9 +37,11 @@ - - - + + + + {{-- --}} + @@ -52,11 +54,12 @@ {{-- --}} - + - + + {{-- --}} @endforeach @@ -100,6 +103,17 @@ // window.open("_blank"); } }, + { + className: 'btn btn-outline-info pl-4 pr-4 btn-sm export', + target: "_blank", + titleAttr: 'Export to Excel by SAG', + text: 'EXCEL By SAG', + action: function ( e, dt, node, config ) { + $('#typedonwload').val('excelbysag'); + $("#exportpdf").submit(); + // window.open("_blank"); + } + }, { className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export', titleAttr: 'Export to PDF', @@ -108,6 +122,7 @@ $('#typedonwload').val('pdf'); $("#exportpdf").submit(); } + }
NoNo RujukanTempohNo KPNamaNo.TelefonPembiayaan(RM)Keuntungan 6 Bulan(RM)Bayaran Telah Dibuat(RM)
{{ $loop->iteration }} {{ $notis['norujukan']}}{{ $notis['tempoh']}}{{ $notis['nokp']}}{{ $notis['nama']['nama']}}6{{ $notis['nama']['telefon']}}{{ $notis['bakipjm']}}{{ $notis['bakiupah']}}{{ number_format($bayaran, 2, '.', ',')}}
Alamat 3 No Rujukan TempohPembiayaanKeuntungan 6 BulanBayaran Telah DibuatPembiayaan (RM)Keuntungan 6 Bulan (RM)Bayaran Telah Dibuat (RM)Baki Lelong (simulasi) (RM)
{{ $notis['nama']->alamat2 }} {{ $notis['nama']->alamat3 }}{{ $notis['nama']['nama']}}@foreach($notis['listsag'] as $item){{ $item['norujukan']}}
@endforeach
@foreach($notis['listsag'] as $item){{ $item['norujukan']}}
@endforeach
@foreach($notis['listsag'] as $item){{ $item['tempoh']}}
@endforeach
@foreach($notis['listsag'] as $item){{ number_format($item['pinjaman'], 2, '.', ',')}}
@endforeach
@foreach($notis['listsag'] as $item){{ number_format($item['bakiupah'], 2, '.', ',')}}
@endforeach
@foreach($notis['listsag'] as $index=> $bayar){{ number_format($bayar['bayaran'], 2, '.', ',')}}
@endforeach
@foreach($notis['listsag'] as $index=> $bayar){{ number_format($bayar['bayaran'], 2, '.', ',')}}
@endforeach
@foreach($notis['datalelongbid'] as $index=> $baki){{ number_format($baki['baki'], 2, '.', ',')}}
@endforeach