Exemplo n.º 1
0
function updateRound($tournamentId, $roundId, $roundName, $checker, $previousRound, $seed)
{
    if (!isAdmin()) {
        return 4;
    }
    $link = getDBConnection();
    if (mysqli_select_db($link, getDBName())) {
        $tournament = getTournamentList($tournamentId);
        $gameId = $tournament['game'];
        $roundName = mysqli_real_escape_string($link, $roundName);
        $checker = intval($checker);
        $previousRound = intval($previousRound);
        if (mysqli_query($link, "UPDATE rounds SET tournament = {$tournamentId}, name = '{$roundName}', game = {$gameId}, checker = {$checker}, previousRound = {$previousRound}, seed = {$seed} WHERE id = {$roundId}")) {
            return 0;
        } else {
            return 1;
        }
    } else {
        return 2;
    }
}
Exemplo n.º 2
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)
Exemplo n.º 3
0
<script>
    changeActiveAdminButton('tournamentsButton');
</script>

<table class="table table-hover">
<thead>
<tr>
<td>Название</td>
<td>Игра</td>
<td>Тестировщик</td>
<td>Статус</td>
</tr>
</thead>
<tbody>
<?php 
$tours = getTournamentList();
foreach ($tours as $tour) {
    $checker = getCheckerList($tour['defaultChecker']);
    echo '<tr>';
    echo '<td><a href="?page=tournament&id=' . $tour['id'] . '"</a>' . $tour['name'] . '</td>';
    echo '<td><a href="?page=games&id=' . $tour['game'] . '">' . getGameName($tour['game']) . '</a></td>';
    echo '<td>' . $checker[0]['name'] . '</td>';
    echo '<td>' . $tour['state'] . '</td>';
    echo '</tr>';
}
?>
</tbody>
</table>