Exemplo n.º 1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $titulo = "Calendario";
     $cursillos = Cursillos::getCalendarCursillos($request);
     $anyos = Cursillos::getAnyoCursillosList();
     //Obtenemos los parámetros de la respuesta
     $year = $request->input('anyo');
     $week = $request->input('semana') > 0 ? $request->input('semana') : 1;
     $semanas = array();
     //A partir del número de semana obtenemos el mes
     if ($year > 0 && $week > 0) {
         $month = new \DateTime();
         $month->setISODate($year, $week);
         $mes = $month->format('m');
         $year = $month->format('Y');
     }
     $date = $year > 0 ? date('Y-m-d', strtotime("{$year}-{$mes}-1")) : date('Y-m-d');
     //Cargamos los cursillos
     foreach ($cursillos as $cursillo) {
         $event[] = \Calendar::event($cursillo->comunidad, $cursillo->cursillo, true, $cursillo->fecha_inicio, date('Y-m-d', strtotime($cursillo->fecha_final) + 86400), $cursillo->colorFondo, $cursillo->colorTexto, $cursillo->id);
     }
     if (count($cursillos) > 0) {
         $calendar = \Calendar::addEvents($event)->setOptions(['lang' => '', 'defaultDate' => $date, 'buttonIcons' => true, 'editable' => false, 'weekNumbers' => true, 'eventLimit' => true, 'header' => array('left' => 'prev', 'center' => 'title', 'right' => 'next')])->setCallbacks(['eventClick' => 'function(calEvent, jsEvent, view) {
                 $(this).attr("href","curso/"+calEvent.id);
             }']);
     }
     return view('autenticado', compact('calendar', 'anyos', 'semanas', 'titulo'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $titulo = "Cursillos";
     $comunidades = Comunidades::getComunidadesList(0, true, "Comunidad...", true);
     $cursillos = Cursillos::getCursillos($request, config("opciones.paginacion"));
     $anyos = Cursillos::getAnyoCursillosList();
     $semanas = array();
     return view("cursillos.index", compact('comunidades', 'cursillos', 'titulo', 'anyos', 'semanas'));
 }
Exemplo n.º 3
0
 public function getAnyo()
 {
     $titulo = "Cerrar Año";
     $anyos = Cursillos::getAnyoCursillosList();
     return view("cerrarAnyo.getAnyo", compact('titulo', 'anyos'));
 }