From 86417f29cbf63ad127ccbc9bc74d32f02c59f0ab Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Tue, 19 Dec 2023 09:13:48 +0800 Subject: [PATCH] update function callcenter --- app/Http/Controllers/CallCenterController.php | 189 +++++++++++ app/Http/Kernel.php | 1 + app/Http/Middleware/CallCenter.php | 24 ++ .../detailnotisperingatan.blade.php | 240 ++++++++++++++ .../views/callcenter/listcariansag.blade.php | 310 ++++++++++++++++++ .../callcenter/notisperingatan.blade.php | 267 +++++++++++++++ .../callcenter/rekodnotisperingatan.blade.php | 253 ++++++++++++++ .../views/homepage/callcenter/home.blade.php | 26 ++ .../views/operasi/daftar_kakitangan.blade.php | 1 + routes/web.php | 8 + 10 files changed, 1319 insertions(+) create mode 100644 app/Http/Controllers/CallCenterController.php create mode 100644 app/Http/Middleware/CallCenter.php create mode 100644 resources/views/callcenter/detailnotisperingatan.blade.php create mode 100644 resources/views/callcenter/listcariansag.blade.php create mode 100644 resources/views/callcenter/notisperingatan.blade.php create mode 100644 resources/views/callcenter/rekodnotisperingatan.blade.php create mode 100644 resources/views/homepage/callcenter/home.blade.php diff --git a/app/Http/Controllers/CallCenterController.php b/app/Http/Controllers/CallCenterController.php new file mode 100644 index 0000000..98861eb --- /dev/null +++ b/app/Http/Controllers/CallCenterController.php @@ -0,0 +1,189 @@ +middleware('auth'); + } + + public function notisperingatan(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(); + + $kelulusan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/ListOperasi/')->json(); + + $arraykelulusan = []; + + + foreach($kelulusan as $index=>$lulus) + { + foreach($lulus['kelulusanall'] as $index=>$kel) + { + array_push($arraykelulusan,["cawangan" => $lulus['cawangan'], "cawangankod" => $lulus['cawangankod'],"namateller" => $kel['teller'], 'siri' => $kel['siri'] , "norujukan" => $kel['norujukan'], 'pinjaman' => $kel['jumpinj'],'komen' => $kel['komen'], 'nilaimarhun' => ($kel['nilaimarhun'] ?? '-'), 'berat' => ($kel['berat'] ?? '-'),'margin' => ($kel['margin'] ?? '-'), 'status' => ($kel['status'] ?? '-'), 'pelulus' => $kel['pelulus']]); + } + } + + + return view('callcenter.notisperingatan',compact('cawangan_info','api_url','arraykelulusan')); + } + + public function cariansag(Request $request) + { + // dd($request->all()); + $request->radaktif === 'aktif'; + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + $daritempoh = $request->daritempoh; + $hinggatempoh = $request->hinggatempoh; + + $cawangan_all = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/arcc/cawangan')->json(); + $senarai = []; + foreach($cawangan_all as $cawangan){ + $kodcaw = $cawangan['kodcaw']; + // $kodcaw = 'WCY'; + $datagadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/arcc/datagadai/'.$request->radaktif.'/'.$kodcaw ,[ + 'daritempoh' => $daritempoh, + 'hinggatempoh' => $hinggatempoh, + ])->json(); + + $data = [ + 'kodcaw'=>$cawangan['kodcaw'], + 'caw_name'=>$cawangan['details_caw'], + 'datagadai' => $datagadai ? $datagadai : '', + ]; + + array_push($senarai,$data); + + // dd($data); + } + + return view('callcenter.listcariansag', compact( + 'kodcaw', + 'senarai', + 'daritempoh', + 'hinggatempoh', + + )); + } + + public function janadatanotisperingatan(Request $request) + { + $current = Carbon::now(); + $current = new Carbon(); + $currentNow = Carbon::now(); + $senarai = []; + $tarikh_savedaftarnotis = $current->toDateString(); + $daritempoh = $request->daritempoh; + $hinggatempoh = $request->hinggatempoh; + $kodcaw = $request->kodcaw; + $selected_caw = $request->caw; + // dd($selected_caw); + + $getbatchnotis=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/arcc/getbatchnotis',[ + 'daritempoh' => $daritempoh, + 'hinggatempoh' => $hinggatempoh, + ])->json(); + + $newbatchnotis=$getbatchnotis; + + if(!empty($selected_caw)) + { + foreach($selected_caw as $index=>$caw){ + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $caw)->json(); + // dd($cawangan_info); + $insertdatagadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/arcc/insertdatagadai/aktif/'.$caw ,[ + 'daritempoh' => $daritempoh, + 'hinggatempoh' => $hinggatempoh, + 'kodcaw' => $caw, + 'notisid' => $newbatchnotis + ])->json(); + + $data = [ + 'kodcaw'=>$caw, + 'caw_name'=>$cawangan_info['details_caw'], + 'datagadai' => $insertdatagadai ? $insertdatagadai : '', + ]; + + array_push($senarai,$data); + } + } + return redirect()->route('arcc.notisperingatan')->with('success','Berjaya Daftar Notis Peringatan.'); + + } + + // 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(); + $api_url = config('api.url'); + + $arrayinfo = []; + + // $notis = Notis::select('tarikh_notis','id') + // ->groupBy('tarikh_notis') + // ->get(); + $notis = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/senarainotisperingatan')->json(); + // dd($notis); + foreach($notis as $info) + { + $getcawnotis = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/getcawnotis/'.$info['id'])->json(); + + array_push($arrayinfo, ['info'=> $info,'cawnotis' => $getcawnotis]); + } + // dd($arrayinfo); + return view('callcenter.rekodnotisperingatan',compact('notis','arrayinfo')); + } + + public function detailnotisperingatan($notisid) + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $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', [ + 'kodcaw' => $info[0]['kodcaw'], + 'notisid' => $notisid + ])->json(); + + $data = [ + 'kodcaw'=>$info[0]['kodcaw'], + 'caw_name'=>$info[0]['details_caw'], + 'getcawnotisbycaw' => $getcawnotisbycaw ? $getcawnotisbycaw : '', + ]; + + array_push($senarai,$info,$data, ['info'=> $info, 'data'=>$data]); + } + return view('callcenter.detailnotisperingatan',compact('detailnotis','senarai')); + } + + +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index f861f29..f563403 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -68,6 +68,7 @@ class Kernel extends HttpKernel 'penilai' => 'App\Http\Middleware\Penilai', 'khazanah' => 'App\Http\Middleware\Khazanah', 'operasi' => 'App\Http\Middleware\Operasi', + 'callcenter' => 'App\Http\Middleware\callcenter', 'admin' => 'App\Http\Middleware\Admin', 'audit' => 'App\Http\Middleware\Audit', 'masteradmin' => 'App\Http\Middleware\Masteradmin', diff --git a/app/Http/Middleware/CallCenter.php b/app/Http/Middleware/CallCenter.php new file mode 100644 index 0000000..21ee06a --- /dev/null +++ b/app/Http/Middleware/CallCenter.php @@ -0,0 +1,24 @@ +roles == 'callcenter')){ + return $next($request); + } + + return redirect('/login'); + } +} diff --git a/resources/views/callcenter/detailnotisperingatan.blade.php b/resources/views/callcenter/detailnotisperingatan.blade.php new file mode 100644 index 0000000..771d123 --- /dev/null +++ b/resources/views/callcenter/detailnotisperingatan.blade.php @@ -0,0 +1,240 @@ +@extends('layouts.app_operasi') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

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

{{ $message }}

+
+ @endif + +
+ +
+ @csrf + + + + + + + + + + + {{dd($senarai[0])}} + @foreach ($senarai[0] as $index => $item) + + + + + {{-- --}} + + @endforeach +
BilCawanganBilangan SuratMaklumat Lanjut
{{ $loop->iteration }}{{$item['details_caw']}}{{$item['getcawnotisbycaw']['totalsag']}}Lihat
+
+
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/callcenter/listcariansag.blade.php b/resources/views/callcenter/listcariansag.blade.php new file mode 100644 index 0000000..6d0af95 --- /dev/null +++ b/resources/views/callcenter/listcariansag.blade.php @@ -0,0 +1,310 @@ +@extends('layouts.app_operasi') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

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

{{ $message }}

+
+ @endif +
+ @csrf + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + @php $count = 1; $totalsagall = 0; $totalberatall = 0; $totalpembiayaanall = 0; $totalbakipjmall = 0; $totaltunggakanall = 0; @endphp + @foreach($senarai as $send) + + + + + + + + + + + + @php + $totalsagall += $send['datagadai']['totalsag']; + $totalberatall += $send['datagadai']['totalberat']; + $totalpembiayaanall += $send['datagadai']['totalpembiayaan']; + $totalbakipjmall += $send['datagadai']['totalbakipjm']; + $totaltunggakanall += $send['datagadai']['totaltunggakan']; + @endphp + @endforeach + + + + + + + + + {{-- --}} + + +
BilKod CawanganCawanganBilangan SAGTotal Berat (RM)Total Pembiayaan (RM)Total Baki Pembiayaan (RM)Total Tunggakan Keuntungan (RM)
{{ $count++ }}{{ $send['kodcaw'] }}{{ $send['caw_name'] }}{{$send['datagadai']['totalsag']}}{{number_format($send['datagadai']['totalberat'], 2)}}{{number_format($send['datagadai']['totalpembiayaan'], 2)}}{{number_format($send['datagadai']['totalbakipjm'], 2)}}{{number_format($send['datagadai']['totaltunggakan'], 2)}}
JUMLAH KESELURUHAN{{ number_format($totalsagall, 0, '.', ',') }}{{ number_format($totalberatall, 2, '.', ',') }}{{ number_format($totalpembiayaanall, 2, '.', ',') }}{{ number_format($totalbakipjmall, 2, '.', ',') }}{{ number_format($totaltunggakanall, 2, '.', ',') }}
+
+ + + +
+ + +
+ Kembali + +
+
+
+
+
+ + + + + +@endsection + diff --git a/resources/views/callcenter/notisperingatan.blade.php b/resources/views/callcenter/notisperingatan.blade.php new file mode 100644 index 0000000..431f907 --- /dev/null +++ b/resources/views/callcenter/notisperingatan.blade.php @@ -0,0 +1,267 @@ +@extends('layouts.app_operasi') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

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

{{ $message }}

+
+ @endif + +
+
+
+
+ @csrf +
+
+ Dari Tempoh +
+ +
+ +
+
+
+
+ Hingga Tempoh +
+ + +
+
+ +
+

+
+ {{--
--}} + {{-- --}} + {{-- --}} + {{--
--}} + +
+ +
+
+ + +
+ +
+ + + +
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/callcenter/rekodnotisperingatan.blade.php b/resources/views/callcenter/rekodnotisperingatan.blade.php new file mode 100644 index 0000000..4994b37 --- /dev/null +++ b/resources/views/callcenter/rekodnotisperingatan.blade.php @@ -0,0 +1,253 @@ +@extends('layouts.app_operasi') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

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

{{ $message }}

+
+ @endif + +
+ +
+ @csrf + + + + + + + + + + + + + + @foreach ($arrayinfo as $index => $item) + {{-- {{dd($item['cawnotis'])}} --}} + + + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['info']['tarikh_notis']); + $datez = $myDateTime->format('d-m-Y'); + @endphp + + + + + + + @endforeach +
BilTarikh NotisCawanganDari TempohHingga TempohMaklumat Lanjut
{{ $item['info']['id'] ?? '-' }} {{$datez}}@foreach($item['cawnotis'] as $item1) + @foreach($item1 as $item2) + {{ $item2['details_caw']}}
+ @endforeach + @endforeach
{{ $item['info']['daritempoh'] ?? '-' }}{{ $item['info']['hinggatempoh'] ?? '-' }}Lihat
+
+
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/homepage/callcenter/home.blade.php b/resources/views/homepage/callcenter/home.blade.php new file mode 100644 index 0000000..af7be2c --- /dev/null +++ b/resources/views/homepage/callcenter/home.blade.php @@ -0,0 +1,26 @@ +@extends('layouts.app_operasi') + +@section('content') +
+
+
+
+ + + + +
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/operasi/daftar_kakitangan.blade.php b/resources/views/operasi/daftar_kakitangan.blade.php index 5eb6922..1edfb87 100644 --- a/resources/views/operasi/daftar_kakitangan.blade.php +++ b/resources/views/operasi/daftar_kakitangan.blade.php @@ -49,6 +49,7 @@