Beispiel #1
0
 /**
  * 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) {
         $roles = Role::all();
         $dois = Danhmucdoi::all();
         $phongs = Danhmucphong::all();
         $chucvus = Danhmucchucvu::get();
         $capbacs = Danhmuccapbac::get();
         $user = User::findOrFail($id);
         return view('user.edit')->with(array('menus' => $this->menus, 'roles' => $roles, 'user' => $user, 'dois' => $dois, 'phongs' => $phongs, 'chucvus' => $chucvus, 'capbacs' => $capbacs));
     } else {
         return \Redirect::route('user.index')->with('message-error', 'Không có quyền truy cập');
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Xem == 1) {
         $loaicongvans = Danhmucloaicongvan::get(array('id', 'name'));
         $capphathanhs = Danhmucnhomdonvi::get(array('id', 'name'));
         $noiphathanhs = Danhmucdonvi::get(array('id', 'name', 'danhmucnhomdonvi_id'));
         $mucdichs = Danhmucmucdich::get(array('id', 'name'));
         $linhvucchuyendes = Linhvucchuyende::get(array('id', 'name'));
         $chuyendes = Danhmucchuyende::get(array('id', 'name', 'linhvucchuyende_id'));
         $chutrixulys = Danhmucphong::get(array('id', 'name'));
         $phoihopxulys = Danhmucphong::get(array('id', 'name'));
         $canboxulys = Canbo::get(array('id', 'name'));
         $domats = Danhmucdomat::get(array('id', 'name'));
         $dokhans = Danhmucdokhan::get(array('id', 'name'));
         $menus = Menu::all();
         $phongs = Danhmucphong::all();
         $dois = Danhmucdoi::all();
         $canbos = User::where('role_id', '>', 2)->get();
         $congvanden = Congvanden::findOrFail($id);
         $getfiletralois = \DB::table('file_traloicongvandens')->where('congvanden_id', $id)->get();
         $getcountups = \DB::table('file_traloicongvandens')->where('congvanden_id', $id)->distinct()->select('stt')->get();
         $getusers = \DB::table('file_traloicongvandens')->where('congvanden_id', $id)->distinct()->select('user_id')->get();
         return view('congvanden.show')->with(array('congvanden' => $congvanden, 'getcountups' => $getcountups, 'getfiletralois' => $getfiletralois, 'getusers' => $getusers, 'loaicongvans' => $loaicongvans, 'domats' => $domats, 'dokhans' => $dokhans, 'menus' => $this->menus, 'capphathanhs' => $capphathanhs, 'noiphathanhs' => $noiphathanhs, 'mucdichs' => $mucdichs, 'linhvucchuyendes' => $linhvucchuyendes, 'chuyendes' => $chuyendes, 'chutrixulys' => $chutrixulys, 'phoihopxulys' => $phoihopxulys, 'canboxulys' => $canboxulys, 'phongs' => $phongs, 'dois' => $dois, 'canbos' => $canbos));
     } else {
         return \Redirect::route('congvanden.index')->with('message-error', 'Không có quyền truy cập');
     }
 }