Esempio n. 1
0
function ChangeFinSchedDate($Request, $Team = '0')
{
    foreach ($Request as $Phase => $Dates) {
        foreach ($Dates as $OldDate => $Times) {
            foreach ($Times as $OldTime => $Value) {
                if (!$Value or $Value == '-') {
                    $Value = '';
                } elseif (strtolower(substr($Value, 0, 1)) == 'd') {
                    $Value = date('Y-m-d', strtotime(sprintf('%+d days', substr($Value, 1) - 1), $_SESSION['ToWhenFromUTS']));
                } else {
                    $Value = CleanDate($Value);
                }
                if ($Value) {
                    safe_w_sql("Update FinWarmup\n\t\t\t\t\t\tinner join FinSchedule on FsEvent=FwEvent and FsTeamEvent=FwTeamEvent and FsTournament=FwTournament and FsScheduledDate=FwDay and FsScheduledTime=FwMatchTime\n\t\t\t\t\t\tinner join Grids on FsMatchNo=GrMatchNo and GrPhase={$Phase}\n\t\t\t\t\t\tset FwDay='{$Value}'\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\tFwTournament={$_SESSION['TourId']}\n\t\t\t\t\t\t\tAND FwTeamEvent={$Team}\n\t\t\t\t\t\t\tAND FwDay='{$OldDate}'\n\t\t\t\t\t\t\tAND FwMatchTime='{$OldTime}'\n\t\t\t\t\t\t");
                    safe_w_sql("Update FinSchedule\n\t\t\t\t\t\tinner join Grids on FsMatchNo=GrMatchNo and GrPhase={$Phase}\n\t\t\t\t\t\tset FsScheduledDate='{$Value}'\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\tFsTournament={$_SESSION['TourId']}\n\t\t\t\t\t\t\tAND FsTeamEvent={$Team}\n\t\t\t\t\t\t\tAND FsScheduledDate='{$OldDate}'\n\t\t\t\t\t\t\tAND FsScheduledTime='{$OldTime}'\n\t\t\t\t\t\t");
                    // 				} else {
                    // 					safe_w_sql("update FinSchedule
                    // 						inner join Grids on FsMatchNo=GrMatchNo and GrPhase=$Phase
                    // 						set FsScheduledDate='',
                    // 							FsScheduledTime='',
                    // 							FsScheduledLen=0,
                    // 						where
                    // 							FsTournament={$_SESSION['TourId']}
                    // 							AND FsTeamEvent=$Team
                    // 							AND FsScheduledDate='$OldDate'
                    // 							AND FsScheduledTime='$OldTime'
                    // 						");
                }
                $SQL = "select\n\t\t\t\t\t\tFsScheduledDate DiDay, FsScheduledTime DiStart,\n\t\t\t\t\t\tFsScheduledLen DiDuration,\n\t\t\t\t\t\tFwTime DiWarmStart,\n\t\t\t\t\t\tFwDuration DiWarmDuration,\n\t\t\t\t\t\tFwOptions DiOptions,\n\t\t\t\t\t\t'[{$OldDate}][{$OldTime}]' old,\n\t\t\t\t\t\t'[{$Value}][{$OldTime}]' new,\n\t\t\t\t\t\tifnull(FsShift, '') as  DiShift\n\t\t\t\t\tfrom FinSchedule\n\t\t\t\t\tinner join Grids on FsMatchNo=GrMatchNo and GrPhase={$Phase}\n\t\t\t\t\tleft join FinWarmup on FsEvent=FwEvent and FsTeamEvent=FwTeamEvent and FsTournament=FwTournament and FsScheduledDate=FwDay and FsScheduledTime=FwMatchTime\n\t\t\t\t\twhere FsTournament={$_SESSION['TourId']}\n\t\t\t\t\t\tAND FsTeamEvent={$Team}\n\t\t\t\t\t\tAND FsScheduledDate='{$Value}'\n\t\t\t\t\t\tAND FsScheduledTime='{$OldTime}'\n\t\t\t\t\tgroup by FsTeamEvent, GrPhase, FsScheduledDate, FsScheduledTime\n\t\t\t\t\torder by FsTeamEvent, GrPhase desc";
                $q = safe_r_sql($SQL);
                return DistanceInfoData(safe_fetch($q));
            }
        }
    }
    return array('error' => 1);
}
Esempio n. 2
0
CheckTourSession(true);
require_once './LibScheduler.php';
if (empty($_REQUEST['Fld'])) {
    out();
}
$HasDay = false;
$q = array("SchTournament={$_SESSION['TourId']}");
foreach ($_REQUEST['Fld'] as $Field => $Value) {
    switch ($Field) {
        case 'Day':
            if (!$Value or $Value == '-') {
                $Value = '';
            } elseif (strtolower(substr($Value, 0, 1)) == 'd') {
                $Value = date('Y-m-d', strtotime(sprintf('%+d days', substr($Value, 1) - 1), $_SESSION['ToWhenFromUTS']));
            } else {
                $Value = CleanDate($Value);
            }
            if ($Value) {
                $HasDay = true;
                $q[] = "SchDay='{$Value}'";
            }
            break;
        case 'Start':
            if (!$Value or $Value == '-') {
                $Value = '';
            } else {
                $t = explode(':', $Value);
                if (count($t) == 1) {
                    $t[1] = $t[0] % 60;
                    $t[0] = intval($t[0] / 60);
                }
Esempio n. 3
0
if (isset($_REQUEST['Finalists'])) {
    $Schedule->Finalists = true;
}
if (isset($_REQUEST['Today'])) {
    $Schedule->SingleDay = date('Y-m-d');
    if (!empty($_REQUEST['FromDayDay'])) {
        if (strtolower(substr($_REQUEST['FromDayDay'], 0, 1)) == 'd') {
            $Date = date('Y-m-d', strtotime(sprintf('%+d days', substr($_REQUEST['FromDayDay'], 1) - 1), $_SESSION['ToWhenFromUTS']));
        } else {
            $Date = CleanDate($_REQUEST['FromDayDay']);
        }
        if ($Date) {
            $Schedule->SingleDay = $Date;
        }
    }
}
if (isset($_REQUEST['FromDay'])) {
    $Schedule->FromDay = date('Y-m-d');
    if (!empty($_REQUEST['FromDayDay'])) {
        if (strtolower(substr($_REQUEST['FromDayDay'], 0, 1)) == 'd') {
            $Date = date('Y-m-d', strtotime(sprintf('%+d days', substr($_REQUEST['FromDayDay'], 1) - 1), $_SESSION['ToWhenFromUTS']));
        } else {
            $Date = CleanDate($_REQUEST['FromDayDay']);
        }
        if ($Date) {
            $Schedule->FromDay = $Date;
        }
    }
}
$pdf = $Schedule->getSchedulePDF();
$pdf->Output();