tambah function notis peringatan untuk arcc
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user