/** * Show the form for creating a new resource. * Tạo công văn đến từ bộ * @return Response */ public function createbo() { if (Auth::check() && $this->rolechucnangs && $this->rolechucnangs->Them == 1) { $loaicongvans = Danhmucloaicongvan::get(array('id', 'name')); $capphathanhs = Danhmucnhomdonvi::where('bo', 1)->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 = User::all(); $domats = Danhmucdomat::get(array('id', 'name')); $dokhans = Danhmucdokhan::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(); $phong_id = User::where('id', Auth::user()->id)->value('phong_id'); $socongvanluu = Congvanden::getsohosoluubo($phong_id); $action = 'congvanden.storebo'; $title = 'bộ'; return view('congvanden.create')->with(array('loaicongvans' => $loaicongvans, 'domats' => $domats, 'dokhans' => $dokhans, 'menus' => $this->menus, 'capphathanhs' => $capphathanhs, 'noiphathanhs' => $noiphathanhs, 'mucdichs' => $mucdichs, 'linhvucchuyendes' => $linhvucchuyendes, 'chuyendes' => $chuyendes, 'socongvanluu' => $socongvanluu, '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'); } }