// Move to team 1
                                UpdateSignupPlayer($connection, $signupKey, $players[$i]->GHIN, 'Position', 0, 'i');
                            } else {
                                if ($players[$i]->Position == 3) {
                                    // Move to team 1
                                    UpdateSignupPlayer($connection, $signupKey, $players[$i]->GHIN, 'Position', 1, 'i');
                                }
                            }
                        }
                    }
                }
            } else {
                // Just update everyone's position to fill the missing spot
                $players = GetPlayersForSignUp($connection, $signupKey);
                for ($i = 0; $i < count($players); ++$i) {
                    UpdateSignupPlayer($connection, $signupKey, $players[$i]->GHIN, 'Position', $i, 'i');
                }
            }
            $players = GetPlayersForSignUp($connection, $signupKey);
            if (empty($players)) {
                DeleteSignup($connection, $signupKey);
                $allPlayersRemoved = true;
            }
        }
    }
}
echo '<div id="content-container" class="entry-content">' . PHP_EOL;
echo '<div id="content" role="main">' . PHP_EOL;
echo '<h2 class="entry-title" style="text-align:center">Remove Players</h2>' . PHP_EOL;
echo '<p>Use this form to remove players in your group. Use the checkbox to indicate which players to remove.  Multiple players can be removed in a single request.</p>';
if ($tournament->RequirePayment) {
Beispiel #2
0
        echo '</table>' . PHP_EOL;
    }
    echo '<input type="hidden" name="tournament" value="' . $tournamentKey . '">' . PHP_EOL;
    echo '<input type="submit" value="Submit"> <br> <br>' . PHP_EOL;
    echo '</form>' . PHP_EOL;
} else {
    // Make the modifications
    UpdateSignup($connection, $signupKey, 'RequestedTime', $RequestedTime, 's');
    if ($t->TeamSize == 2 && $t->SCGAQualifier) {
        for ($i = 0; $i < count($players); ++$i) {
            UpdateSignupPlayer($connection, $signupKey, $players[$i]->GHIN, 'Extra', $Extra[$i], 's');
        }
    } else {
        if ($t->SrClubChampionship) {
            for ($i = 0; $i < count($players); ++$i) {
                UpdateSignupPlayer($connection, $signupKey, $players[$i]->GHIN, 'Extra', $Extra[$i], 's');
            }
        }
    }
    echo '<p>' . PHP_EOL;
    echo 'Your changes have been saved.' . PHP_EOL;
    echo '</p>' . PHP_EOL;
}
// end of else clause
echo '<p>' . PHP_EOL;
echo '<a href="signups.php?tournament=' . $tournamentKey . '">View Signups</a>' . PHP_EOL;
echo '</p>' . PHP_EOL;
echo '</div><!-- #content -->' . PHP_EOL;
echo '</div><!-- #content-container -->' . PHP_EOL;
function AddPlayer($t, $playerNumber, $players, $extra, $error)
{
Beispiel #3
0
        echo '</form>' . PHP_EOL;
    }
} else {
    // Make the modifications
    $players2 = GetPlayersForSignUp($connection, $signup2->SignUpKey);
    if (count($players2) == 0) {
        die("There are no players for added group signup code " . $signup2->SignUpKey);
    }
    // Update the signup position for the players merging into the
    // group. Position is 0 based.
    $position = count($players);
    for ($i = 0; $i < count($players2); ++$i) {
        UpdateSignupPlayer($connection, $signup2->SignUpKey, $players2[$i]->GHIN, 'Position', $position, 'i');
        ++$position;
        // Change the signup key to be the key for the 1st group
        UpdateSignupPlayer($connection, $signup2->SignUpKey, $players2[$i]->GHIN, 'SignUpKey', $signupKey, 'i');
    }
    // Update the payment and payment due to be the sum of the 2 groups
    UpdateSignup($connection, $signupKey, 'Payment', $signup->Payment + $signup2->Payment, 'd');
    UpdateSignup($connection, $signupKey, 'PaymentDue', $signup->PaymentDue + $signup2->PaymentDue, 'd');
    // Remove the 2nd signup
    DeleteSignup($connection, $signup2->SignUpKey);
    echo '<p>The new players have been added to your group.</p>' . PHP_EOL;
    $players = GetPlayersForSignUp($connection, $signupKey);
    if ($t->TeamSize == 2 && $t->SCGAQualifier) {
        if (count($players) >= 2) {
            if ($players[0]->Extra !== $players[1]->Extra) {
                echo '<p style="color:red;">The flight choices for players 1 & 2 do not match. Use the Modify action from the View Signups page to update the flight choice.' . PHP_EOL;
            }
        }
        if (count($players) == 4) {