Browse Source

notification data

master
Siti Rahayu 4 years ago
parent
commit
2df720d6e3
1 changed files with 26 additions and 27 deletions
  1. 26
    27
      app/Http/Controllers/Main/TaskController.php

+ 26
- 27
app/Http/Controllers/Main/TaskController.php View File

return redirect()->back()->withInput()->with('error_msg','<strong>Tidak Berjaya!</strong> Kompaun ini sudah berada di dalam kategori modul '.$roles->name); return redirect()->back()->withInput()->with('error_msg','<strong>Tidak Berjaya!</strong> Kompaun ini sudah berada di dalam kategori modul '.$roles->name);
}else{ }else{



if($request->categori_modul == '03' && $compound->modul == '02')
{

$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(!empty($roles->staff_detail_ids)){ if(!empty($roles->staff_detail_ids)){
foreach($roles->staff_detail_ids as $s){ foreach($roles->staff_detail_ids as $s){
'verify' => false, 'verify' => false,
'form_params' => [ 'form_params' => [
'title' => $roles->name.' '.$compound->kpd, 'title' => $roles->name.' '.$compound->kpd,
'msg' => 'Kompaun ini telah di pindahkan ke modul '.$roles->name . '\n ' . $data,
'msg' => 'Kompaun ini telah di pindahkan ke modul '.$roles->name,
'register_id' => $reg_id, 'register_id' => $reg_id,
] ]
]); ]);
})->first(); })->first();
$role = Roles::where('kod', $compound->modul)->first(); $role = Roles::where('kod', $compound->modul)->first();


if($request->categori_modul == '03' && $compound->modul == '02')
{

$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,
];
}

if(!empty($staff)){ if(!empty($staff)){
if($staff->token_firebase != '') { if($staff->token_firebase != '') {
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
'verify' => false, 'verify' => false,
'form_params' => [ 'form_params' => [
'title' => $role->name.' '.$compound->kpd, 'title' => $role->name.' '.$compound->kpd,
'msg' => 'Kompaun ini berada di ruangan '.$role->name,
'msg' => 'Kompaun ini berada di ruangan '.$role->name . '\n' .$data,
'register_id[]' => $staff->token_firebase, 'register_id[]' => $staff->token_firebase,
] ]
]); ]);

Loading…
Cancel
Save