<?php

require_once realpath($_SERVER["DOCUMENT_ROOT"]) . '/login.php';
require_once realpath($_SERVER["DOCUMENT_ROOT"]) . $script_folder . '/signup functions.php';
date_default_timezone_set('America/Los_Angeles');
$tournamentKey = $_POST['tournament'];
if (!$tournamentKey) {
    die("Which tournament?");
}
$connection = new mysqli('p:' . $db_hostname, $db_username, $db_password, $db_database);
if ($connection->connect_error) {
    die($connection->connect_error);
}
$entries = GetSignUpWaitingList($connection, $tournamentKey);
for ($i = 0; $i < count($entries); ++$i) {
    echo $entries[$i]->GHIN1 . ',"' . $entries[$i]->Name1 . '",';
    echo $entries[$i]->GHIN2 . ',"' . $entries[$i]->Name2 . '",';
    echo $entries[$i]->GHIN3 . ',"' . $entries[$i]->Name3 . '",';
    echo $entries[$i]->GHIN4 . ',"' . $entries[$i]->Name4 . '",' . "\n";
}
$connection->close();
Exemple #2
0
function ShowWaitingList($connection, $tournament)
{
    $waitingList = GetSignUpWaitingList($connection, $tournament);
    if (count($waitingList) != 0) {
        echo '<p>' . PHP_EOL;
        echo '<table style="border:none;margin-left:auto;margin-right:auto">' . PHP_EOL;
        echo '<tr>' . PHP_EOL;
        echo '<td style="border:none;width=auto">' . PHP_EOL;
        echo '<table>' . PHP_EOL;
        echo '<thead><tr class="header"><th>Wait Listed</th></tr></thead>' . PHP_EOL;
        echo '<tbody>' . PHP_EOL;
        for ($i = 0; $i < count($waitingList); ++$i) {
            if (($i + 1) % 2 == 0) {
                echo '<tr class="d0"><td>';
            } else {
                echo '<tr class="d1"><td>';
            }
            echo $waitingList[$i]->Name1;
            if (!empty($waitingList[$i]->Name2)) {
                echo ', ' . $waitingList[$i]->Name2;
                if (!empty($waitingList[$i]->Name3)) {
                    echo ', ' . $waitingList[$i]->Name3;
                    if (!empty($waitingList[$i]->Name4)) {
                        echo ', ' . $waitingList[$i]->Name4;
                    }
                }
            }
            echo '</td></tr>';
            echo PHP_EOL;
        }
        echo '</tbody>' . PHP_EOL;
        echo '</table>' . PHP_EOL;
        echo '</td>' . PHP_EOL;
        echo '<td style="border: none;width:300px;">' . PHP_EOL;
        echo 'This tournament is oversubscribed; These players will be placed in the spot of any cancellations in the order listed. Players not getting an assigned time in this tournament will be given priority in the next tournament entered.';
        echo '</td>' . PHP_EOL;
        echo '</tr></table>' . PHP_EOL;
    }
}