Пример #1
0
        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)) {
                echo '<p>' . $errorMsg . '</p>' . PHP_EOL;
            }
        }
        echo '</div><!-- #content -->' . PHP_EOL;
        echo '</div><!-- #content-container -->' . PHP_EOL;
    }
}
// end of else clause
function AddPlayer($t, $playerNumber, $GHIN, $lastName, $extraForPlayer, $errorForPlayer)
{
    $index = $playerNumber - 1;
    echo '<tr>' . PHP_EOL;
    echo '<td style="border: none;">' . GetPlayerGHINLabel($t, $playerNumber) . '</td>' . PHP_EOL;
    echo '<td style="border: none;"><input type="text" name="Player[' . $index . '][GHIN]"';
Пример #2
0
        if (count($customArray) > 2 && !empty($customArray[2])) {
            $players = trim($customArray[2]);
        }
    }
    if (DEBUG == true) {
        error_log(date('[Y-m-d H:i e] ') . "Verified IPN: {$req} " . PHP_EOL, 3, LOG_FILE);
    }
    if (!empty($tournamentKey)) {
        $logMessage = "submitKey = " . $submitKey . ", payment = " . $payment_amount . ", players = " . $players;
        $connection = new mysqli($db_hostname, $db_username, $db_password, $db_database);
        UpdateDatabase($connection, $tournamentKey, $submitKey, $payment_amount, $payerName, $payerEmail, $logMessage);
        $tournament = GetTournament($connection, $tournamentKey);
        // Send email if enabled and the payment amount is positive (not a refund)
        if (!empty($tournament) && $tournament->SendEmail && $payment_amount > 0) {
            $tournamentDates = GetFriendlyTournamentDates($tournament);
            SendSignupEmail($connection, $tournament, $tournamentDates, $submitKey, $web_site);
        }
        $connection->close();
    }
} else {
    if (strcmp($res, "INVALID") == 0) {
        // log for manual investigation
        // Add business logic here which deals with invalid IPN messages
        if (DEBUG == true) {
            error_log(date('[Y-m-d H:i e] ') . "Invalid IPN: {$req}" . PHP_EOL, 3, LOG_FILE);
        }
    }
}
function UpdateDatabase($connection, $tournamentKey, $submitKey, $payment, $payerName, $payerEmail, $logMessage)
{
    $logFile = "./logs/ipn." . $tournamentKey . ".log";