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);
<tr class="Divider"><td colspan="10"></td></tr> <tr class="Divider"><td colspan="10"><form action="./PrnScheduler.php" target="PDF"> <b>' . get_text('MenuLM_PrintScheduling') . ':</b> <input type="checkbox" name="Finalists">' . get_text('SchIncFinalists', 'Tournament') . ' <input type="checkbox" name="Daily">' . get_text('DailySchedule', 'Tournament') . ' <input type="submit" name="Complete" value="' . get_text('CompleteSchedule', 'Tournament') . '"> <input type="submit" name="Today" value="' . get_text('ScheduleToday', 'Tournament') . '"> <input type="submit" name="FromDay" value="' . get_text('ScheduleFromDay', 'Tournament') . '"> <input type="text" name="FromDayDay"> </form></td></tr> <tr class="Divider"><td colspan="10"></td></tr> <tr><td id="Manager">'; // management echo '<table id="ScheduleTexts">'; // Get all the texts from the scheduler echo getScheduleTexts(); echo '</table>'; echo '<table>'; // Get all the qualification items with date & time $q = safe_r_sql("select DiSession,\r\n\t\tDiDistance,\r\n\t\tif(DiDay=0, '', DiDay) DiDay,\r\n\t\tif(DiStart=0, '', date_format(DiStart, '%H:%i')) DiStart,\r\n\t\tDiDuration,\r\n\t\tif(DiWarmStart=0, '', date_format(DiWarmStart, '%H:%i')) DiWarmStart,\r\n\t\tDiWarmDuration,\r\n\t\tDiOptions,\r\n\t\tif(SesName!='', SesName, DiSession) Session,\r\n\t\tDiShift\r\n\tfrom DistanceInformation\r\n\tinner join Session on SesTournament=DiTournament and SesOrder=DiSession and SesType=DiType and SesType='Q'\r\n\twhere DiTournament={$_SESSION['TourId']}\r\n\torder by DiSession, DiDistance"); echo '<tr> <th class="Title" colspan="6">' . get_text('Q-Session', 'Tournament') . '</th> <th class="Title" colspan="4" width="10%">' . get_text('WarmUp', 'Tournament') . '</th> </tr> <tr> <th class="Title" width="10%">' . get_text('Session') . '</th> <th class="Title" width="10%">' . get_text('Distance', 'Tournament') . '</th> <th class="Title" width="10%"><img src="' . $CFG->ROOT_DIR . 'Common/Images/Tip.png" title="' . get_Text('TipDate', 'Tournament') . '" align="right">' . get_text('Date', 'Tournament') . '</th> <th class="Title" width="10%">' . get_text('Time', 'Tournament') . '</th> <th class="Title" width="10%">' . get_text('Length', 'Tournament') . '</th> <th class="Title" width="10%">' . get_text('Delayed', 'Tournament') . '</th>