public function assignRoleUserForm($role_id) { $not_assigned_users = User::whereNull('role_id')->get(); $role = Role::find($role_id); return view('backend.role.user_assign')->with('content_title', "Assign User")->with('not_assigned_users', $not_assigned_users)->with('role', $role)->with('module', $this->module); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Sua == 1) { $congviec = Congviec::findOrFail($id); $nguoinhans = User::where('role_id', '>', 2)->orderBy('name', 'desc')->get(); $nguonphatsinhs = Danhmucnguonphatsinh::orderBy('name')->get(); $tinhtrangcongviecs = Tinhtrangcongviec::orderBy('name')->get(); $canbogiaos = $users = User::whereNull('users.deleted_at')->where('role_id', '>=', '3')->get(); $getfiletralois = \DB::table('file_traloicongviecs')->where('congviec_id', $id)->get(); $getcountups = \DB::table('file_traloicongviecs')->where('congviec_id', $id)->distinct()->select('stt')->get(); $getusers = \DB::table('file_traloicongviecs')->where('congviec_id', $id)->distinct()->select('user_id')->get(); return view('congviec.edit')->with(array('congviec' => $congviec, 'tinhtrangcongviecs' => $tinhtrangcongviecs, 'nguonphatsinhs' => $nguonphatsinhs, 'nguoinhans' => $nguoinhans, 'canbogiaos' => $canbogiaos, 'getcountups' => $getcountups, 'getfiletralois' => $getfiletralois, 'getusers' => $getusers, 'menus' => $this->menus)); } else { return \Redirect::route('congviec.index')->with('message-error', 'Không có quyền truy cập'); } }
public function showuser() { $users = User::whereNull('users.deleted_at')->where('role_id', '>=', '3')->get(); return response()->json($users); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function getIndex() { /*Get users*/ $users = User::whereNull('deleted_at')->paginate(15); return View('admin.users.index', compact('users')); }
/** * Display the specified resource. * * @return \Illuminate\Http\Response */ public function show() { $data = ['title' => 'Teleaus Admin Dashboard | All User', 'users' => User::whereNull('deleted_at')->get()]; return view('dashboard.allUser')->with($data); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Sua == 1) { $cuochop = Cuochop::findOrFail($id); $phonghops = Danhmucphonghop::all(); $canbogiaos = $users = User::whereNull('users.deleted_at')->where('role_id', '>=', '3')->get(); $nguoinhans = User::where('role_id', '>', 2)->orderBy('name', 'desc')->get(); $nguonphatsinhs = Danhmucnguonphatsinh::orderBy('name')->get(); $tinhtrangcongviecs = Tinhtrangcongviec::orderBy('name')->get(); $lanhdaos = Canbo::orderBy('name')->get(); $giaoviecs = ['canbogiaos' => $canbogiaos, 'nguoinhans' => $nguoinhans, 'nguonphatsinhs' => $nguonphatsinhs, 'tinhtrangcongviecs' => $tinhtrangcongviecs]; return view('cuochop.edit')->with(['cuochop' => $cuochop, 'giaoviecs' => $giaoviecs, 'lanhdaos' => $lanhdaos, 'phonghops' => $phonghops, 'menus' => $this->menus]); } else { return \Redirect::to('cuochop.index')->with('message-error', 'Không có quyền truy cập'); } }
public static function getNoRoleUser() { $users = User::whereNull('role_id')->whereNull('deleted_at')->get(); return $users; }