AnonSec Shell
Server IP : 149.202.105.228  /  Your IP : 216.73.216.123
Web Server : Apache
System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : atfycaf ( 116275)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/atfycaf/www/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/atfycaf/www/knockoutGroup-old.php
<?php
include "globalVars.php";

$tournamentGroupURL	= cleanPost($_GET["group"], $conn);
$pageURL			= $tournamentGroupURL;
$tournamentType		= $tournamentGroupURL;

$thisParentID		= 3;
$thisPageID			= 4;

$tournamentIDQuery = mysqli_query($conn, "SELECT id, groupTitle FROM knockoutGroups WHERE pageURL = '$tournamentType'");
while ($tIQ = mysqli_fetch_array($tournamentIDQuery)) {
	$groupType		= $tIQ["id"];
	$groupTitle		= $tIQ["groupTitle"];
}
$headerTitle	= $groupTitle;
$pageTitle		= $groupTitle;

$metaKey		= "";
$metaDesc		= "";

$showTournament	= true;
$tournamentQuery = mysqli_query($conn, "SELECT * FROM knockoutConfig WHERE tournType = '$groupType' ORDER BY tournStartDate DESC LIMIT 0,1");
if (mysqli_num_rows($tournamentQuery) == 0) {
	$showTournament	= false;
} else {
	$todaysDate	= date("Y-m-d");
	while ($tQ = mysqli_fetch_array($tournamentQuery)) {
		$tournamentID	= $tQ["id"];
		$tournLink		= $tQ["pageURL"];
		$tournTitle		= $tQ["tournTitle"];
		$tFullSDate		= $tQ["tournStartDate"];
		$tFullEDate		= $tQ["tournEndDate"];
		$tStartDate		=  date("jS", strtotime($tFullSDate));
		$tStartMonth	=  date("F", strtotime($tFullSDate));
		$tStartYear		=  date("Y", strtotime($tFullSDate));
		$tEndDate		=  date("jS", strtotime($tFullEDate));
		$tEndMonth		=  date("F", strtotime($tFullEDate));
		$tEndYear		=  date("Y", strtotime($tFullEDate));

		$tournStartDate	= $tStartDate;
		if ($tStartMonth != $tEndMonth) {
			$tournStartDate	.= " $tStartMonth";
		}
		if ($tStartYear != $tEndYear) {
			$tournStartDate	.= " $tStartYear";
		}
		$tournLocation	= $tQ["tournLocation"];
		if (trim($tournTitle) == "") {
			$tournTitle	= "$tournLocation $tStartMonth $tStartYear";
		}
		$tournEndDate	= date("jS F, Y", strtotime($tQ["tournEndDate"]));

		$noCompetitors	= $tQ["noCompetitors"];
		$hasPrelims		= $tQ["hasPrelims"];
		$showScores		= $tQ["showScores"];
	}
	$compLeft		= $noCompetitors;
	$noRounds		= 1;
	do {
		$compLeft	= $compLeft / 2;
		$noRounds++;
	} while ($compLeft > 2);

	if ($hasPrelims == 1) {
		$rCount		= 0;
	} else {
		$rCount		= 1;
	}

	$noMatches		= 1;
	$roundMatches	= array();
	$roundMatches[$noRounds]	= $noMatches;
	for ($r = $noRounds; $r >= $rCount; $r--) {
		if ($r == $noRounds) {
			$noMatches		= 1;
		} else {
			$noMatches			= $noMatches * 2;
		}
		$roundMatches[$r]	= $noMatches;
	}
}

