Пример #1
0
 public function GetHorasClases()
 {
     try {
         $clase_id = Input::get('clase_id');
         $date = \DateTime::createFromFormat('d/m/Y', Input::get("fecha"));
         $dia_semana = date('N', strtotime($date->format('Y-m-d')));
         $horas = DiasClases::join('dias', 'dias.id', '=', 'dias_clases.dia_id')->select('dias_clases.id as id', 'hora_inicio', 'hora_fin', 'dias.nombre')->where('clase_id', $clase_id)->where('dia_id', $dia_semana)->get()->toArray();
         return response()->json(array('success' => true, 'data' => $horas));
     } catch (\Exception $e) {
         return response()->json(array('success' => false));
     }
 }
Пример #2
0
 /**
  *
  * @return Response
  */
 public function ListaDiasCoachs($id_dias_clases)
 {
     $filter = DataFilter::source(DiasCoach::with('coach')->where('id_dias_clases', $id_dias_clases));
     /*Header*/
     $filter->link('dias_clases/' . DiasClases::find($id_dias_clases)->clase_id . '/lista', 'Lista Clases', 'TR');
     $filter->link('dias_coachs/' . $id_dias_clases . '/create', 'Crear Nuevo', 'TR');
     /*Header*/
     $filter->attributes(array('class' => 'form-inline'));
     $filter->add('coach.nombre', 'Buscar por Nombre', 'text');
     $filter->submit('Buscar');
     $filter->reset('Limpiar');
     $grid = DataGrid::source($filter);
     $grid->attributes(array("class" => "table table-striped"));
     $grid->add('coach.fullname', 'Nombre', true);
     $grid->edit(url('/') . '/dias_coachs/' . $id_dias_clases . '/edit', 'Editar/Borrar', 'modify|delete');
     $grid->paginate(10);
     return view('dias_coachs/lista', compact('filter', 'grid'));
 }