function DoQSchedule($Item, $Type = 'Q') { $Field = key($Item); switch ($Field) { case 'Day': $ret = InsertSchedDate(current($Item), $Type); break; case 'WarmTime': $ret = InsertSchedTime(current($Item), 'Warm', $Type); break; case 'WarmDuration': $ret = InsertSchedDuration(current($Item), 'Warm', $Type); break; case 'Start': $ret = InsertSchedTime(current($Item), '', $Type); break; case 'Duration': $ret = InsertSchedDuration(current($Item), '', $Type); break; case 'Shift': $ret = InsertSchedShift(current($Item), $Type); break; case 'Options': $ret = InsertSchedComment(current($Item), $Type); break; default: debug_svela($Field); } out($ret); }
if (!empty($_REQUEST['end'])) { foreach ($_REQUEST['end'] as $Session => $Distances) { foreach ($Distances as $Dist => $Value) { safe_w_sql("insert into DistanceInformation set\n\t\t\t\tDiTournament={$_SESSION['TourId']},\n\t\t\t\tDiDistance={$Dist},\n\t\t\t\tDiSession={$Session},\n\t\t\t\tDiType='Q',\n\t\t\t\tDiEnds={$Value}\n\t\t\t\ton duplicate key update\n\t\t\t\tDiEnds={$Value}\n\t\t\t\t"); $Errore = 0; } } } elseif (!empty($_REQUEST['arr'])) { foreach ($_REQUEST['arr'] as $Session => $Distances) { foreach ($Distances as $Dist => $Value) { safe_w_sql("insert into DistanceInformation set\n\t\t\t\tDiTournament={$_SESSION['TourId']},\n\t\t\t\tDiDistance={$Dist},\n\t\t\t\tDiSession={$Session},\n\t\t\t\tDiType='Q',\n\t\t\t\tDiArrows={$Value}\n\t\t\t\ton duplicate key update\n\t\t\t\tDiArrows={$Value}\n\t\t\t\t"); $Errore = 0; } } } elseif (!empty($_REQUEST['startday'])) { $ret = InsertSchedDate($_REQUEST['startday']); $Errore = $ret['error']; $Value = $ret['day']; } elseif (!empty($_REQUEST['starttime'])) { $ret = InsertSchedTime($_REQUEST['starttime']); $Errore = $ret['error']; $Value = $ret['start']; } elseif (!empty($_REQUEST['warmtime'])) { $ret = InsertSchedTime($_REQUEST['warmtime'], 'Warm'); $Errore = $ret['error']; $Value = $ret['warmtime']; } elseif (!empty($_REQUEST['duration'])) { $ret = InsertSchedDuration($_REQUEST['duration']); $Errore = $ret['error']; $Value = $ret['duration']; } elseif (!empty($_REQUEST['warmduration'])) {