/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Xoa == 1) {
         $danhmucchucvu = Danhmucchucvu::findOrFail($id);
         $danhmucchucvu->delete();
         return \Redirect::route('danhmucchucvu.index')->with('message', 'Xóa Thành Công!');
     } else {
         return \Redirect::route('danhmucchucvu.index');
     }
 }
Esempio n. 2
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');
     }
 }
Esempio n. 3
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) {
         $danhmucphongs = Danhmucphong::get(['id', 'name']);
         $danhmucchucvus = Danhmucchucvu::get(['id', 'name']);
         $canbo = Canbo::findOrFail($id);
         return view('canbo.edit')->with(array('canbo' => $canbo, 'danhmucphongs' => $danhmucphongs, 'danhmucchucvus' => $danhmucchucvus, 'menus' => $this->menus));
     } else {
         return \Redirect::route('danhmucchucvu.index');
     }
 }