Esempio n. 1
0
    $RequestedTime = $_POST['RequestedTime'];
    for ($i = 0; $i < count($players); ++$i) {
        if ($t->TeamSize == 2 && $t->SCGAQualifier) {
            if ($i == 0 || $i == 1) {
                $teamFlightIndex = GetTeamFlightIndex(1);
                $Extra[$i] = $_POST[$teamFlightIndex];
            } else {
                $teamFlightIndex = GetTeamFlightIndex(2);
                $Extra[$i] = $_POST[$teamFlightIndex];
            }
            if (empty($_POST[$teamFlightIndex])) {
                $flightErrorList[$i] = "Select Flight";
            }
        } else {
            if ($t->SrClubChampionship) {
                $playerFlightIndex = GetPlayerFlightIndex($i + 1);
                $Extra[$i] = $_POST[$playerFlightIndex];
                if (empty($_POST[$playerFlightIndex])) {
                    $flightErrorList[$i] = "Select Flight";
                }
            }
        }
    }
}
$hasError = false;
for ($i = 0; $i < 4; ++$i) {
    if (!empty($error) || !empty($flightErrorList[$i])) {
        $hasError = true;
    }
}
echo '<div id="content-container" class="entry-content">' . PHP_EOL;
Esempio n. 2
0
function AddFlights($t, $playerNumber, $extraForPlayer, $errorForPlayer, $rowSpan)
{
    if ($t->SrClubChampionship) {
        $flightLabel = GetPlayerFlightIndex($playerNumber);
        if ($rowSpan > 1) {
            echo '<td rowspan = "' . $rowSpan . '" style="border: none;">' . PHP_EOL;
        } else {
            echo '<td style="border: none">' . PHP_EOL;
        }
        echo '<input  type="radio" name="' . $flightLabel . '" value="F1"';
        if ($extraForPlayer == 'F1') {
            echo ' checked';
        }
        echo '>Flight 1 (under 55)' . PHP_EOL;
        echo '<br><input  type="radio" name="' . $flightLabel . '" value="F2"';
        if ($extraForPlayer == 'F2') {
            echo ' checked';
        }
        echo '>Flight 2 (55-59)' . PHP_EOL;
        echo '<br><input  type="radio" name="' . $flightLabel . '" value="F3"';
        if ($extraForPlayer == 'F3') {
            echo ' checked';
        }
        echo '>Flight 3 (60-69)' . PHP_EOL;
        echo '<br><input  type="radio" name="' . $flightLabel . '" value="F4"';
        if ($extraForPlayer == 'F4') {
            echo ' checked';
        }
        echo '>Flight 4 (70 and older)' . PHP_EOL;
        echo '<br><input  type="radio" name="' . $flightLabel . '" value="CH"';
        if ($extraForPlayer == 'CH') {
            echo ' checked';
        }
        echo '>Championship (55 and older)' . PHP_EOL;
        if (!empty($errorForPlayer)) {
            echo '<p style="color:red">' . $errorForPlayer . '</p>' . PHP_EOL;
        }
        echo '</td>' . PHP_EOL;
    }
}