Example #1
0
<?php

$id = intval($_GET["id"]);
$tournamentId = intval($_GET["tournament"]);
if ($id == -1) {
    $tournament = getTournamentList($tournamentId);
    $checkers = getCheckerListByGameId($tournament['game']);
    $rounds = getRoundList($tournamentId);
    ?>
<script>
        function submitForm()
        {
            var checkers = document.getElementById('checker');
            var checker = checkers.options[checkers.selectedIndex].value;
            var roundName = document.getElementById('name').value;
            //var previousRound = document.getElementById('previousRoundSelector').value;
            //var strategyData = getAcceptedUsersStrategy();
            var strategyData = [];
            var accepted = document.getElementById('acceptedUsers').options;
            for (var i = 0; i < accepted.length; ++i) 
            {
                strategyData.push(accepted[i].value);
            }
            var seed = document.getElementById('seed').value;

            if (roundName == '')
            {
                showModalAlert('Название раунда не может быть пустым.')
                return;
            }
            if (checker == -1)
Example #2
0
    echo $id;
    ?>
&id=-1" role=button class='btn btn-default'>Новый раунд</a>
        <table class="table">
        <thead>
        <tr>
        <td>ID</td>
        <td>Название</td>
        <td>Дата</td>
        <td>Проведено дуэлей</td>
        <td></td>
        </tr>
        </thead>
        <tbody>
        <?php 
    $rounds = getRoundList($id);
    foreach ($rounds as $round) {
        if ($round['visible']) {
            echo "<tr>";
        } else {
            echo "<tr class=redColored>";
        }
        echo "<td>" . $round['id'] . "</td>";
        echo "<td><a href=?page=round&tournament=" . $id . "&id=" . $round['id'] . ">" . $round['name'] . "</a></td>";
        echo "<td>" . $round['date'] . "</td>";
        echo "<td>" . getCheckedDuels($round['id']) . " / " . countDuelsInRound($round['id']) . "</td>";
        if ($round['visible']) {
            echo "<td></td>";
        } else {
            echo "<td>";
            echo '<button type = "submit" name = "submit" ' . ' onclick = "openRound(' . $round['id'] . '); return false;" ' . ' class = "btn btn-default">';
Example #3
0
    }
    $_SESSION['adminTournamentId'] = $tournamentId;
    $roundId = -1;
    if (isset($_GET['round'])) {
        $roundId = intval($_GET['round']);
    }
    $_SESSION['adminRoundId'] = $roundId;
    $tournamentList = getTournamentList();
    $roundList = getRoundList($tournamentId);
    if ($tournamentId != -1) {
        $currentTournament = getTournamentList($tournamentId);
        $roundCheckerList = getCheckerListByGameId($currentTournament['game']);
    }
    $currentRound = -1;
    if ($roundId != -1) {
        $currentRound = getRoundList($tournamentId, $roundId);
    }
    $isEnded = checkRoundEnding($roundId);
    ?>

    <script>
        changeActiveAdminButton('roundsButton');
    </script>

    <script>
        
        function loadRoundData(tournamentId, roundId)
        {
            $('#dataContainer').load('AProunds.php?tournament=' + tournamentId + '&round=' + roundId);
        }