kakitangan harian
This commit is contained in:
@@ -47,4 +47,37 @@ class KakitanganController extends Controller
|
||||
|
||||
return redirect()->route('daftar.kakitangan');
|
||||
}
|
||||
|
||||
public function kakitanganHarian(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$user_cawangan = User::where('cawangan','=',$auth_user['cawangan'])->get();
|
||||
|
||||
foreach($user_cawangan as $index=>$user){
|
||||
if($user['roles'] == 'teller'){
|
||||
if($user['id'] == $request->penilai){
|
||||
$role_harian = 'penilai';
|
||||
}else{
|
||||
$role_harian = 'teller';
|
||||
}
|
||||
}elseif($user['roles'] == 'ppc'){
|
||||
if($user['id'] == $request->khazanah){
|
||||
$role_harian = 'khazanah';
|
||||
}else{
|
||||
$role_harian = 'ppc';
|
||||
}
|
||||
}elseif($user['roles'] == 'pc'){
|
||||
if($user['id'] == $request->khazanah){
|
||||
$role_harian = 'khazanah';
|
||||
}else{
|
||||
$role_harian = 'pc';
|
||||
}
|
||||
}
|
||||
|
||||
User::where('id','=',$user['id'])->update(array(
|
||||
'role_harian' => $role_harian
|
||||
));
|
||||
}
|
||||
|
||||
return redirect()->route('home');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user