Ejemplo n.º 1
0
         $tmp = $tmp - $stdEtime;
         $_POST['etime'] = floor($tmp / 3600) . ":" . floor($tmp % 3600 / 60);
     }
     if (empty($_POST['mtime'])) {
         // if manipulation time is empty, calculate with discipline standard (15min before)
         $tmp = strtotime($_POST['hr'] . ":" . $_POST['min'] . ":00");
         $tmp = $tmp - $stdMtime;
         $_POST['mtime'] = floor($tmp / 3600) . ":" . floor($tmp % 3600 / 60);
     }
     // the other times are parsed in the timetable constructor
     $tt = new Timetable();
     $tt->add();
 } else {
     if ($_POST['arg'] == "del_round") {
         $tt = new Timetable();
         $tt->delete();
     } else {
         if ($_POST['arg'] == 'change_round') {
             list($_POST['hr'], $_POST['min']) = AA_formatEnteredTime($_POST['time']);
             // auto configure enrolement and manipulation time
             $result = mysql_query("\r\n        SELECT\r\n            d.Typ\r\n            , d.Appellzeit\r\n            , d.Stellzeit\r\n        FROM\r\n            wettkampf as w\r\n            LEFT JOIN disziplin as d USING(xDisziplin)\r\n        WHERE w.xWettkampf = " . $_POST['item']);
             $row = mysql_fetch_row($result);
             $stdEtime = strtotime($row[1]);
             // hold standard delay for enrolement time
             $stdMtime = strtotime($row[2]);
             // and manipulation time
             $tmp = strtotime($_POST['hr'] . ":" . $_POST['min'] . ":00");
             $tmp = $tmp - $stdEtime;
             $_POST['etime'] = floor($tmp / 3600) . ":" . floor($tmp % 3600 / 60);
             $tmp = strtotime($_POST['hr'] . ":" . $_POST['min'] . ":00");
             $tmp = $tmp - $stdMtime;