Example #1
0
function printTournamentTitle($id, $link)
{
    $tour = getTournamentData($id);
    printTitleItem(getRusTitle("games"), "?page=games");
    printTitleItem(getGameName($tour['game']), "?page=game&id=" . $tour['game']);
    printTitleItem(getRusTitle("tournaments"), "?page=tournaments");
    printTitleItem($tour['name'], $link ? "?page=tournament&id=" . $id : "");
}
Example #2
0
function getGameByTournament($tournamentId)
{
    if ($tournamentId == -1) {
        return -1;
    } else {
        $data = getTournamentData($tournamentId);
        return $data['game'];
    }
}
Example #3
0
<?php

$id = intval($_GET["id"]);
$action = $_GET["action"];
if ($id == -1) {
    $gameId = intval($_GET["gameid"]);
    $name = "";
    $description = "";
    $state = "preparing";
    $checker = -1;
} else {
    $tour = getTournamentData($id);
    $gameId = $tour['game'];
    $name = $tour['name'];
    $description = trim($tour['description']);
    $state = $tour['state'];
    $checker = $tour['defaultChecker'];
}
if ($action == "edit") {
    ?>
<script>
    function submitForm()
    {
        var name = document.getElementById('name').value;
        var description = CKEDITOR.instances.description.getData();
        var state = document.getElementById('state').value;
        var checker = document.getElementById('checker').value;
        var id = <?php 
    echo $id;
    ?>
;
Example #4
0
<?php

include_once 'procedures.php';
$tournamentId = intval($_GET['id']);
$tournamentData = getTournamentData($tournamentId);
?>
    
    <?php 
include "top.php";
?>

    <div class = "container content">
        <div class="titleName">
            <?php 
echo $tournamentData["name"];
?>
        </div>
        
        <div class="tournamentMenu">
            <div class="btn-group">
                <button type="button" id="gameButton" class="btn btn-default" onclick="$('#dataContainer').load('game.php?id=<?php 
echo $tournamentData['game'];
?>
&tournament=<?php 
echo $tournamentId;
?>
');">Описание</button>
                <button type="button" id="roundButton" class="btn btn-default" onclick="$('#dataContainer').load('round.php?id=<?php 
echo $tournamentData['game'];
?>
&tournament=<?php 
Example #5
0
$page_title = "Tabeli leht";
$file_name = "table.php";
?>


<?php 
require_once "menu.php";
require_once "functions.php";
require_once "edit_functions.php";
if (isset($_POST["update"])) {
    updateTournament($_POST["id"], $_POST["tournament"], $_POST["team_one"], $_POST["team_two"], $_POST["time"]);
}
if (isset($_GET["delete"])) {
    deleteTournament($_GET["delete"]);
}
$tournament_list = getTournamentData();
?>

<table border=1 >
	<tr>
		<th>id</th>
		<th>Kasutaja id</th>
		<th>Turniiri nimi</th>
		<th>Esimene tiim</th>
		<th>Teine tiim</th>
		<th>Toimumise aeg</th>
		<th>X</th>
		<th>edit</th>
	</tr>
	
	<?php 
Example #6
0
    $array = array();
    while ($stmt->fetch()) {
        $tourney = new StdClass();
        $tourney->id = $id;
        $tourney->tournament = $tournament;
        $tourney->user_id = $user_id;
        $tourney->team_one = $team_one;
        $tourney->team_two = $team_two;
        $tourney->time = $time;
        array_push($array, $tourney);
        //echo "<pre>";
        //var_dump($array);
        //echo "</pre>";
    }
    $stmt->close();
    $mysqli->close();
    return $array;
}
function deleteTournament($id_to_be_deleted)
{
    $mysqli = new mysqli($GLOBALS["servername"], $GLOBALS["server_username"], $GLOBALS["server_password"], $GLOBALS["database"]);
    $stmt = $mysqli->prepare("UPDATE tournaments SET deleted=NOW() WHERE id=?");
    $stmt->bind_param("i", $id_to_be_deleted);
    if ($stmt->execute()) {
        header("Location: table.php");
    }
    $stmt->close();
    $mysqli->close();
}
getTournamentData();
Example #7
0
                    <span class="icon-bar"></span>
                </button>
                <a href="index.php" class="navbar-brand">AIBattle</a>
            </div>
            <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
            <li class="dropdown <?php 
    echo getActiveNavbarElement("tournament", $_SERVER['PHP_SELF']);
    ?>
">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Турниры <b class="caret"></b></a>
            <ul class = "dropdown-menu">
                <?php 
    $tournaments = getRunningAndClosedTournaments();
    foreach ($tournaments as $id => $name) {
        $data = getTournamentData($id);
        ?>
                    <li>
                        <a href="tournament.php?id=<?php 
        echo $id;
        ?>
" onclick = "$.post('jqueryResetTournamentState.php', function(txt) { return txt;});">
                            <?php 
        if ($data['state'] == 'closed') {
            echo '<i>' . $name . '</i>';
        } else {
            echo $name;
        }
        ?>
                        </a>
                    </li>