/** * Show the form for creating a new resource. * * @return Response */ public function create($id_programacion) { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); // Verifico si el usuario es un Webmaster if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) { $data["servicios"] = Servicio::orderBy('nombre')->get()->lists('nombre', 'idservicio'); $data["departamentos"] = Area::orderBy('nombre')->get()->lists('nombre', 'idarea'); $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id'); $data["programacion"] = ProgramacionInternado::find($id_programacion); return View::make('rrhh.plan_aprendizaje.create', $data); } else { return View::make('error/error', $data); } } else { return View::make('error/error', $data); } }
public function getNumeroInternadosAjax() { if (!Request::ajax() || !Auth::check()) { return Response::json(array('success' => false), 200); } $id = Auth::id(); $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) { $id_servicio = Input::get('id_servicio'); if ($id_servicio != '') { $programaciones = ProgramacionInternado::where('id_servicio_clinico', $id_servicio)->get(); if ($programaciones) { $numero = $programaciones->count(); } else { $numero = 0; } } else { $numero = 0; } return Response::json(array('success' => true, 'numero' => $numero), 200); } else { return Response::json(array('success' => false), 200); } }