Ejemplo n.º 1
0
function getRoundPlayers($roundId)
{
    $link = getDBConnection();
    $data = array();
    if (mysqli_select_db($link, getDBName())) {
        $roundId = intval($roundId);
        $query = mysqli_query($link, "SELECT user FROM roundActivity WHERE round = {$roundId} AND state = 'ACT'");
        while ($row = mysqli_fetch_assoc($query)) {
            $data[] = getCurrentStrategy($row['user'], mysqli_result(mysqli_query($link, "SELECT tournament FROM rounds WHERE id = {$roundId}"), 0));
        }
        mysqli_free_result($query);
    }
    return $data;
}
Ejemplo n.º 2
0
$_SESSION['tournamentState'] = 'training.php';
$tournamentId = intval($_GET['tournament']);
$gameId = intval($_GET['id']);
if (getActiveUserID() != -1) {
    ?>
            <h3>Тренировочные партии</h3>
        <a href="javascript:loadTrainingDuel(<?php 
    echo $gameId;
    ?>
, <?php 
    echo $tournamentId;
    ?>
)">Посмотреть</a>
<?php 
}
if (getCurrentStrategy(getActiveUserID(), $tournamentId) != null) {
    ?>
        <h3>Сыграть с участниками</h3>
        <table class="table table-bordered">
<?php 
    $users = getUsersList(true);
    foreach ($users as $user) {
        $strategies = getUserStrategies($gameId, $user['id'], $tournamentId, true);
        if (!empty($strategies)) {
            ?>
                    <tr align=center>
                        <td><b><?php 
            echo $user['login'];
            ?>
</b><br />
                            <select class="form-control" id="strategy-<?php