<?php

session_start();
date_default_timezone_set('America/Chicago');
include './lib/class-db.php';
include './lib/objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
if (isset($_POST['form']) && isset($_POST['tournament_id'])) {
    $form = trim($_POST['form']);
    $tournament_id = trim($_POST['tournament_id']);
    if ($form == 'generate-matches') {
        $teams = $ez_tournament->get_round_winners($tournament_id, 1);
        $total_teams = count($teams);
        ?>

        <li class="spacer">&nbsp;</li>
        <!-- wrap score inside span element -->
        <li class="game game-top"><?php 
        echo $teams[0]['guild'];
        ?>
</li>
        <li class="game game-spacer">&nbsp;</li>
        <li class="game game-bottom "><?php 
        echo $teams[1]['guild'];
        ?>
</li>
<?php

session_start();
date_default_timezone_set('America/Chicago');
include './lib/class-db.php';
include './lib/objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
if (isset($_POST['form']) && isset($_POST['tournament_id'])) {
    $form = trim($_POST['form']);
    $tournament_id = trim($_POST['tournament_id']);
    if ($form == 'generate-matches') {
        $teams = $ez_tournament->get_round_winners($tournament_id, 2);
        $total_teams = count($teams);
        ?>

        <li class="spacer">&nbsp;</li>
        <!-- wrap score inside span element -->
        <li class="game game-top"><?php 
        echo $teams[0]['guild'];
        ?>
</li>
        <li class="game game-spacer">&nbsp;</li>
        <li class="game game-bottom "><?php 
        echo $teams[1]['guild'];
        ?>
</li>
<?php

session_start();
date_default_timezone_set('America/Chicago');
include './lib/class-db.php';
include './lib/objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
if (isset($_POST['form']) && isset($_POST['tournament_id'])) {
    $form = trim($_POST['form']);
    $tournament_id = trim($_POST['tournament_id']);
    if ($form == 'generate-matches') {
        $teams = $ez_tournament->get_round_winners($tournament_id, 3);
        $total_teams = count($teams);
        ?>

        <li class="spacer">&nbsp;</li>
        <!-- wrap score inside span element -->
        <li class="game game-top"><?php 
        echo $teams[0]['guild'];
        ?>
</li>
        <li class="game game-spacer">&nbsp;</li>
        <li class="game game-bottom "><?php 
        echo $teams[1]['guild'];
        ?>
</li>
<?php

session_start();
date_default_timezone_set('America/Chicago');
include '../class-db.php';
include '../objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
if (isset($_POST['form']) && isset($_POST['tournament_id']) && isset($_POST['team_id'])) {
    $form = trim($_POST['form']);
    $tournament_id = trim($_POST['tournament_id']);
    $team_id = trim($_POST['team_id']);
    if ($form == 'add-tournament-team') {
        $max_teams = trim($_POST['max_teams']);
        $tournament_teams = $ez_tournament->get_tournament_teams($tournament_id);
        $current_team_amount = count($tournament_teams);
        if ($max_teams != $current_team_amount) {
            $ez_tournament->register_tournament_team($team_id, $tournament_id);
        }
        $tournament_teams = $ez_tournament->get_tournament_teams($tournament_id);
        ?>

                <table class="table table-hover tournament-teams">
                    <thead>
                        <tr>
                            <th>Team</th>
                            <th></th>
<?php

session_start();
date_default_timezone_set('America/Chicago');
include 'lib/class-db.php';
include 'lib/objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
//get an individual user
if (isset($_POST['id'])) {
    $tournament_id = $_POST['id'];
    $available_teams = $ez_tournament->get_available_teams($tournament_id);
    $current_teams = $ez_tournament->get_tournament_teams($tournament_id);
    $current_teams_count = count($current_teams);
    ?>

<div class="modal-dialog">
	<div class="modal-team">
		<div class="modal-header">
			<button type="button" onclick="javascript:location.reload();" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h4 class="modal-title" id="myModalLabel">Add Tournament Teams</h4>
		</div>
		<div class="modal-body">
		 <div class="row">
           
           <div class="col-lg-6"> 
            <div class="panel panel-default">
Beispiel #6
0
<?php

session_start();
include '../class-db.php';
include '../class-ezadmin.php';
include '../objects/class-tournament.php';
$ez = new ezAdmin();
$ez_tournament = new ezAdmin_Tournament();
if (isset($_POST['form'])) {
    $form = strip_tags($_POST['form']);
    switch ($form) {
        case 'add-map':
            $map = $_POST['map'];
            $tournament_id = $_POST['tournament_id'];
            $ez_tournament->add_map($map, $tournament_id);
            break;
        case 'set-map':
            $map = $_POST['map'];
            $week = $_POST['week'];
            $tournament_id = $_POST['league'];
            $ez_tournament->set_map($tournament_id, $week, $map);
            break;
        case 'edit-rules':
            $tournament_id = $_POST['tournament_id'];
            $rules = $_POST['body'];
            $ez_tournament->edit_rules($tournament_id, $rules);
            break;
        case 'edit-tournament':
            $tournament_id = $_POST['tournament_id'];
            $tournament = $_POST['tournament'];
            $max_teams = $_POST['max_teams'];
<?php

session_start();
date_default_timezone_set('America/Chicago');
include './lib/class-db.php';
include './lib/objects/class-tournament.php';
$ez_tournament = new ezAdmin_Tournament();
if (!isset($_SESSION['ez_admin'])) {
    header("Location: login.php");
} else {
    $username = $_SESSION['ez_admin'];
}
if (isset($_POST['form']) && isset($_POST['tournament_id'])) {
    $form = trim($_POST['form']);
    $tournament_id = trim($_POST['tournament_id']);
    if ($form == 'generate-matches') {
        // clear any previously generated matchups first
        $ez_tournament->clear_tournament_matchups($tournament_id);
        // randomize tournament matchups and store them
        $tournament_max_teams = trim($_POST['max_teams']);
        $teams = $ez_tournament->get_tournament_teams($tournament_id);
        shuffle($teams);
        ?>

        <li class="spacer">&nbsp;</li>
        <!-- wrap score inside span element -->
        <li class="game game-top"><?php 
        echo $teams[0]['guild'];
        ?>
</li>
        <li class="game game-spacer">&nbsp;</li>