コード例 #1
0
ファイル: tree_frame.php プロジェクト: eistr2n/lansuite
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$tournamentid = $_GET["tournamentid"];
$fullscreen = $_SESSION['lansuite']['fullscreen'];
if ($_GET['group'] == '') {
    $_GET['group'] = 1;
}
$t = $db->qry_first('SELECT tournamentid, name, mode, UNIX_TIMESTAMP(starttime) AS starttime, break_duration, game_duration, max_games, status, mapcycle
  FROM %prefix%tournament_tournaments WHERE tournamentid = %int%', $tournamentid);
$team_anz = $tfunc->GetTeamAnz($tournamentid, $t["mode"], $_GET["group"]);
/*
// Calculate TeamCount
if (($t['mode'] == "groups") && ($_GET['group'] > 0)) {
	$games = $db->qry_first("SELECT COUNT(*) AS anz
  FROM %prefix%t2_games
  WHERE (tournamentid = %int%) AND (round = 0) AND (group_nr = %string%) AND (leaderid != 0)
  GROUP BY round
  ", $tournamentid, $_GET['group']);
	$team_anz = $games['anz'];
} elseif (($t['mode'] == "groups") && ($_GET['group'] == 0)) {
	$game = $db->qry("SELECT gameid
  FROM %prefix%t2_games
  WHERE (tournamentid = %int%) AND (group_nr > 0) AND (round = 0)
  GROUP BY group_nr
  ", $tournamentid);
	$team_anz = 2 * $db->num_rows($game);
	$db->free_result($game);
} elseif ($t["mode"] == "liga"){
	$games = $db->qry_first("SELECT COUNT(*) AS anz
コード例 #2
0
ファイル: submit_result.php プロジェクト: eistr2n/lansuite
<?php

include_once "inc/classes/class_gd.php";
$gd = new gd();
include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$qacc = $_GET["qacc"];
$tournamentid = $_GET["tournamentid"];
$gameid1 = $_GET["gameid1"];
$gameid2 = $_GET["gameid2"];
$score_team1 = $_POST["score_team1"];
$score_team2 = $_POST["score_team2"];
$score_comment = $_POST["score_comment"];
## Ueberschreibungsabfrage
if ($_GET["qacc"] == 1) {
    $score_team1 = $_GET["score_team1"];
    $score_team2 = $_GET["score_team2"];
    $score_comment = $_GET["score_comment"];
}
########## Infos holen
$tournament = $db->qry_first("SELECT name, teamplayer, over18, status, mode, mapcycle, UNIX_TIMESTAMP(starttime) AS starttime, max_games, game_duration, break_duration, tournamentid FROM %prefix%tournament_tournaments WHERE tournamentid = %int%", $tournamentid);
$map = explode("\n", $tournament["mapcycle"]);
if ($map[0] == "") {
    $map[0] = t('unbekannt');
}
$games = $db->qry_first("SELECT COUNT(*) AS anz FROM %prefix%t2_games WHERE (tournamentid = %int%) AND (round=0) GROUP BY round", $tournamentid);
$team_anz = $games["anz"];
$team1 = $db->qry_first("SELECT games.group_nr, games.round, games.position, games.score, games.comment, games.server_id, teams.name, teams.teamid, teams.disqualified, user.userid, user.username\n  FROM %prefix%t2_games AS games\n  LEFT JOIN %prefix%t2_teams AS teams ON games.leaderid = teams.leaderid\n  LEFT JOIN %prefix%user AS user ON user.userid = teams.leaderid\n  WHERE (teams.tournamentid = %int%) AND (games.gameid = %int%)\n  ", $tournamentid, $gameid1);
$team2 = $db->qry_first("SELECT games.round, games.position, games.score, games.comment, games.server_id, teams.name, teams.teamid, teams.disqualified, user.userid, user.username\n  FROM %prefix%t2_games AS games\n  LEFT JOIN %prefix%t2_teams AS teams ON games.leaderid = teams.leaderid\n  LEFT JOIN %prefix%user AS user ON user.userid = teams.leaderid\n  WHERE (teams.tournamentid = %int%) AND (games.gameid = %int%)\n  ", $tournamentid, $gameid2);
########## Einschränkungen prüfen
if ($tournament["name"] == "") {
コード例 #3
0
ファイル: team_details.php プロジェクト: eistr2n/lansuite
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
if (!$_GET["teamid"]) {
    $func->error(t('Es wurde kein Team ausgewählt! Die Anzeige der Team-Details ist daher nicht möglich'));
} else {
    $dsp->NewContent(t('Turnier Verwaltung'), t('Mit Hilfe des folgenden Formulars kannst du ein Turnier erstellen / ändern'));
    // Get Data
    $team = $db->qry_first("SELECT teams.name, teams.comment, teams.disqualified, teams.banner, users.username, users.userid\n   FROM %prefix%t2_teams AS teams\n   LEFT JOIN %prefix%user AS users ON (teams.leaderid = users.userid)\n   WHERE (teams.teamid = %int%)\n   ", $_GET["teamid"]);
    // Teamname
    $dsp->AddDoubleRow(t('Teamame'), $team['name']);
    // Disqualified
    if ($team['disqualified']) {
        $dsp->AddDoubleRow("", "<font color=\"#ff0000\">" . t('Disqualifiziert') . "</font>");
    }
    // Banner
    if ($team['banner']) {
        $dsp->AddSingleRow("<img src=\"ext_inc/team_banners/{$team['banner']}\" alt=\"{$team['banner']}\">");
    }
    // Leader
    include_once "modules/seating/class_seat.php";
    $seat2 = new seat2();
    $dsp->AddDoubleRow(t('Teamleiter'), $dsp->FetchUserIcon($team['userid'], $team['username']) . " (Platz: " . $seat2->SeatNameLink($team['userid'], '', '') . ")");
    // Members
    $dsp->AddDoubleRow(t('Mitglieder'), $tfunc->GetMemberList($_GET["teamid"]));
    // Stats
    $game_anz = 0;
    $won = 0;
    $lost = 0;
    $games = $db->qry("SELECT g1.score AS s1, g2.score AS s2, g1.leaderid\n   FROM %prefix%t2_games AS g1\n   LEFT JOIN %prefix%t2_games AS g2 ON (g1.tournamentid = g2.tournamentid) AND (g1.round = g2.round) AND ((g1.position + 1) = g2.position)\n   WHERE ((g1.score != 0) OR (g2.score != 0))\n   AND ((g1.position / 2) = FLOOR(g1.position / 2))\n   AND ((g1.leaderid = %int%) OR (g2.leaderid = %int%))\n   ", $team['userid'], $team['userid']);
コード例 #4
0
ファイル: tree.php プロジェクト: eistr2n/lansuite
     $modus = t('Double-Elimination');
 }
 if ($tournament['mode'] == "liga") {
     $modus = t('Liga');
 }
 if ($tournament['mode'] == "groups") {
     $modus = t('Gruppenspiele + KO');
 }
 if ($tournament['mode'] == "all") {
     $modus = t('Alle in einem');
 }
 /*	$games = $db->qry("SELECT gameid FROM %prefix%t2_games WHERE (tournamentid = %int%) AND (round=0)", $_GET['tournamentid']);
   	$team_anz = $db->num_rows($games);
   	$db->free_result($games);*/
 include_once "modules/tournament2/class_tournament.php";
 $tfunc = new tfunc();
 $team_anz = $tfunc->GetTeamAnz($_GET['tournamentid'], $tournament['mode'], $_POST['group']);
 $dsp->NewContent(t('Turnierbaum zum Turnier %1 (%2)', $tournament['name'], $modus), t('Hier siehst du grafisch dargestellt, wer gegen wen spielt und kannst Ergebnisse melden'));
 if ($team_anz == 0) {
     $func->information(t('Dieses Turnier wurde noch nicht generiert. Die Paarungen sind noch nicht bekannt.'), "index.php?mod=tournament2&action=tree&step=1");
     break;
 } elseif ($tournament['mode'] == "all") {
     $func->information(t('Ein Turnierbaum ist für diesen Spiel-Modus nicht vorgesehen. Schaue bitte unter Paarungen nach'), "index.php?mod=tournament2&action=games&step=2&tournamentid=" . $_GET['tournamentid']);
     break;
 } else {
     if ($tournament['mode'] == "liga") {
         $height = $team_anz * 20 + 30;
     } else {
         $height = $team_anz / 2 * 50 + 60;
     }
     if ($tournament["mode"] == "groups" && $_POST['group'] == '') {
コード例 #5
0
}
if ($user_data['nglclanid']) {
    $ngl .= '(' . $user_data['nglclanid'] . ')';
}
$dsp->AddDoubleRow(t('NGL-ID') . ' (Clan-ID)', $ngl);
$lgz = '';
if ($user_data['lgzid']) {
    $lgz .= $user_data['lgzid'] . ' ';
}
if ($user_data['lgzclanid']) {
    $lgz .= '(' . $user_data['lgzclanid'] . ')';
}
$dsp->AddDoubleRow(t('LGZ-ID') . ' (Clan-ID)', $lgz);
$dsp->AddFieldsetEnd();
include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
// Own Teams
$dsp->AddFieldsetStart(t('Benutzer hat folgende Teams er&ouml;ffnet'));
$leader_teams = $db->qry("SELECT t.name, t.tournamentid AS tid, team.name AS teamname, team.teamid \n                              FROM %prefix%t2_teams AS team\n                              LEFT JOIN %prefix%tournament_tournaments AS t ON t.tournamentid = team.tournamentid\n                              WHERE team.leaderid = %int% AND t.party_id = %int%", $_GET['userid'], $cfg['signon_partyid']);
if ($db->num_rows($leader_teams) == 0) {
    $dsp->AddSingleRow('<i>-' . t('Keine') . '-</i>');
} else {
    while ($leader_team = $db->fetch_array($leader_teams)) {
        $dsp->AddDoubleRow('<a href="index.php?mod=tournament2&action=details&tournamentid=' . $leader_team['tid'] . '">' . $leader_team['name'] . '</a>', $leader_team['teamname'] . ' ' . $tfunc->button_team_details($leader_team['teamid'], $leader_team['tid']));
    }
}
$dsp->AddFieldsetEnd();
// Teammember
$dsp->AddFieldsetStart(t('Benutzer ist in folgenden Teams Mitglied'));
$member_teams = $db->qry("SELECT t.name, t.tournamentid AS tid, team.name AS teamname, team.teamid \n                              FROM %prefix%t2_teams AS team\n                              LEFT JOIN %prefix%tournament_tournaments AS t ON t.tournamentid = team.tournamentid\n                              LEFT JOIN %prefix%t2_teammembers AS m ON team.teamid = m.teamid\n                              WHERE m.userid = %int% AND t.party_id = %int%", $_GET['userid'], $cfg['signon_partyid']);
if ($db->num_rows($member_teams) == 0) {
コード例 #6
0
ファイル: details.php プロジェクト: eistr2n/lansuite
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$headermenuitem = $_GET['headermenuitem'];
if ($headermenuitem == "") {
    $headermenuitem = 1;
}
$tournament = $db->qry_first("SELECT t.*, a.username AS techadmin_name, r.username AS tournamentadmin_name, UNIX_TIMESTAMP(starttime) AS starttime FROM %prefix%tournament_tournaments AS t    \n    LEFT JOIN %prefix%user AS r ON t.tournamentadmin = r.userid\n    LEFT JOIN %prefix%user AS a ON t.techadmin = a.userid\n    WHERE tournamentid = %int%", $_GET['tournamentid']);
if (!$tournament["tournamentid"]) {
    $func->error(t('Das ausgewählte Turnier existiert nicht'), "index.php?mod=tournament2");
} else {
    switch ($_GET['step']) {
        // Shuffle maps
        case 20:
            if ($auth['type'] <= 1) {
                $func->information('ACCESS_DENIED');
            } else {
                $maps = explode("\n", $tournament["mapcycle"]);
                shuffle($maps);
                $tournament["mapcycle"] = implode("\n", $maps);
                $db->qry("UPDATE %prefix%tournament_tournaments SET mapcycle = %string% WHERE tournamentid = %int%", $tournament['mapcycle'], $_GET['tournamentid']);
            }
            break;
    }
    switch ($_GET['step']) {
        case 10:
            // Activate Seeding
            $seeded = $db->qry_first("SELECT COUNT(*) AS anz FROM %prefix%t2_teams WHERE (tournamentid = %int%) AND (seeding_mark = '1') GROUP BY tournamentid", $_GET['tournamentid']);
            $team = $db->qry_first("SELECT COUNT(*) AS anz FROM %prefix%t2_teams WHERE (tournamentid = %int%) GROUP BY tournamentid", $_GET['tournamentid']);
            if ($seeded['anz'] + 1 > $team['anz'] / 2) {
コード例 #7
0
ファイル: timetable.php プロジェクト: eistr2n/lansuite
<?php

include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
$dsp->NewContent(t('Turnier-Zeitplan'), t('Hier siehst du, welches Turnier zu welcher Zeit stattfindet.'));
// Generate Table-head
$mintime = 9999999999;
$maxtime = 0;
$tournaments = $db->qry("SELECT *, UNIX_TIMESTAMP(starttime) AS starttime\n  FROM %prefix%tournament_tournaments\n  WHERE party_id = %int% AND (%int% > 1 OR status != 'invisible')", $party->party_id, $auth['type']);
while ($tournament = $db->fetch_array($tournaments)) {
    // Calc Min-Time
    if ($tournament["starttime"] < $mintime) {
        $mintime = $tournament["starttime"];
    }
    // Calc Max-Time
    $team_anz = $tfunc->GetTeamAnz($tournament["tournamentid"], $tournament["mode"]);
    $max_round = 1;
    for ($z = $team_anz / 2; $z >= 2; $z /= 2) {
        $max_round++;
    }
    $endtime = $tfunc->GetGameEnd($tournament, $max_round);
    if ($endtime > $maxtime) {
        $maxtime = $endtime;
    }
}
$db->free_result($tournaments);
if ($maxtime > $mintime + 60 * 60 * 24 * 4) {
    $maxtime = $mintime + 60 * 60 * 24 * 4;
}
$head .= "<td><b>" . t('Turnier') . "</b></td>";
for ($z = $mintime; $z <= $maxtime; $z += 60 * 60 * 2) {
コード例 #8
0
ファイル: games.php プロジェクト: eistr2n/lansuite
<?php

$tournamentid = (int) $_GET["tournamentid"];
include_once "modules/tournament2/class_tournament.php";
$tfunc = new tfunc();
function WriteGame()
{
    global $spieler1, $gameid1, $score1, $spieler1_id, $i, $tournamentid, $game, $dsp, $auth, $lang;
    if ($spieler1 == "") {
        $spieler1 = $game['name'];
        $gameid1 = $game['gameid'];
        $score1 = $game['score'];
        $spieler1_id = $game['leaderid'];
    } else {
        $i++;
        $spieler2 = $game['name'];
        $gameid2 = $game['gameid'];
        $score2 = $game['score'];
        $spieler2_id = $game['leaderid'];
        // Set Colour
        if ($spieler1_id == 0 && $spieler2_id != 0) {
            $spieler2 = "<font color=\"#006600\">{$spieler2}</font>";
        } elseif ($spieler2_id == 0 && $spieler1_id != 0) {
            $spieler1 = "<font color=\"#006600\">{$spieler1}</font>";
        } elseif ($score1 > 0 || $score2 > 0) {
            if ($score1 > $score2) {
                $spieler1 = "<font color=\"#006600\">{$spieler1}</font>";
                $spieler2 = "<font color=\"#660000\">{$spieler2}</font>";
            } elseif ($score1 < $score2) {
                $spieler1 = "<font color=\"#660000\">{$spieler1}</font>";
                $spieler2 = "<font color=\"#006600\">{$spieler2}</font>";
コード例 #9
0
ファイル: rangliste.php プロジェクト: eistr2n/lansuite
 }
 if ($tournament['mode'] == "liga") {
     $modus = t('Liga');
 }
 if ($tournament['mode'] == "groups") {
     $modus = t('Gruppenspiele + KO');
 }
 if ($tournament['mode'] == "all") {
     $modus = t('Alle in einem');
 }
 if ($tournament['status'] != "closed" && $tournament['mode'] != "liga") {
     $func->information(t('Dieses Turnier wurde noch nicht beendet. Die Rangliste ist daher noch nicht bekannt.'), "index.php?mod=tournament2&action=rangliste&step=1");
     break;
 }
 include_once "modules/tournament2/class_tournament.php";
 $tfunc = new tfunc();
 $ranking_data = $tfunc->get_ranking($_GET['tournamentid']);
 $dsp->NewContent(t('Turnier %1 (%2) - Rangliste', $tournament['name'], $modus), t('Hier siehst du das Ergebnis dieses Turniers'));
 $rows = '';
 $anz_elements = count($ranking_data->tid);
 for ($i = 0; $i < $anz_elements; $i++) {
     $akt_pos = $ranking_data->tid[$i];
     $ranking_data->disqualified[$i] ? $mark = "<font color=\"#ff0000\">" : ($mark = "");
     $ranking_data->disqualified[$i] ? $mark2 = "</font>" : ($mark2 = "");
     if ($tournament['mode'] == "liga") {
         $score_out = $ranking_data->score[$i] . " : " . $ranking_data->score_en[$i];
         $smarty->assign('cell1', t('Platz') . " " . $ranking_data->pos[$i]);
         $smarty->assign('cell2', $mark . $ranking_data->name[$i] . $mark2 . $tfunc->button_team_details($akt_pos, $_GET['tournamentid']));
         $smarty->assign('cell3', $ranking_data->win[$i]);
         $smarty->assign('cell4', $ranking_data->score_dif[$i] . " ({$score_out})");
         $smarty->assign('cell5', $ranking_data->games[$i]);