public function CancelaClase() { try { date_default_timezone_set('America/Santiago'); setlocale(LC_ALL, "es_ES"); $toma_clase = ClaseCoach::find(Input::get('toma_clase_id')); if (date("Y-m-d", strtotime($toma_clase->fecha)) >= date('Y-m-d')) { $toma_clase->delete(); return response()->json(array('success' => true, 'msg' => 'ok')); } else { return response()->json(array('success' => true, 'msg' => 'fecha_pasada')); } } catch (\Exception $e) { return response()->json(array('success' => false, 'msg' => 'error')); } }
public function CalendarioMisHorasTomadas() { $mes_actual = date('m'); $clases_coach = ClaseCoach::with('clase', 'usuario', 'dias_clases')->whereRaw($mes_actual . " = MONTH(fecha)")->where('user_id', \Auth::user()->id)->get(); return view('coach.calendario_mis_horas_tomadas', compact('clases_coach')); }