Exemplo n.º 1
0
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Tournaments");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$countErrors = 0;
$dispError = "";
$tournamentObj = new Tournament($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $tournamentObj->objTeam->select($_POST['teamID']) && $tournamentObj->objTournamentPool->select($_POST['poolID']) && $tournamentObj->objTournamentPool->objTournamentPoolMatch->select($_POST['poolTeamID']) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info();
    $teamInfo = $tournamentObj->objTeam->get_info_filtered();
    $tournamentObj->select($teamInfo['tournament_id']);
    $tournamentInfo = $tournamentObj->get_info_filtered();
    $poolInfo = $tournamentObj->objTournamentPool->get_info();
    $poolTeamInfo = $tournamentObj->objTournamentPool->objTournamentPoolMatch->get_info();
    $dispTeamName = $tournamentObj->getPlayerName();
    $tmemberID = $tournamentInfo['member_id'];
    if (($memberInfo['member_id'] == $tmemberID || $memberInfo['rank_id'] == "1" || $tournamentObj->isManager($memberInfo['member_id'])) && $poolInfo['tournament_id'] == $teamInfo['tournament_id'] && $poolTeamInfo['tournament_id'] == $teamInfo['tournament_id']) {
        // Check Match Score
        if (!is_numeric($_POST['teamScore']) || !is_numeric($_POST['opponentScore'])) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Scores must be a numeric value.";
        }
        // Check Winner
        $arrMatchWinners = array(0, 1, 2);
        if (!in_array($_POST['matchWinner'], $arrMatchWinners)) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid match winner.";
        }
        // Check Match Details
        if ($teamInfo['tournamentteam_id'] != $poolTeamInfo['team1_id'] && $teamInfo['tournamentteam_id'] != $poolTeamInfo['team2_id']) {
Exemplo n.º 2
0
</b>
			</p>
		
			<div style='float: left; width: 600px; padding-bottom: 25px'>
		
		<?php 
$arrPools = $tournamentObj->getPoolList();
$dispPoolLetter = "A";
foreach ($arrPools as $poolID) {
    $tournamentObj->objTournamentPool->select($poolID);
    $arrTeamsInPool = $tournamentObj->objTournamentPool->getTeamsInPool();
    echo "<p class='main' align='left'><b><u>Pool " . $dispPoolLetter . ":</u></b></p>";
    $counter = 0;
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "tournamentpools_teams WHERE pool_id = '" . $poolID . "'");
    while ($row = $result->fetch_assoc()) {
        $dispTeamOne = $tournamentObj->getPlayerName($row['team1_id']);
        $dispTeamTwo = $tournamentObj->getPlayerName($row['team2_id']);
        if ($dispTeamOne == "") {
            $dispTeamOne = "<i>Empty Spot</i>";
        }
        if ($dispTeamTwo == "") {
            $dispTeamTwo = "<i>Empty Spot</i>";
        }
        if ($row['winner'] == 1) {
            $dispTeamOne = "<span class='successFont' style='font-weight: bold'>" . $dispTeamOne . "</span>";
        } elseif ($row['winner'] == 2) {
            $dispTeamTwo = "<span class='successFont' style='font-weight: bold'>" . $dispTeamTwo . "</span>";
        }
        echo "\n\t\t\t\t\t\t<div class='dottedBox main' style='width: 280px; float: left'>\n\t\t\t\t\t\t\t<div class='shadedBox main' style='position: relative; border-width: 0px; text-align: left'>\n\t\t\t\t\t\t\t\t" . $dispTeamOne . "\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div style='position: absolute; top: 5px; right: 15px'><span style='cursor: help' onmouseover=\"showToolTip('Score')\" onmouseout='hideToolTip()'>" . $row['team1score'] . "</span></div>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='shadedBox main' style='position: relative; border-width: 0px; margin-top: 3px; text-align: left'>\n\t\t\t\t\t\t\t\t" . $dispTeamTwo . "\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div style='position: absolute; top: 5px; right: 15px'><span style='cursor: help' onmouseover=\"showToolTip('Score')\" onmouseout='hideToolTip()'>" . $row['team2score'] . "</span></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t";
        $counter++;
        if ($counter == 2) {
Exemplo n.º 3
0
    include "include/managepoolmatch.php";
} else {
    echo "\n\t\t<table class='formTable' id='tournamentListTable'>\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' style='width: 45%'>Tournament:</td>\n\t\t\t\t<td class='formTitle' style='width: 40%'>Opponent:</td>\n\t\t\t\t<td class='formTitle' style='width: 15%'>Round:</td>\n\t\t\t</tr>\n\t";
    $counter = 0;
    foreach ($arrTournaments as $tournamentID) {
        $tournamentObj->select($tournamentID);
        $tournamentName = $tournamentObj->get_info_filtered("name");
        $playerID = $tournamentObj->getTournamentPlayerID($memberInfo['member_id']);
        $tournamentObj->objPlayer->select($playerID);
        $teamID = $tournamentObj->objPlayer->get_info("team_id");
        // Get matches
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "tournamentpools_teams WHERE tournament_id='" . $tournamentID . "' AND ((team1_id != '0' AND team2_id = '" . $teamID . "') OR (team2_id != '0' AND team1_id = '" . $teamID . "')) AND (team1approve = '0' OR team2approve = '0')");
        while ($row = $result->fetch_assoc()) {
            $counter++;
            if ($row['team1_id'] != $teamID) {
                $dispOpponent = $tournamentObj->getPlayerName($row['team1_id']);
            } else {
                $dispOpponent = $tournamentObj->getPlayerName($row['team2_id']);
            }
            $tournamentObj->objPlayer->select($playerID);
            if ($tMemberObj->select($dispOpponent)) {
                $dispOpponent = $tMemberObj->getMemberLink();
            }
            $dispPools .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='main' style='height: 20px'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&pID=" . $row['poolteam_id'] . "'>" . $tournamentName . "</a></td>\n\t\t\t\t\t<td class='main' style='height: 20px; padding-left: 10px'>" . $dispOpponent . "</td>\n\t\t\t\t\t<td class='main' style='height: 20px' align='center'>Pool</td>\n\t\t\t\t</tr>\n\t\t\t";
        }
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "tournamentmatch WHERE tournament_id='" . $tournamentID . "' AND ((team1_id != '0' AND team2_id = '" . $teamID . "') OR (team2_id != '0' AND team1_id = '" . $teamID . "')) AND (team1approve = '0' OR team2approve = '0') ORDER BY round");
        while ($row = $result->fetch_assoc()) {
            $counter++;
            if ($row['team1_id'] != $teamID) {
                $dispOpponent = $tournamentObj->getPlayerName($row['team1_id']);
            } else {
Exemplo n.º 4
0
$cID = $consoleObj->findConsoleIDByName("Manage Tournaments");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$tournamentObj = new Tournament($mysqli);
$tID = $_POST['tID'];
$arrMembers = array();
if ($member->authorizeLogin($_SESSION['btPassword']) && $tournamentObj->select($tID) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info();
    $tournamentInfo = $tournamentObj->get_info_filtered();
    if ($tournamentInfo['playersperteam'] == 1) {
        $dispTeamOrPlayer = "Player";
    } else {
        $dispTeamOrPlayer = "Team";
    }
    if (($memberInfo['member_id'] == $tournamentInfo['member_id'] || $memberInfo['rank_id'] == "1" || $tournamentObj->isManager($memberInfo['member_id'])) && $tournamentInfo['seedtype'] == 3) {
        echo "\n\t\t\n\t\t\t\t<table class='formTable' align='center' style='margin-left: auto; margin-right: auto; width: 250px'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formTitle' style='width: 40px'>Seed:</td>\n\t\t\t\t\t\t<td class='formTitle' style='width: 210px'>" . $dispTeamOrPlayer . ":</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t\t";
        $arrTeams = $tournamentObj->getTeams(true, "ORDER BY seed");
        foreach ($arrTeams as $teamID) {
            $dispName = $tournamentObj->getPlayerName($teamID);
            $tournamentObj->objTeam->select($teamID);
            $dispSeed = $tournamentObj->objTeam->get_info("seed");
            $teamPoolID = $tournamentObj->getTeamPoolID($teamID);
            $tournamentObj->objTournamentPool->select($teamPoolID);
            $tournamentObj->objTournamentPool->getTeamRecord($teamID);
            echo "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='main' align='center'>" . $dispSeed . ".</td>\n\t\t\t\t\t\t\t<td class='main' style='padding-left: 5px'><a href='javascript:void(0)' onclick=\"setSeed('" . $teamID . "')\">" . $dispName . "</a> (" . $tournamentObj->objTournamentPool->getTeamRecord($teamID) . ")</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t";
            $seedCount++;
        }
        echo "\n\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\n\t\t\n\t\t\n\t\t";
    }
}
Exemplo n.º 5
0
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/tournament.php";
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Tournaments");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$tournamentObj = new Tournament($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $tournamentObj->objTeam->select($_POST['teamID']) && $tournamentObj->objTournamentPool->select($_POST['poolID']) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info();
    $teamInfo = $tournamentObj->objTeam->get_info_filtered();
    $tournamentObj->select($teamInfo['tournament_id']);
    $tournamentInfo = $tournamentObj->get_info_filtered();
    $poolInfo = $tournamentObj->objTournamentPool->get_info();
    $dispTeamName = $tournamentObj->getPlayerName();
    $tmemberID = $tournamentInfo['member_id'];
    if (($memberInfo['member_id'] == $tmemberID || $memberInfo['rank_id'] == "1" || $tournamentObj->isManager($memberInfo['member_id'])) && $poolInfo['tournament_id'] == $teamInfo['tournament_id']) {
        $selectedTeam = "";
        $dispNoWinnerSelected = "";
        $dispPlayerOneWinnerSelected = "";
        $dispPlayerTwoWinnerSelected = "";
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "tournamentpools_teams WHERE pool_id = '" . $_POST['poolID'] . "' AND (team1_id = '" . $_POST['teamID'] . "' OR team2_id = '" . $_POST['teamID'] . "') ORDER BY poolteam_id");
        while ($row = $result->fetch_assoc()) {
            if ($_POST['poolTeamID'] == "") {
                $_POST['poolTeamID'] = $row['poolteam_id'];
            }
            if ($row['team1_id'] != $_POST['teamID']) {
                $selectedTeam = $row['team1_id'];
            } elseif ($row['team2_id'] != $_POST['teamID']) {
                $selectedTeam = $row['team2_id'];