Example #1
0
require_once realpath($_SERVER["DOCUMENT_ROOT"]) . '/login.php';
require_once realpath($_SERVER["DOCUMENT_ROOT"]) . $script_folder . '/tournament_functions.php';
require_once realpath($_SERVER["DOCUMENT_ROOT"]) . $script_folder . '/results_functions.php';
require_once realpath($_SERVER["DOCUMENT_ROOT"]) . $wp_folder . '/wp-blog-header.php';
date_default_timezone_set('America/Los_Angeles');
$overrideTitle = "Closest To The Pin";
get_header();
echo ' <div id="content-container" class="entry-content">';
echo '    <div id="content" role="main">';
$connection = new mysqli('p:' . $db_hostname, $db_username, $db_password, $db_database);
$tournamentKey = $_GET['tournament'];
if ($tournamentKey) {
    $t = GetTournament($connection, $tournamentKey);
    if (isset($t)) {
        ShowResultsHeader($connection, $t, 'Closest-To-The-Pin', '');
        echo '<table style="border:none;margin-left:auto;margin-right:auto"><tbody>' . PHP_EOL;
        $ctpArray = GetClosestToThePin($connection, $tournamentKey, $t->StartDate);
        echo '<tr><td  style="border:none;">' . PHP_EOL;
        ShowClosestToThePin($t->StartDate, $ctpArray);
        echo '</td></tr>' . PHP_EOL;
        if (strcmp($t->StartDate, $t->EndDate) != 0) {
            $ctpArray = GetClosestToThePin($connection, $tournamentKey, $t->EndDate);
            echo '<tr><td  style="border:none;">' . PHP_EOL;
            ShowClosestToThePin($t->EndDate, $ctpArray);
            echo '</td></tr>' . PHP_EOL;
        }
        echo '</tbody></table>' . PHP_EOL;
    } else {
        echo "Invalid tournament: " . $tournamentKey;
    }
Example #2
0
                     $scoresResults = GetScoresResults($connection, $tournamentKey, $t->Stableford);
                     ShowScoresResults($scoresResults, $t->Stableford, $t->StartDate !== $t->EndDate);
                 }
             }
             break;
         case 'chits':
             ShowResultsHeader($connection, $t, 'Chits', '');
             if (isset($td->ChitsFile) && !empty($td->ChitsFile)) {
                 ShowFile($web_site, $td->ChitsFile);
             } else {
                 $chitsResults = GetChitsResults($connection, $tournamentKey);
                 ShowChitsResults($chitsResults, $t->MatchPlay);
             }
             break;
         case 'pool':
             ShowResultsHeader($connection, $t, 'Pool', '');
             echo '<p style="width:75%;margin-left:auto;margin-right:auto">Note: All players pool payouts are rounded to the nearest $5 for ease of distribution. Uneven amounts paid within a particular <i>Place</i> are determined by a card-off in accordance with the tournament manual.</p>';
             if (isset($td->PoolFile) && !empty($td->PoolFile)) {
                 ShowFile($web_site, $td->PoolFile);
             } else {
                 $poolResults = GetPoolResults($connection, $tournamentKey);
                 ShowPoolResults($poolResults);
             }
             break;
         default:
             die('You requested an unsupported result type: ' . $result);
     }
 } else {
     echo "Invalid tournament: " . $tournamentKey;
 }
 echo '    </div><!-- #content -->';