public function getnguoiky($nguoiky_id) { $nguoiky = Canbo::where('id', $nguoiky_id)->first(); return $nguoiky; }
/** * 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) { $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')); $phongs = Danhmucphong::orderBy('name')->get(); $dois = Danhmucdoi::orderBy('name')->get(); $canbos = User::where('role_id', '>', 2)->orderBy('name')->get(); $emails = Danhmucemail::orderBy('name')->get(); $domats = Danhmucdomat::get(array('id', 'name')); $dokhans = Danhmucdokhan::get(array('id', 'name')); $congvanden = Congvanden::findOrFail($id); if ($congvanden->sohosoluubo) { $action = 'congvanden.update'; $title = 'bộ'; } else { $action = 'congvanden.update'; $title = ''; } $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.edit')->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, 'emails' => $emails, 'action' => $action, 'title' => $title)); } else { return \Redirect::route('congvanden.index')->with('message-error', 'Không có quyền truy cập'); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Xoa == 1) { $canbo = Canbo::findOrFail($id); $canbo->delete(); return \Redirect::route('danhmucchucvu.index')->with('message', 'Xóa Thành Công!'); } else { return \Redirect::route('danhmucchucvu.index'); } }
/** * 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) { $noisoanthaos = Danhmucphong::get(array('id', 'name')); $nguoikys = Canbo::get(array('id', 'name')); $mucdichs = Danhmucmucdich::get(array('id', 'name')); $linhvucchuyendes = Linhvucchuyende::get(array('id', 'name')); $chuyendes = Danhmucchuyende::get(array('id', 'name')); $loaicongvans = Danhmucloaicongvan::get(array('id', 'name')); $hinhthucchuyens = Danhmuchinhthucchuyen::get(array('id', 'name')); $dokhans = Danhmucdokhan::get(array('id', 'name')); $domats = Danhmucdomat::get(array('id', 'name')); $noinhancongvans = Danhmucdonvi::all(); $phongs = Danhmucphong::orderBy('name')->get(); $dois = Danhmucdoi::orderBy('name')->get(); $canbos = User::where('role_id', '>', 2)->orderBy('name')->get(); $emails = Danhmucemail::orderBy('name')->get(); $congvandi = Congvandi::findOrFail($id); return view('congvandi.edit')->with(array('congvandi' => $congvandi, 'loaicongvans' => $loaicongvans, 'hinhthucchuyens' => $hinhthucchuyens, 'domats' => $domats, 'dokhans' => $dokhans, 'menus' => $this->menus, 'noisoanthaos' => $noisoanthaos, 'nguoikys' => $nguoikys, 'mucdichs' => $mucdichs, 'linhvucchuyendes' => $linhvucchuyendes, 'chuyendes' => $chuyendes, 'phongs' => $phongs, 'dois' => $dois, 'canbos' => $canbos, 'emails' => $emails)); } else { return \Redirect::route('congvandi.index')->with('message-error', 'Không có quyền truy cập'); } }
/** * 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'); } }