function DistanceInfoData($r = '', $delete = false, $TextScheduler = false) { global $CFG; $return = array('error' => 1); if ($r or $delete) { $return['error'] = 0; if (isset($r->DiDay)) { $return['day'] = $r->DiDay == '0000-00-00' ? '' : $r->DiDay; } if (isset($r->DiStart)) { $return['start'] = $r->DiStart == '00:00:00' ? '' : substr($r->DiStart, 0, 5); } if (isset($r->DiDuration)) { $return['duration'] = $r->DiDuration; } if (isset($r->DiWarmStart)) { $return['warmtime'] = $r->DiWarmStart == '00:00:00' ? '' : substr($r->DiWarmStart, 0, 5); } if (isset($r->DiWarmDuration)) { $return['warmduration'] = $r->DiWarmDuration; } if (isset($r->DiShift)) { $return['shift'] = $r->DiShift; } if (isset($r->DiOptions)) { $return['options'] = $r->DiOptions; } if (isset($r->old)) { $return['old'] = $r->old; } if (isset($r->new)) { $return['new'] = $r->new; } if (isset($r->SchTitle)) { $return['title'] = $r->SchTitle; } if (isset($r->SchSubTitle)) { $return['subtitle'] = $r->SchSubTitle; } if (isset($r->SchText)) { $return['text'] = $r->SchText; } if (isset($r->SchOrder)) { $return['order'] = $r->SchOrder; } if (isset($r->oldTimName)) { $return['oldTimName'] = $r->oldTimName; } if (isset($r->oldDurName)) { $return['oldDurName'] = $r->oldDurName; } if (isset($r->oldOptName)) { $return['oldOptName'] = $r->oldOptName; } if (isset($r->newTimName)) { $return['newTimName'] = $r->newTimName; } if (isset($r->newDurName)) { $return['newDurName'] = $r->newDurName; } if (isset($r->newOptName)) { $return['newOptName'] = $r->newOptName; } if ($delete) { $return['del'] = 1; } $Schedule = new Scheduler(); $Schedule->ROOT_DIR = $CFG->ROOT_DIR; $return['sch'] = $Schedule->getScheduleHTML('SET'); if ($TextScheduler) { $return['txt'] = getScheduleTexts(); } } return $return; }
} $Value = sprintf('%02d:%02d:00', $t[0], $t[1]); } $q[] = "SchStart='{$Value}'"; break; case 'Duration': $Value = intval($Value); $q[] = "SchDuration='{$Value}'"; break; case 'Title': case 'SubTitle': case 'Text': $q[] = "Sch{$Field}=" . StrSafe_DB($Value); break; case 'Shift': if (strlen($Value)) { $Value = StrSafe_DB(intval($Value)); } else { $Value = 'null'; } $q[] = "SchShift=" . $Value; break; } } if ($HasDay) { safe_w_SQL("insert into Scheduler set " . implode(',', $q) . " on duplicate key update SchOrder=SchOrder+1, " . implode(',', $q)); } $Schedule = new Scheduler(); $Schedule->ROOT_DIR = $CFG->ROOT_DIR; $ret = array('error' => 0, 'txt' => getScheduleTexts(), 'sch' => $Schedule->getScheduleHTML('SET')); out($ret);
<td>'; foreach (explode('|', $r->FwOptions) as $k => $FwOption) { if ($k) { echo '<br/>'; } echo '<input size="50" type="text" name="Fld[' . $TeamEvent . '][Options][' . $r->GrPhase . '][' . $r->FsScheduledDate . '][' . $r->FsScheduledTime . '][' . $FwTimes[$k] . ']" value="' . $FwOption . '" onchange="DiUpdate(this)">'; } echo '</td> <td>'; foreach ($FwTimes as $k => $FwTime) { if ($k) { echo '<br/>'; echo '<input type="button" value="' . get_text('CmdDelete', 'Tournament') . '" onclick="DiDelSubRow(this, \'' . $TeamEvent . '|' . $r->GrPhase . '|' . $r->FsScheduledDate . '|' . $r->FsScheduledTime . '|' . $FwTime . '\')">'; } else { echo '<input type="button" value="' . get_text('CmdAdd', 'Tournament') . '" onclick="DiAddSubRow(this)">'; } } echo '</td> </tr>'; } } echo '</table>'; echo '</td>'; // Schedule echo '<td id="TrueScheduler" width="100%">'; $Schedule = new Scheduler(); $Schedule->ROOT_DIR = $CFG->ROOT_DIR; echo $Schedule->getScheduleHTML('SET'); echo '</td></tr>'; echo '</table>'; include 'Common/Templates/tail.php';