public function atender() { $result = 'fail'; $sgrEvento = new sgrEvento(); if ($sgrEvento->atenderEvento(Input::all())) { $result = 'success'; } return $result; //return "success"; }
private function existeSolapamientodb($data, $numFila, $recursos) { $fechaDesde = sgrDate::dateCSVtoSpanish($data['F_DESDE_HORARIO1']); $fechaHasta = sgrDate::dateCSVtoSpanish($data['F_HASTA_HORARIO1']); $nRepeticiones = sgrDate::numRepeticiones($fechaDesde, $fechaHasta, $data['COD_DIA_SEMANA']); for ($j = 0; $j < $nRepeticiones; $j++) { //foreach //fecha Evento $startDate = sgrDate::timeStamp_fristDayNextToDate($fechaDesde, $data['COD_DIA_SEMANA'], 'Y-m-d'); $currentfecha = sgrDate::fechaEnesimoDia($startDate, $j); $sgrEvento = new sgrEvento(); foreach ($recursos as $recurso) { if (0 < $sgrEvento->solapa($recurso->id, $currentfecha, $data['INI'], $data['FIN'])) { //hay solape: fin -> return true return true; } } //fin foreach cada puesto o equipo, (espacio el array recurso solo contiene un elemento) } //fin foreach repeticion periodica return false; }