From 52bbeb9cecf304bfe2a91eb30cc42d2f592bf5b4 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Mon, 25 Dec 2023 15:43:31 +0800 Subject: [PATCH] tambah function notis peringatan untuk arcc --- app/Http/Controllers/CallCenterController.php | 73 +++-- public/img/success.png | Bin 0 -> 585 bytes .../bycawdetailnotisperingatan.blade.php | 255 ++++++++++++++++++ .../detailnotisperingatan.blade.php | 19 +- .../views/callcenter/listcariansag.blade.php | 4 +- .../callcenter/rekodnotisperingatan.blade.php | 3 + routes/web.php | 2 + 7 files changed, 333 insertions(+), 23 deletions(-) create mode 100644 public/img/success.png create mode 100644 resources/views/callcenter/bycawdetailnotisperingatan.blade.php diff --git a/app/Http/Controllers/CallCenterController.php b/app/Http/Controllers/CallCenterController.php index 98861eb..a0ddbe3 100644 --- a/app/Http/Controllers/CallCenterController.php +++ b/app/Http/Controllers/CallCenterController.php @@ -51,7 +51,11 @@ class CallCenterController extends Controller $daritempoh = $request->daritempoh; $hinggatempoh = $request->hinggatempoh; - $cawangan_all = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/arcc/cawangan')->json(); + $cawangan_all = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/arcc/cawangan',[ + 'daritempoh' => $daritempoh, + 'hinggatempoh' => $hinggatempoh, + ])->json(); + $senarai = []; foreach($cawangan_all as $cawangan){ $kodcaw = $cawangan['kodcaw']; @@ -126,16 +130,6 @@ class CallCenterController extends Controller } - // public function rekodnotisperingatan(Request $request){ - // $auth_user = Auth::user(); - // $api_url = config('api.url'); - - - // $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - // $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); - // return view('callcenter.rekodnotisperingatan',compact('cawangan_info','api_url','rekodblast')); - // } - public function rekodnotisperingatan() { $auth_user = Auth::user(); @@ -166,7 +160,6 @@ class CallCenterController extends Controller $senarai = []; $detailnotis = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/getcawnotis/'.$notisid)->json(); - // dd($detailnotis[0]); foreach($detailnotis as $info) { $getcawnotisbycaw = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/getcawnotisbycaw', [ @@ -175,14 +168,62 @@ class CallCenterController extends Controller ])->json(); $data = [ - 'kodcaw'=>$info[0]['kodcaw'], - 'caw_name'=>$info[0]['details_caw'], + 'detailnotis' => $info ? $info : '', 'getcawnotisbycaw' => $getcawnotisbycaw ? $getcawnotisbycaw : '', ]; - array_push($senarai,$info,$data, ['info'=> $info, 'data'=>$data]); + array_push($senarai,$data); } - return view('callcenter.detailnotisperingatan',compact('detailnotis','senarai')); + return view('callcenter.detailnotisperingatan',compact('detailnotis','senarai','notisid')); + } + + public function bycawnotisperingatan($kodcaw,$notisid, Request $request) + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); + $bycawnotisperingatan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/bycawnotisperingatan/'.$kodcaw.'/'.$notisid)->json(); + + if($request->type == 'whatsapp') + { + + $blastwhatsapp = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/arcc/blastwasapbysag/'.$auth_user['cawangan'], + ['kodcaw' => $kodcaw,'notisid' => $notisid, 'namapengguna' => $auth_user['name'],])->json(); + if($blastwhatsapp == 'success'){ + return redirect()->route('arcc.bycawnotisperingatan',['kodcaw' => $kodcaw, 'notisid' => $notisid]) + ->with('success','Blast Whatsapp Dalam Proses.'); + } + elseif($blastwhatsapp == 'failed'){ + return redirect()->route('arcc.bycawnotisperingatan',['kodcaw' => $kodcaw, 'notisid' => $notisid]) + ->with('failed','Blast Whatsapp Tidak Berjaya, Sila Semak Semula Rekod Blasted.'); + } + + } + return view('callcenter.bycawdetailnotisperingatan',compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid')); + } + + public function blastpertama($kodcaw,$notisid,Request $request) + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); + $bycawnotisperingatan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/bycawnotisperingatan/'.$kodcaw.'/'.$notisid)->json(); + if($request->type == 'whatsapp') + { + + $blastwhatsapp = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/arcc/blastwasapbysag', + ['kodcaw' => $kodcaw,'notisid' => $notisid, 'namapengguna' => $auth_user['name'],])->json(); + if($blastwhatsapp == 'success'){ + return redirect()->route('arcc.bycawnotisperingatan',['kodcaw' => $kodcaw, 'notisid' => $notisid]) + ->with('success','Blast Whatsapp Dalam Proses.'); + } + elseif($blastwhatsapp == 'failed'){ + return redirect()->route('arcc.bycawnotisperingatan',['kodcaw' => $kodcaw, 'notisid' => $notisid]) + ->with('failed','Blast Whatsapp Tidak Berjaya, Sila Semak Semula Rekod Blasted.'); + } + + } + return view('callcenter.bycawdetailnotisperingatan',compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid')); } diff --git a/public/img/success.png b/public/img/success.png new file mode 100644 index 0000000000000000000000000000000000000000..c0bf7ad9c3c508c34d030a88f67b6571a89d1728 GIT binary patch literal 585 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%A+0*}aI1_o{+5N5n|x9$&60c(Iyh^u>nk7JKI5ZQOCGB7eK#Bz3Ya+4XFe>tyYovpE4XEe*;fbc;kirs`WZ%G*y?&~Fmc$`iI} zRmxZ$GVexZ&K@`AWM1_w0mp9jGoLoky;`T5#&6%Ds*xq6n#QM{CsMH2%YKT&nU9-v zi^RIlWX!u+Ip<1^ZM%v^qk=)Hq;-puV@yg5Fq8yKg8YIRykEWMdi_*QDVqDm+r;Ot zFSx~wz5pdRc)B=-NL+S3-YV1-AmVy4x!lH3&?U$5&AWH&{{I(|*E&4wX8F0+gAx}i zYa256c4eF^x8IQCb9h$tW5%4He4EX%Qryra0tneVKQuYV+f-tRvQAjo zvLf+?_f3Z1S%%9r!=5+%4(ZI+V&;BO$XXi4{$R`Pk}_jEV?UWk&SxH91G=5T)78&q Iol`;+017$X3jhEB literal 0 HcmV?d00001 diff --git a/resources/views/callcenter/bycawdetailnotisperingatan.blade.php b/resources/views/callcenter/bycawdetailnotisperingatan.blade.php new file mode 100644 index 0000000..f188f76 --- /dev/null +++ b/resources/views/callcenter/bycawdetailnotisperingatan.blade.php @@ -0,0 +1,255 @@ +@extends('layouts.app_operasi') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif + +
+ +
+ @csrf + + + + + + + + + + + + + + + + + + @foreach ($bycawnotisperingatan as $index => $item) + + + + + + + + + + @endif + {{-- --}} + + @endforeach +
BilNo.RujukanNamaNo.KPNo.TelefonTempohBaki Pembiayaan (RM)Tarikh Blast
{{ $loop->iteration }}{{$item['norujukan']}}{{$item['namacust']['nama'] ?? ''}}{{$item['nokp']}}{{$item['namacust']['telefon'] ?? ''}}{{$item['jbg']}}{{number_format($item['pinjaman'], 2, '.', ',')}} + @if($item['tarikhnotis1'] == null) + + @else + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['tarikhnotis1']); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphpLihat
+
+
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/callcenter/detailnotisperingatan.blade.php b/resources/views/callcenter/detailnotisperingatan.blade.php index 771d123..a226878 100644 --- a/resources/views/callcenter/detailnotisperingatan.blade.php +++ b/resources/views/callcenter/detailnotisperingatan.blade.php @@ -100,7 +100,8 @@ @@ -127,21 +128,27 @@ @csrf + + - {{dd($senarai[0])}} - @foreach ($senarai[0] as $index => $item) + @foreach ($senarai[0]['getcawnotisbycaw'] as $index => $item) + {{-- {{dd($item['namacaw'][$index]['status'])}} --}} - - - {{-- --}} + + + + @endforeach
Bil Cawangan Bilangan SuratBaki Pembiayaan (RM) Maklumat Lanjut
{{ $loop->iteration }}{{$item['details_caw']}}{{$item['getcawnotisbycaw']['totalsag']}}Lihat @if($item['namacaw'][$index]['status'] == 2) + + @endif{{$item['namacaw'][$index]['details_caw']}}{{count($item['detailbycaw'])}}{{number_format($item['totalbakipjm'],2)}}Lihat +
diff --git a/resources/views/callcenter/listcariansag.blade.php b/resources/views/callcenter/listcariansag.blade.php index 6d0af95..36f4a57 100644 --- a/resources/views/callcenter/listcariansag.blade.php +++ b/resources/views/callcenter/listcariansag.blade.php @@ -151,6 +151,7 @@ @php $count = 1; $totalsagall = 0; $totalberatall = 0; $totalpembiayaanall = 0; $totalbakipjmall = 0; $totaltunggakanall = 0; @endphp @foreach($senarai as $send) + @if($send['datagadai']['totalsag'] > 0) {{ $count++ }} @@ -168,7 +169,8 @@ $totalpembiayaanall += $send['datagadai']['totalpembiayaan']; $totalbakipjmall += $send['datagadai']['totalbakipjm']; $totaltunggakanall += $send['datagadai']['totaltunggakan']; - @endphp + @endphp + @endif @endforeach diff --git a/resources/views/callcenter/rekodnotisperingatan.blade.php b/resources/views/callcenter/rekodnotisperingatan.blade.php index 4994b37..9a41ade 100644 --- a/resources/views/callcenter/rekodnotisperingatan.blade.php +++ b/resources/views/callcenter/rekodnotisperingatan.blade.php @@ -149,6 +149,9 @@ {{$datez}} @foreach($item['cawnotis'] as $item1) @foreach($item1 as $item2) + @if($item2['status'] == 2) + + @endif {{ $item2['details_caw']}}
@endforeach @endforeach diff --git a/routes/web.php b/routes/web.php index e5a9f58..177561c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -403,6 +403,8 @@ Route::get('/cariansag',['as'=>'arcc.cariansag','uses'=>'CallCenterController@ca Route::post('/janadatanotisperingatan',['as'=>'arcc.janadatanotisperingatan','uses'=>'CallCenterController@janadatanotisperingatan'])->middleware('auth','callcenter'); Route::get('/rekodnotisperingatan',['as'=>'arcc.rekodnotisperingatan','uses'=>'CallCenterController@rekodnotisperingatan'])->middleware('auth','callcenter'); Route::get('/detailnotisperingatan/{notisid}',['as'=>'arcc.detailnotisperingatan','uses'=>'CallCenterController@detailnotisperingatan'])->middleware('auth','callcenter'); +Route::get('/bycawnotisperingatan/{kodcaw}/{notisid}',['as'=>'arcc.bycawnotisperingatan','uses'=>'CallCenterController@bycawnotisperingatan'])->middleware('auth','callcenter'); +Route::post('/blastpertama/{kodcaw}/{notisid}',['as'=>'arcc.blastpertama','uses'=>'CallCenterController@blastpertama'])->middleware('auth','callcenter');