date_default_timezone_set('America/Los_Angeles'); $tournamentKey = $_GET['tournament']; if (!$tournamentKey) { die("Which tournament?"); } $submitKey = $_GET['signup']; if (empty($submitKey)) { die("Which signup?"); } $testMode = false; if ($_GET['mode'] == "test") { $testMode = true; } $overrideTitle = "Pay"; get_header(); get_sidebar(); $connection = new mysqli($db_hostname, $db_username, $db_password, $db_database); if ($connection->connect_error) { die($connection->connect_error); } echo ' <div id="content-container" class="entry-content">'; echo ' <div id="content" role="main">'; $tournament = GetTournament($connection, $tournamentKey); if (empty($tournament)) { die("Invalid tournament key: " . $tournamentKey); } ShowPayment($web_site, $ipn_file, $script_folder_href, $connection, $tournament, $submitKey, null, $testMode); echo ' </div><!-- #content -->'; echo ' </div><!-- #content-container -->'; $connection->close(); get_footer();
} $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>'; echo '<p style="text-align: center;"><b>' . $accessCode . '</b> </p>' . PHP_EOL; } echo '<p><a href="' . 'signups.php?tournament=' . $tournamentKey . '">View Signups</a></p>' . PHP_EOL; if ($t->SendEmail) { $tournamentDates = GetFriendlyTournamentDates($t); $errorMsg = SendSignupEmail($connection, $t, $tournamentDates, $insertId, $web_site); if (!empty($errorMsg)) {