コード例 #1
0
ファイル: signup.php プロジェクト: palbitz1003/CMGC
 }
 $entryFees = 0;
 $accessCode = rand(1000, 9999);
 if ($t->RequirePayment) {
     $cost = $t->Cost;
     if ($testMode) {
         $cost = 3;
     }
     $paypalDetails = GetPayPalDetails($connection, $cost);
     if (!isset($paypalDetails->PayPayButton)) {
         die("No PayPal button for tournament fee " . $cost);
     }
     $entryFees = $playerCount * ($paypalDetails->TournamentFee + $paypalDetails->ProcessingFee);
 }
 // The signup has no errors. Proceed to sign up the group. First create the signup entry.
 $insertId = InsertSignUp($connection, $tournamentKey, $RequestedTime, $entryFees, $accessCode);
 // echo 'insert id is: ' . $insertId . '<br>';
 // Now add the players to the signup entry
 InsertSignUpPlayers($connection, $tournamentKey, $insertId, $GHIN, $FullName, $Extra);
 if ($t->RequirePayment) {
     echo '<div id="content-container" class="entry-content">' . PHP_EOL;
     echo '<div id="content" role="main">' . PHP_EOL;
     ShowPayment($web_site, $ipn_file, $script_folder_href, $connection, $t, $insertId, $accessCode, $testMode);
     echo '</div><!-- #content -->' . PHP_EOL;
     echo '</div><!-- #content-container -->' . PHP_EOL;
 } else {
     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">' . $tournament->Name . ' Signup Complete</h2>' . PHP_EOL;
     if (!empty($accessCode)) {
         echo '<p>Your signup data has been saved.  Here is your access code to make changes to your signup. Save this code for later!</p>';
コード例 #2
0
ファイル: signup_submit.php プロジェクト: palbitz1003/CMGC
    }
}
$tournamentKey = $_POST['tournament'];
if (!$tournamentKey) {
    //var_dump($_POST);
    die("Which tournament?");
}
if (empty($GHIN[0])) {
    echo 'Player 1 GHIN is not filled in<br>';
} else {
    if (empty($LastName[0])) {
        echo 'Player 1 Last Name is not filled in<br>';
    } else {
        $anyoneAlreadySignedUp = false;
        for ($i = 0; $i < count($GHIN); ++$i) {
            if (IsPlayerSignedUp($connection, $tournamentKey, $GHIN[$i])) {
                echo 'Player ' . $GHIN[$i] . ' is already signed up<br>';
                $anyoneAlreadySignedUp = true;
            }
        }
        if ($anyoneAlreadySignedUp) {
            return;
        }
        $insertId = InsertSignUp($connection, $tournamentKey, $RequestedTime);
        // echo 'insert id is: ' . $insertId . '<br>';
        InsertSignUpPlayers($connection, $tournamentKey, $insertId, $GHIN, $LastName, $Extra);
    }
}
ShowSignups($connection, $tournamentKey);
$connection->close();
get_sidebar();