/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { 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["user"]->idrol == 7 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) { $data["nombres"] = Perfil::where('id_rol', 0)->orderBy('nombres')->get()->lists('UserFullName', 'id'); $data["departamentos"] = Area::lists('nombre', 'idarea'); $data["servicios"] = Servicio::lists('nombre', 'idservicio'); $data["sesiones"] = Sesion::lists('numero_sesion', 'id'); $data["programacion"] = ProgramacionDocente::find($id); $ini = Carbon\Carbon::now()->startOfMonth(); $end = Carbon\Carbon::now()->startOfMonth()->addMonth(); while ($ini->month != $end->month) { $dia = $ini->format('Y-m-d'); $temp = ProgramacionDocente::where('fecha', $dia)->get(); if (!$temp->isEmpty()) { $dayEvents = []; foreach ($temp as $var) { $dayEvents[$var->id] = $var; } $dias[$dia] = ["number" => count($dayEvents), "badgeClass" => "badge-warning", "dayEvents" => $dayEvents]; } else { $dias[$dia] = null; } $ini = $ini->addDay(); } $dias = json_encode($dias); $data["dias"] = $dias; return View::make('rrhh.programacion_docente.show', $data); } else { return View::make('error/error', $data); } } else { return View::make('error/error', $data); } }