|
|
|
|
|
|
|
|
if($request->modul == '02') |
|
|
if($request->modul == '02') |
|
|
{ |
|
|
{ |
|
|
$compound = Compound::with('ConfidentialFile')->where('non',$request->non)->first(); |
|
|
$compound = Compound::with('ConfidentialFile')->where('non',$request->non)->first(); |
|
|
|
|
|
$faulty = Faulty::with('DeedLaw', 'Department') ->where('_id', $compound->seksyen_kesalahan_n)->first(); |
|
|
|
|
|
$jbkod = $compound->jbkod_n; |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
$compound = Compound::with('ConfidentialFile')->where('kpd',$request->kpd)->first(); |
|
|
$compound = Compound::with('ConfidentialFile')->where('kpd',$request->kpd)->first(); |
|
|
|
|
|
$faulty = Faulty::with('DeedLaw', 'Department') ->where('_id', $compound->seksyen_kesalahan)->first(); |
|
|
|
|
|
$jbkod = $compound->jbkod; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$file = ConfidentialFile::where('no_siri',$compound->ConfidentialFile->no_siri)->first(); |
|
|
$file = ConfidentialFile::where('no_siri',$compound->ConfidentialFile->no_siri)->first(); |
|
|
$jbkod = $compound->jbkod; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = []; |
|
|
$now = Carbon::now(); |
|
|
$now = Carbon::now(); |
|
|
$gDate = $now->format('F Y'); |
|
|
$gDate = $now->format('F Y'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
$this->dispatch(new StoreCompoundEPBT($request->all(), $compound->kpd, $user->StaffDetail->full_name, $user->StaffDetail->no_badan, $compound->seksyen_kesalahan)); |
|
|
$this->dispatch(new StoreCompoundEPBT($request->all(), $compound->kpd, $user->StaffDetail->full_name, $user->StaffDetail->no_badan, $compound->seksyen_kesalahan)); |
|
|
|
|
|
|
|
|
|
|
|
$data = [ |
|
|
|
|
|
'non' => $compound->non, |
|
|
|
|
|
'jenis' => $compound->jenis_n |
|
|
|
|
|
'nama' => $compound->nama, |
|
|
|
|
|
'identity' => $compound->identity, |
|
|
|
|
|
'alamat' => $compound->alamat, |
|
|
|
|
|
'nama_kawasan' =>$compound->nama_kawasan, |
|
|
|
|
|
'nama_taman' => $compound->nama_taman, |
|
|
|
|
|
'nama_jalan' =>$compound->nama_jalan, |
|
|
|
|
|
'catatan' => $compound->catatan, |
|
|
|
|
|
'latlong' => $compound->latlong, |
|
|
|
|
|
'jabatan' => $faulty->Department->jnama, |
|
|
|
|
|
'akta' => $faulty->DeedLaw->nama, |
|
|
|
|
|
'tempoh' => $compound->tempoh, |
|
|
|
|
|
'tindakan' => $compound->tindakan ?? "", |
|
|
|
|
|
'created_n' => $compound->created_n, |
|
|
|
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$reg_id = array(); |
|
|
$reg_id = array(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(count($reg_id) > 0) { |
|
|
if(count($reg_id) > 0) { |
|
|
$client = new \GuzzleHttp\Client(); |
|
|
$client = new \GuzzleHttp\Client(); |
|
|
$result = $client->request('POST', url('api/push/notification'), [ |
|
|
$result = $client->request('POST', url('api/push/notification'), [ |
|
|
|
|
|
|
|
|
'form_params' => [ |
|
|
'form_params' => [ |
|
|
'title' => $roles->name.' '.$compound->kpd, |
|
|
'title' => $roles->name.' '.$compound->kpd, |
|
|
'msg' => 'Kompaun ini telah di pindahkan ke modul '.$roles->name, |
|
|
'msg' => 'Kompaun ini telah di pindahkan ke modul '.$roles->name, |
|
|
|
|
|
'data' => $data, |
|
|
'register_id' => $reg_id, |
|
|
'register_id' => $reg_id, |
|
|
] |
|
|
] |
|
|
]); |
|
|
]); |