include "header.php";
?>
	<div id="pageBreadcrumb">
		<div class="container">
			<ol id="pagesBreadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
				<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url ?>" itemprop="item"><span itemprop="name"><i class="fa fa-home" aria-hidden="true" title="<?php echo $LANG_MENU_HOME_TITLE ?>"></i></span></a><meta itemprop="position" content="1" /></li>
				<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ?>" itemprop="item"><span itemprop="name"><?php echo $LANG_MENU_KNOCKOUT_TITLE ?></span></a><meta itemprop="position" content="2" /></li>
				<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ?>" itemprop="item"><span itemprop="name"><?php echo $groupTitle ?></span></a><meta itemprop="position" content="3" /></li>
			</ol>
		</div>
	</div>

	<div class="mainContent tb40">
		<div class="container">
			<div class="pageLeft">
			<?php
			if ($showTournament == false) {
				?>
				<p><?php echo str_replace("[[TOURN_TYPE]]", $groupTitle, $LANG_NO_RECENT_TEXT) ?></p>
				<?php
			} else {
				?>
				<h2><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ."/". $tournLink ?>.html"><?php echo $tournTitle ?></a></h2>
			<?php
			if ($tFullEDate > $todaysDate) {
				?>
				<p><?php echo str_replace(array("[[TOURN_LOC]]", "[[FROM_DATE]]", "[[TO_DATE]]"), array($tournLocation, $tournStartDate, $tournEndDate), $LANG_KNOCKOUT_DATES_ONGOING) ?></p>
				<?php
			} else {
				?>
				<p><?php echo str_replace(array("[[TOURN_LOC]]", "[[FROM_DATE]]", "[[TO_DATE]]"), array($tournLocation, $tournStartDate, $tournEndDate), $LANG_KNOCKOUT_DATES) ?></p>
				<?php
			}
			?>
				<div class="knockoutContainer">
					<div class="knockoutFixtures">
<?php
for ($thisRound = $rCount; $thisRound <= $noRounds; $thisRound++) {
	$tourneyWinner	= "";
	$final			= $noRounds;
	$semiFinal		= $noRounds - 1;
	$qtrFinal		= $noRounds - 2;
	if ($thisRound == $final) {
		$roundTitle	= $LANG_ROUND_FINAL;
	} elseif ($thisRound == $semiFinal) {
		$roundTitle	= $LANG_ROUND_SEMI_FINAL;
	} elseif ($thisRound == $qtrFinal) {
		$roundTitle	= $LANG_ROUND_QTR_FINAL;
	} elseif ($thisRound == 0) {
		$roundTitle	= $LANG_ROUND_PRELIM_ROUND;
	} else {
		$roundTitle	= "$LANG_ROUND $thisRound";
	}
	$roundDateQuery = mysqli_query($conn, "SELECT roundDate FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$thisRound') LIMIT 0,1");
	if (mysqli_num_rows($roundDateQuery) > 0) {
		while ($rDQ = mysqli_fetch_array($roundDateQuery)) {
			$roundDate	= date("D jS M Y", strtotime($rDQ["roundDate"]));
		}
	} else {
		$roundDate	= "&nbsp;";
	}
	?>
						<div class="knockoutRound knockoutRound<?php echo $noRounds ?>">
							<h3><?php echo $roundTitle ?><br><span><?php echo $roundDate ?></span></h3>
						</div>
	<?php
}
?>
					</div>
				</div>
				<div class="knockoutContainer knockoutContainerD">
					<div class="knockoutFixtures">
<?php
$roundsQuery = mysqli_query($conn, "SELECT DISTINCT roundID FROM knockoutRounds WHERE tournID = '$tournamentID' ORDER BY roundID ASC");
while ($rQ = mysqli_fetch_array($roundsQuery)) {
	$roundID	= $rQ["roundID"];
	?>
						<div class="knockoutRound knockoutRound<?php echo $noRounds ?>" data-nm="<?php echo $roundMatches[$roundID] ?>">
	<?php

	$roundMatch		= 0;
	$matchesAdded	= 0;

	$roundMatchesQuery = mysqli_query($conn, "SELECT DISTINCT matchNo FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') ORDER BY matchNo ASC");
	while ($rMQ = mysqli_fetch_array($roundMatchesQuery)) {
		$matchNo	= $rMQ["matchNo"];

		if ($matchNo != 9999) {
			$nextFixtureQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$matchNo') ORDER BY id ASC LIMIT 0,1");
			while ($nFQ = mysqli_fetch_array($nextFixtureQuery)) {
				$playerID			= $nFQ["id"];
				$roundDate			= $nFQ["roundDate"];
				$participantName	= $nFQ["participantName"];
				$matchScore 		= $nFQ["matchScore"];
			}
			if ($matchScore == -1) {
				$matchScore	= "";
			}
			$opponentsQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$matchNo') AND (id != '$playerID') ORDER BY id ASC LIMIT 0,1");
			if (mysqli_num_rows($opponentsQuery) == 0) {
				$opponentName	= "-";
				$opponentScore	= "";
			} else {
				while ($oQ = mysqli_fetch_array($opponentsQuery)) {
					$opponentName	= $oQ["participantName"];
					$opponentScore 	= $oQ["matchScore"];
				}
			}
			if ($opponentScore == -1) {
				$opponentScore	= "";
			}
			if ($roundID == $final) {
				if (($matchScore > $opponentScore) || ($matchScore == 9999) || ($opponentScore == 99999)) {
					$tourneyWinner	= $participantName;
				} elseif (($opponentScore > $matchScore) || ($matchScore == 99999) || ($opponentScore == 9999)) {
					$tourneyWinner	= $opponentName;
				} else {
					$tourneyWinner	= "";
				}
			}

			if ($matchScore == 9999) {
				$matchScore			= "<strong>BYE</strong>";
				$participantName	= "<strong>$participantName</strong>";
				$opponentScore		= "-";
			} elseif ($matchScore == 99999) {
				$matchScore			= "WD";
				$opponentName		= "<strong>$opponentName</strong>";
				$opponentScore		= "<strong>-</strong>";
			} elseif ($opponentScore == 9999) {
				$opponentScore		= "<strong>BYE</strong>";
				$opponentName		= "<strong>$opponentName</strong>";
				$matchScore			= "-";
			} elseif ($opponentScore == 99999) {
				$opponentScore		= "WD";
				$participantName	= "<strong>$participantName</strong>";
				$matchScore			= "<strong>-</strong>";
			} elseif ($matchScore > $opponentScore) {
				$participantName	= "<strong>$participantName</strong>";
				$matchScore			= "<strong>$matchScore</strong>";
			} elseif ($opponentScore == $matchScore) {
			} else {
				$opponentName		= "<strong>$opponentName</strong>";
				$opponentScore		= "<strong>$opponentScore</strong>";
			}
			?>
							<div class="knockoutTie">
								<div class="knockoutHome"><?php echo $participantName ?> <?php if ($showScores == 1) {?><span class="knockoutScore"><?php echo $matchScore ?></span><?php } ?></div>
								<div class="knockoutAway"><?php echo $opponentName ?> <?php if ($showScores == 1) {?><span class="knockoutScore"><?php echo $opponentScore ?></span><?php } ?></div>
							</div>
			<?php
		}
		$matchesAdded++;
	}
	if ($roundID > 1) {
		if ($matchesAdded < $roundMatches[$roundID]) {
			for ($i = $matchesAdded; $i < $roundMatches[$roundID]; $i++) {
			?>
							<div class="knockoutTie">
								<div class="knockoutHome">TBD</div>
								<div class="knockoutAway">&nbsp;</div>
							</div>
			<?php
			}
		}
	}
	?>
						</div>
	<?php
}
?>
					</div>
					<div id="tournWinner">
						Winner: <?php echo $tourneyWinner ?>
					</div>
				</div>
				<?php
			}
			?>
			</div>
			<div class="pageRight">
			<?php
			if ($showTournament == true) {
				$otherResultsQuery = mysqli_query($conn, "SELECT * FROM knockoutConfig WHERE tournType = '$groupType' ORDER BY tournStartDate DESC LIMIT 1,99999999");
				if (mysqli_num_rows($otherResultsQuery) > 0) {
					?>
				<div class="pageLinks">
					<h3><?php echo str_replace("[[TOURN_TYPE]]", $groupTitle, $LANG_RECENT_KNOCKOUTS) ?></h3>
					<ul>
					<?php
					while ($oRQ = mysqli_fetch_array($otherResultsQuery)) {
						$otherResultURL		= $oRQ["pageURL"];
						$otherResultTitle	= $oRQ["tournTitle"];
						$otherResultStartM	= date("F", strtotime($oRQ["tournStartDate"]));
						$otherResultStartY	= date("Y", strtotime($oRQ["tournStartDate"]));
						$otherResultLoc		= $oRQ["tournLocation"];
						if (trim($otherResultTitle) == "") {
							$otherResultTitle	= "$otherResultLoc $otherResultStartM $otherResultStartY";
						}
						?>
						<li><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ."/". $otherResultURL ?>.html"><?php echo $otherResultTitle ?></a></li>
						<?php
					}
					?>
					</ul>
				</div>
					<?php
				}
				?>
				<a id="rulesLink" data-t="k" data-r="<?php echo $groupType ?>"><?php echo $LANG_KNOCKOUT_RULES ?></a>
				<?php
			}
			?>
				<div class="pageLinks">
					<h3><?php echo $LANG_OTHER_KNOCKOUTS ?></h3>
					<ul>
					<?php
					$tournamentGroupsQuery = mysqli_query($conn, "SELECT * FROM knockoutGroups WHERE id != '$tournamentType' ORDER BY id ASC");
					while ($tGQ = mysqli_fetch_array($tournamentGroupsQuery)) {
						$tournamentGroupID		= $tGQ["id"];
						$tournamentGroupURL		= $tGQ["pageURL"];
						$tournamentGroupTitle	= $tGQ["groupTitle"];
						?>
						<li><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ?>"><?php echo $tournamentGroupTitle ?></a></li>
						<?php
					}
					?>
					</ul>
				</div>
			</div>
		</div>
	</div>
<?php
include "footer.php";
?>

Anon7 - 2022
AnonSec Team