Compare commits

..

No commits in common. "aa0a44116b169a70255cfff824097038a7b04a15" and "0f1013d54e7910308ae4da4967bc1685b2f2e169" have entirely different histories.

25 changed files with 233 additions and 716 deletions

View File

@ -25,7 +25,6 @@
<body id="generalBody">
<div id="informationContentPanel">
<hr class="regularLine">
<h3>USER MANAGEMENT</h3>
<div class="navPanel" id="userManagementPanel">
<a href="user_management/user_form.php" target="dataFrame" class="navLink">CREATE USER</a>
@ -33,27 +32,18 @@
<!-- <a href="user_management/create_safe_admin.php" target="dataFrame" class="navLink">CREATE PERMA-ADMIN</a> -->
</div>
<p>&nbsp;</p>
<hr class="regularLine">
<h3>DATA MANAGEMENT</h3>
<div class="navPanel" id="tourneyManagementPanel">
<h4 class="underlined">GAMES</h4>
<p class="newLineThin"></p>
<a href="data_management/game_form.php" target="dataFrame" class="navLink">ADD GAME</a>
<p class="newLine"></p>
<h4 class="underlined">TOURNAMENTS</h4>
<p class="newLineThin"></p>
<a href="data_management/tourney_form.php" target="dataFrame" class="navLink">ADD TOURNAMENT</a>
<a href="data_management/tourney_display_frame.php" target="dataFrame" class="navLink">VIEW TOURNAMENTS</a>
</div>
<p>&nbsp;</p>
<hr class="regularLine">
<h3>!!!!! DANGER ZONE !!!!!</h3>
<div class="navPanel" id="dbManagementPanel">
<a href="db_management/conn_check.php" target="dataFrame" class="navLink">CHECK DB CONNECTION</a>
<!-- <a href="db_management/reinitialise.php" target="dataFrame" class="navLink">REINITIALISE DB</a> -->
</div>
<p>&nbsp;</p>
<hr class="regularLine">
</div>
</body>
</html>

View File

@ -119,23 +119,6 @@
echo "Successfully uploaded new tournament record";
// Function from StackOverflow used to get the base URL, to which we append
// the redirect (where the user came from)
function url(){
return sprintf(
"%s://%s/tournament",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME']
);
}
$address = url();
echo "<p>Redirecting to <a href=\"$address/$tourneyUID\">$address/$tourneyUID</a>...</p>";
echo "<script>window.top.location.href = \"" . $address . "/" . $tourneyUID . "\";</script>";
} catch (PDOException $e) { // failed connection
echo "Connection failed: " . $e->getMessage();
}

View File

@ -1,132 +0,0 @@
<?php session_start() ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="/styles/db_management.css" />
<script src="/scripts/tools.js"></script>
<script>//verifyPageInFrame()</script>
<title>no title</title>
</head>
<body class="sqlOutput">
<?php
// USER-DEFINED VARIABLES
include("../db_config.php"); // Include database stuff
try { // Try opening the SQL database connection
$conn = new PDO("mysql:host=$servername; dbname=$dbName", $dbUsername, $dbPassword);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Need to check if values were sent over POST, otherwise set to N/A
if (isset($_POST["winningPlayer1"])) {
$winningPlayer1 = $_POST["winningPlayer1"];
} else {
$winningPlayer1 = "N/A";
}
if (isset($_POST["winningPlayer2"])) {
$winningPlayer2 = $_POST["winningPlayer2"];
} else {
$winningPlayer2 = "N/A";
}
if (isset($_POST["winningPlayer3"])) {
$winningPlayer3 = $_POST["winningPlayer3"];
} else {
$winningPlayer3 = "N/A";
}
if (isset($_POST["winningPlayer4"])) {
$winningPlayer4 = $_POST["winningPlayer4"];
} else {
$winningPlayer4 = "N/A";
}
$tourneyID = $_POST["tourneyID"];
$tourneyUID = $_POST["tourneyUID"];
$tourneyName = $_POST["tourneyName"];
$tourneyDate = $_POST["tourneyDate"];
$division = $_POST["division"];
$numPlayers = $_POST["numPlayers"];
$bestOf = $_POST["bestOf"];
$winningTeamName = $_POST["winningTeamName"];
$notes = $_POST["notes"];
echo "<p>$tourneyName</p>";
echo "<p>$tourneyDate</p>";
echo "<p>$tourneyUID</p>";
echo "<p>$division</p>";
echo "<p>$numPlayers</p>";
echo "<p>$bestOf</p>";
echo "<p>$winningTeamName</p>";
echo "<p>$winningPlayer1</p>";
echo "<p>$winningPlayer2</p>";
echo "<p>$winningPlayer3</p>";
echo "<p>$winningPlayer4</p>";
echo "<p>$notes</p>";
$insert = $conn->prepare("UPDATE " . $tournamentDataTableName . " SET
tournamentName = :tournamentName,
tournamentDate = :tournamentDate,
tournamentDivision = :tournamentDivision,
numPlayers = :numPlayers,
bestOf = :bestOf,
winningTeamName = :winningTeamName,
winner1 = :winner1,
winner2 = :winner2,
winner3 = :winner3,
winner4 = :winner4,
notes = :notes
WHERE tournamentID = :tournamentID
");
$insert->bindValue(":tournamentName", $tourneyName);
$insert->bindValue(":tournamentDate", $tourneyDate);
$insert->bindValue(":tournamentDivision", $division);
$insert->bindValue(":numPlayers", $numPlayers);
$insert->bindValue(":bestOf", $bestOf);
$insert->bindValue(":winningTeamName", $winningTeamName);
$insert->bindValue(":winner1", $winningPlayer1);
$insert->bindValue(":winner2", $winningPlayer2);
$insert->bindValue(":winner3", $winningPlayer3);
$insert->bindValue(":winner4", $winningPlayer4);
$insert->bindValue(":notes", $notes);
$insert->bindValue(":tournamentID", $tourneyID);
$insert->execute();
echo "Successfully edited tournament record";
// Function from StackOverflow used to get the base URL, to which we append
// the redirect (where the user came from)
function url(){
return sprintf(
"%s://%s/tournament",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME']
);
}
$address = url();
echo "<p>Redirecting to <a href=\"$address/$tourneyUID\">$address/$tourneyUID</a>...</p>";
echo "<script>window.top.location.href = \"" . $address . "/" . $tourneyUID . "\";</script>";
} catch (PDOException $e) { // failed connection
echo "Connection failed: " . $e->getMessage();
}
$conn = null;
?>
</body>
</html>

View File

@ -1,95 +0,0 @@
<?php
include("../db_config.php"); // Include database
/*
function getIDfromName($name) {
$key = array_search('Test Tourney V6 EDIT', array_column($tourneyIndex, 'name'));
echo ($tourneyIndex[$key]['id']) . " - ";
echo ($tourneyIndex[$key]['name']);
}*/
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="/styles/primary.css" />
<link rel="stylesheet" href="/styles/admin.css" />
<link rel="stylesheet" href="/styles/admin_nav.css" />
<link rel="stylesheet" href="/styles/tourney_management.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.14.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/ui/1.14.1/jquery-ui.js"></script>
<script src="/scripts/tourney_management.js"></script>
<script src="/scripts/tools.js"></script>
<script>verifyPageInFrame()</script>
<title>TOURNEY EDITING FORM</title>
</head>
<body id="generalBody">
<div id="tourneyEditPanel">
<h2>TOURNEY EDITING</h2>
<p>Edit tournaments here</p>
<hr class="regularLine">
<p></p>
<div class="tourneyListPanel">
<p class="tournamentIDCol"><b>ID</b></p>
<p class="tournamentDateCol"><b><span style="font-size: 0.78em;">YYYY-MM-DD</span></b></p>
<p class="tournamentNameCol"><b>Name</b></p>
<p class="editTournamentCol">&nbsp;</p>
<p class="deleteTournamentCol">&nbsp;</p>
<p class="newLineThin"></p>
<?php
try { // Try opening the SQL database connection
$conn = new PDO("mysql:host=$servername; dbname=$dbName", $dbUsername, $dbPassword);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Grab the list of users from the user list
$sqlGetUserData = $conn->prepare("SELECT tournamentID,tournamentUID,tournamentName,tournamentDate FROM " . $tournamentDataTableName . " ORDER BY tournamentID DESC");
// Execute SQL query
$sqlGetUserData->execute();
// Get results from the USERS table
$results = $sqlGetUserData->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) { // failed connection
echo "Connection failed: " . $e->getMessage();
}
foreach ($results as $result) {
$tournamentID = $result["tournamentID"];
$tournamentUID = $result["tournamentUID"];
$tournamentName = $result["tournamentName"];
$tournamentDate = $result["tournamentDate"];
echo "<p class=\"tournamentIDCol\">$tournamentID</p>";
echo "<p class=\"tournamentDateCol\">$tournamentDate</p>";
echo "<p class=\"tournamentNameCol\"><a href=\"/tournament/$tournamentUID\" class=\"plainLinkBlack\" onclick=\"redirect('this', '/tournament/$tournamentUID')\">$tournamentName</a></p>";
echo "<p class=\"editTournamentCol\"><a href=\"/tournament/edit?tournamentID=$tournamentID\" class=\"plainLinkBlack\" onclick=\"redirect('this', '/tournament/edit.php?tournamentID=$tournamentID')\">EDIT</a></p>";
echo "<p class=\"deleteTournamentCol\">DELETE</p>";
echo "<p class=\"newLineThin\"></p>";
}
?>
</div>
<div id="tourneyEditFrameDiv">
</div>
<p>&nbsp;</p>
</div>
</body>
</html>

View File

@ -127,7 +127,7 @@ try { // Try opening the SQL database connection
<p class="newLine"></p>
<div id="playerDataInputArea">
<p id="teamNameHeader">WINNING TEAM NAME:</p>
<input type="text" name="winningTeamName" class="teamInput" maxlength="30" tabindex="1">
<input type="text" name="winningTeamName" class="teamInput" maxlength="35" tabindex="1">
<h4>Roster</h4>
<table id="playerData">
</table>

View File

@ -24,7 +24,21 @@ session_start();
<script>getURL();</script>
<div id="contentFrame">
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
<?php include_once('../display/header.html'); ?>
<div class="header">
<div id="headerLeft">
<img src="/assets/trojan_image_1.png" alt="Trojan Destiny logo" id="headerImage">
</div>
<div id="headerCentre">
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
<div id="youtubeImage" onclick="redirect('mainpage', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
<div id="twitchImage" onclick="redirect('mainpage', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
<div id="discordImage" onclick="redirect('mainpage', 'https://discord.gg/bzU5fVxCZJ')"><img src="/assets/discord.svg" alt="discord logo"></div>
</div>
<div id="headerRight">
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
</div>
</div>
<p></p>
<h2 id="adminHeader">ADMIN PANEL</h2>
<?php
@ -75,15 +89,29 @@ session_start();
if (!isset($_SESSION["userID"])){
echo "<iframe src=\"../user/login_page.php?redirect=admin\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
} else if (isset($_SESSION["userID"]) && $_SESSION["privileges"] == 1) {
echo "<iframe src=\"admin_nav.html\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
echo "<iframe src=\"admin_nav.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
} else {
echo "<iframe src=\"not_admin.html\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
echo "<iframe src=\"not_admin.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
}
}
?>
<?php include_once('../display/subnav.php'); ?>
<div class="subNav">
<?php
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1) {
echo "<a href=\"./\" class=\"subNavLink\" id=\"adminHomeButton\">ADMIN PANEL</a>";
}
?>
<a href="../" class="subNavLink" id="mainHomeButton">HOME</a>
<p class="newLine"></p>
<?php
if (isset($_SESSION["userID"])){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>";
echo "<a href=\"../user/logout.php?redirect=admin\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
}
?>
</div>
</div>
</body>
</html>

View File

@ -38,7 +38,7 @@ try { // Try opening the SQL database connection
foreach ($sqlWinnersList as $winner) {
for ($i = 1; $i < 4; $i++) {
if ($winner["winner" . $i] != "N/A" && $winner["winner" . $i] != "-nobody-" && $winner["winner" . $i] != "") {
if ($winner["winner" . $i] != "N/A") {
$winnersList[] = $winner["winner" . $i];
}
}

View File

@ -11,7 +11,6 @@ session_start();
<link rel="stylesheet" href="/styles/primary.css" />
<link rel="stylesheet" href="/styles/data_display.css" />
<link rel="stylesheet" href="/styles/tourney_results.css" />
<link rel="stylesheet" href="/styles/tourney_cards.css" />
<script src="/scripts/tools.js"></script>
<script src="/scripts/results.js"></script>
<script>verifyPageInFrame()</script>
@ -211,12 +210,12 @@ session_start();
<div id="divisionDisplayPanel">
<h2>Per-Division Results</h2>
<div class="divisionNavPanel">
<input type="radio" id="divisionOpenButton" name="division" value="open" onclick="refreshDisplay();" checked="checked">
<label for="divisionOpenButton" id="divisionOpenButton">Open</label>
<input type="radio" id="divisionIntermediateButton" name="division" value="intermediate" onclick="refreshDisplay();">
<label for="divisionIntermediateButton" id="divisionIntermediateButton">Intermediate</label>
<input type="radio" id="divisionMainButton" name="division" value="main" onclick="refreshDisplay();">
<label for="divisionMainButton" id="divisionMainButton">Main</label>
<input type="radio" id="openButton" name="division" value="open" onclick="refreshDisplay();" checked="checked">
<label for="openButton" id="openButton">Open</label>
<input type="radio" id="intermediateButton" name="division" value="intermediate" onclick="refreshDisplay();">
<label for="intermediateButton" id="intermediateButton">Intermediate</label>
<input type="radio" id="mainButton" name="division" value="main" onclick="refreshDisplay();">
<label for="mainButton" id="mainButton">Main</label>
</div>
<div class="dateSelector">
<select size="1" name="month" id="month" onchange="refreshDisplay();">

View File

@ -1,17 +0,0 @@
<div class="header">
<div id="headerLeft">
<img src="/assets/trojan_image_1.png" alt="Trojan Destiny logo" id="headerImage">
</div>
<div id="headerCentre">
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
<div id="youtubeImage" onclick="redirect('mainpage', 'https://www.youtube.com/@TrojanDestinyRL')"><img
src="/assets/youtube.svg" alt="youtube logo"></div>
<div id="twitchImage" onclick="redirect('mainpage', 'https://www.twitch.tv/trojandestinyrl')"><img
src="/assets/twitch.svg" alt="twitch logo"></div>
<div id="discordImage" onclick="redirect('mainpage', 'https://discord.gg/bzU5fVxCZJ')"><img
src="/assets/discord.svg" alt="discord logo"></div>
</div>
<div id="headerRight">
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
</div>
</div>

View File

@ -1,20 +0,0 @@
<div class="subNav">
<?php
// Is the user is logged in we'll show them a navigation bar with some fancier options
if (isset($_SESSION["userID"])) {
echo "<a href=\"/user/" . $_SESSION["username"] . "\" class=\"subNavLink\">ACCOUNT</a>";
echo "<a href=\"/\" class=\"subNavLink\">HOME</a>";
echo "<a href=\"/user/logout.php\" class=\"subNavLink\">LOGOUT</a>";
echo "<a href=\"/admin/data_management/game_form.php\" target=\"dataFrame\" class=\"subNavLink disabled\">ADD GAME DETAILS</a>";
// Anything we need to show to logged in admins will be below
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1) {
echo "<a href=\"/admin/data_management/tourney_form.php\" target=\"dataFrame\" class=\"subNavLink\">ADD A TOURNEY</a>";
echo "<a href=\"/admin\" class=\"subNavLink\">ADMIN PANEL</a>";
}
} else {
echo "<a href=\"/user/login_page.php\" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/user/create_account.php\" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/\" class=\"subNavLink\">HOME</a>";
}
?>
</div>

View File

@ -21,11 +21,46 @@ session_start();
<body id="body">
<div id="contentFrame">
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
<?php include_once('./display/header.html'); ?>
<div class="header">
<div id="headerLeft">
<img src="/assets/trojan_image_1.png" alt="Trojan Destiny logo" id="headerImage">
</div>
<div id="headerCentre">
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
<div id="youtubeImage" onclick="redirect('mainpage', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
<div id="twitchImage" onclick="redirect('mainpage', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
<div id="discordImage" onclick="redirect('mainpage', 'https://discord.gg/bzU5fVxCZJ')"><img src="/assets/discord.svg" alt="discord logo"></div>
</div>
<div id="headerRight">
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
</div>
</div>
<p></p>
<h1>Trojan's Trophy Room</h1>
<h4 style="font-size:150%;margin:auto;"><a href="/giveaway" id="giveawayLink">Giveaway Disclaimer</a></h4>
<iframe src="/display/general_results.php" name="dataFrame" class="dataFrame" id="dataFrame" onload="resizeIframe(this);"></iframe>
<?php include_once('./display/subnav.php'); ?>
<p class="newLine"></p>
<p class="newLine"></p>
<div class="subNav">
<?php
// Is the user is logged in we'll show them a navigation bar with some fancier options
if (isset($_SESSION["userID"])){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
echo "<a href=\"/user/logout.php \" class=\"subNavLink\">LOGOUT</a>";
echo "<a href=\"/admin/data_management/game_form.php \" target=\"dataFrame\" class=\"subNavLink disabled\">ADD GAME DETAILS</a>";
// Anything we need to show to logged in admins will be below
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1){
echo "<a href=\"/admin/data_management/tourney_form.php \" target=\"dataFrame\" class=\"subNavLink\">ADD A TOURNEY</a>";
echo "<a href=\"/admin \" class=\"subNavLink\">ADMIN PANEL</a>";
}
} else {
echo "<a href=\"/user/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/user/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
}
?>
</div>
</div>
</body>
</html>

View File

@ -43,8 +43,3 @@ function redirect(location, address) {
window.open(address).focus();
}
}
function selectElement(id, valueToSelect) {
let element = document.getElementById(id);
element.value = valueToSelect;
}

View File

@ -64,14 +64,3 @@ function checkIfScoreTied() {
}
}
}
function editTourney(id) {
var div = document.getElementById("tourneyEditFrameDiv");
var tournamentID = document.getElementById("tournament").value;
var html = "";
html += "<iframe src=\"/admin/data_management/tourney_edit_form.php?tournamentID=" + tournamentID + "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);resizeIframe(parent.document.getElementById('dataFrame'));\"></iframe>";
div.innerHTML = html;
}

View File

@ -239,17 +239,13 @@
.divisionResultsTableLeft {
text-align: left;
width: 70%;
width: 80%;
cursor: pointer;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.divisionResultsTableRight {
text-align: right;
width: 14%;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.divisionResultsTable {

View File

@ -182,3 +182,18 @@
visibility: hidden;
}
/*
This section affects the auto-complete menu for player names
*/
.ui-menu {
background-color: rgba(255, 255, 255, 0.6);
border: 1px solid black;
border-radius: 2px;
}
.ui-autocomplete {
max-height: 200px;
overflow-y: scroll;
overflow-x: hidden;
width: 120px;
}

View File

@ -8,7 +8,6 @@
justify-content: center;
margin: auto;
font-size: 1.5em;
margin-bottom: 2%;
}
#headerLeft {

View File

@ -4,9 +4,6 @@
/* Import Header */
@import url('/styles/header.css');
/* Sub-Nav */
@import url('/styles/subnav.css');
/* Line break for flex layout */
.newLine {
width: 100%;
@ -160,6 +157,53 @@ For upper/primary controls
}
/*
SUB-NAVIGATION
For all the things at the bottom of the page; log in/out, 'my account', etc.
*/
.subNav {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 2%;
padding: 5px;
padding-left: 15px;
padding-right: 15px;
font-size: small;
}
.subNavLink {
border: 1px solid rgb(0, 0, 255);
border-radius: 3px;
box-shadow: 0px 2px 4px;
text-decoration: none;
color: black;
padding: 5px;
padding-left: 15px;
padding-right: 15px;
text-align: center;
align-content: center;
width: 80px;
height: 45px;
}
.subNav a {
box-shadow: 0px 2px 4px;
}
.subNav a:hover {
color: black;
background-color: rgba(255, 165, 0, .6);
}
.subNav a:active {
box-shadow: 0px 0px 2px;
transform: translateY(2px);
}
.submitButton input[type="submit"] {
margin: auto;
@ -237,23 +281,6 @@ margin-left: -90px;
}
/*
This section affects the auto-complete menu for player names
*/
.ui-menu {
background-color: rgba(255, 255, 255, 0.6);
border: 1px solid black;
border-radius: 2px;
}
.ui-autocomplete {
max-height: 200px;
overflow-y: scroll;
overflow-x: hidden;
width: 120px;
}

View File

@ -1,39 +0,0 @@
.subNav {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 2%;
padding: 5px;
padding-left: 15px;
padding-right: 15px;
font-size: small;
margin-top: 3%;
}
.subNavLink {
border: 1px solid rgb(0, 0, 255);
border-radius: 3px;
box-shadow: 0px 2px 4px;
text-decoration: none;
color: black;
padding: 5px;
padding-left: 15px;
padding-right: 15px;
text-align: center;
align-content: center;
width: 80px;
height: 45px;
}
.subNav a {
box-shadow: 0px 2px 4px;
}
.subNav a:hover {
color: black;
background-color: rgba(255, 165, 0, .6);
}
.subNav a:active {
box-shadow: 0px 0px 2px;
transform: translateY(2px);
}

View File

@ -52,12 +52,8 @@
}
.tourneyCardRight {
max-width: 55%;
text-align: right;
margin: 0;
padding-left: 10px;
padding-right: 10px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

View File

@ -14,6 +14,7 @@
flex-shrink: 1;
border-top: 2px solid black;
border-bottom: 2px solid black;
padding-bottom: 2%;
margin-bottom: 2%;
}
@ -39,44 +40,5 @@
text-align: center;
}
#notes {
padding-bottom: 2%;
}
.editButton {
margin-top: 2% !important;
margin-bottom: 2% !important;
margin: auto;
padding: 7px 15px;
font-size: 100%;
font-weight: bold;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-decoration: none;
color: black;
background-color: rgba(255, 255, 255, 0);
border-radius: 6px;
border: 1px solid rgb(0, 0, 255);
box-shadow: 0px 2px 4px;
width: 50px;
}
.editButton:hover {
color: black;
background-color: rgba(255, 165, 0, .6);
}
.editButton:active {
box-shadow: 0px 0px 2px;
transform: translateY(2px);
}
.editButton a {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
text-decoration: none;
color: black;
margin-top: 1%;
margin-bottom: 2%;
}
/*// MOBILE ////
///////////////*/

View File

@ -20,15 +20,6 @@
text-align: center;
}
#tourneyEditPanel {
width: 95%;
min-height: 400px;
margin: auto;
text-align: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.optionsArea {
display: flex;
flex-wrap: wrap;
@ -187,68 +178,6 @@
font-weight: bold;
}
/* EDITING PAGE */
.tourneyListPanel {
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
width: 99%;
justify-content: center;
margin: auto;
border-collapse: collapse;
}
.tournamentIDCol {
width: 2.5em;
text-align: center;
outline: 1px solid black;
margin: auto;
margin-left: 1px;
margin-top: 1px;
}
.tournamentDateCol {
width: 6em;
text-align: center;
outline: 1px solid black;
margin: auto;
margin-left: 1px;
margin-top: 1px;
}
.tournamentNameCol {
width: 0;
text-align: left;
outline: 1px solid black;
flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-left: 0.5em;
padding-right: 0.5em;
margin: auto;
margin-left: 1px;
margin-top: 1px;
}
.editTournamentCol {
width: 3em;
outline: 1px solid black;
margin: auto;
margin-left: 1px;
margin-top: 1px;
}
.deleteTournamentCol {
width: 4.5em;
outline: 1px solid black;
margin: auto;
margin-left: 1px;
margin-top: 1px;
}
/*
This section affects the auto-complete menu for player names
*/

View File

@ -6,7 +6,7 @@
}
#userEditPanel {
width: 500px;
min-height: 600px;
min-height: 400px;
margin: auto;
text-align: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

View File

@ -1,193 +0,0 @@
<?php
session_start();
include("../admin/db_config.php"); // Include database stuff
try { // Try opening the SQL database connection
$conn = new PDO("mysql:host=$servername; dbname=$dbName", $dbUsername, $dbPassword);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$tourneyID = $_GET["tournamentID"];
// Grab the list of users from the user list
// We will also grab all the people that have been registered/won before
$sqlGetUserData = $conn->prepare("SELECT username FROM " . $userTableName . "");
$sqlGetTourneyData = $conn->prepare("SELECT winner1,winner2,winner3,winner4 FROM " . $tournamentDataTableName . "");
$sqlGetAllTourneyData = $conn->prepare("SELECT * FROM " . $tournamentDataTableName . " WHERE tournamentID='" . $tourneyID . "'");
// Execute SQL query
$sqlGetUserData->execute();
$sqlGetTourneyData->execute();
$sqlGetAllTourneyData->execute();
// Get results from the USERS table
$results = $sqlGetUserData->fetchAll(PDO::FETCH_ASSOC);
// Create array to store values
$userList = array();
// Move results to their own array, easier to convert for Javascript
foreach ($results as $result) {
$userList[] = $result["username"];
}
// Get results from the TOURNEY table
$results = $sqlGetTourneyData->fetchAll(PDO::FETCH_ASSOC);
// Move results to their own array, easier to convert for Javascript
foreach ($results as $result) {
$userList[] = $result["winner1"];
$userList[] = $result["winner2"];
$userList[] = $result["winner3"];
$userList[] = $result["winner4"];
}
// Make sure we only have each name once
$userList = array_unique($userList);
// Sort the array to alphabetical order
sort($userList);
$tourneyResults = $sqlGetAllTourneyData->fetch(PDO::FETCH_ASSOC);
// Grab tournament info
// Set variables from SQL data
$tourneyName = $tourneyResults["tournamentName"];
$tourneyUID = $tourneyResults["tournamentUID"];
$tourneyDate = $tourneyResults["tournamentDate"];
$division = $tourneyResults["tournamentDivision"];
$numPlayers = $tourneyResults["numPlayers"];
$bestOf = $tourneyResults["bestOf"];
$winningTeamName = $tourneyResults["winningTeamName"];
$winner1 = $tourneyResults["winner1"];
$winner2 = $tourneyResults["winner2"];
$winner3 = $tourneyResults["winner3"];
$winner4 = $tourneyResults["winner4"];
$notes = $tourneyResults["notes"];
} catch (PDOException $e) { // failed connection
echo "Connection failed: " . $e->getMessage();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="/styles/primary.css" />
<link rel="stylesheet" href="/styles/admin.css" />
<link rel="stylesheet" href="/styles/admin_nav.css" />
<link rel="stylesheet" href="/styles/tourney_management.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.14.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/ui/1.14.1/jquery-ui.js"></script>
<script src="/scripts/tourney_management.js"></script>
<script src="/scripts/tools.js"></script>
<script>//verifyPageInFrame()</script>
<script>
if (parent.window.screen.width >= 360 && window.screen.width <= 1024) {
// If mobile, get the mobile version
window.location.replace("/tournament/edit_mobile.php");
}
</script>
<title>TOURNAMENT EDITING FORM</title>
<script>
$( function() {
var userList = <?php echo json_encode($userList); ?>;
$(".playerInput").autocomplete({
source: userList,
});
} );
</script>
</head>
<body id="body">
<div id="contentFrame">
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
<?php include_once('../display/header.html'); ?>
<div id="tourneyFormPanel">
<form id="userForm" action="/admin/data_management/edit_tourney.php" method="POST" autocomplete="off">
<h2>EDIT TOURNAMENT</h2>
<hr>
<p></p>
<div id="textInputArea">
<label for="tourneyName">Tournament name</label>
<input type="text" id="tourneyName" name="tourneyName" value="<?php echo $tourneyName; ?>" maxlength="150" tabindex="1" required>
<p class="newLine"></p>
<label for="tourneyName">Tournament date</label>
<input type="date" id="tourneyDate" name="tourneyDate" max="<?php echo date("Y-m-d"); ?>" value="<?php echo $tourneyDate; ?>" tabindex="1" required>
<p class="newLine"></p>
</div>
<div class="optionsArea">
<label for="division">Division:</label>
<select id="division" name="division" tabindex="1">
<option value="main">Main</option>
<option value="intermediate">Intermediate</option>
<option value="open">Open</option>
</select>
<script>selectElement('division', '<?php echo $division; ?>');</script>
<p class="newLine"></p>
<label for="numPlayers">Players:</label>
<select id="numPlayers" name="numPlayers" tabindex="1" onchange="changePlayers()">
<option value="1">1v1</option>
<option value="2">2v2</option>
<option value="3">3v3</option>
<option value="4">4v4</option>
</select>
<script>selectElement('numPlayers', '<?php echo $numPlayers; ?>');</script>
<label for="bestOf">Best of:</label>
<select id="bestOf" name="bestOf" tabindex="1">
<option value="1">1</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="7">7</option>
</select>
<script>selectElement('bestOf', '<?php echo $bestOf; ?>');</script>
</div>
<p class="newLine"></p>
<div id="playerDataInputArea">
<p id="teamNameHeader">WINNING TEAM NAME:</p>
<input type="text" name="winningTeamName" class="teamInput" maxlength="30" value="<?php echo $winningTeamName; ?>" tabindex="1">
<h4>Roster</h4>
<table id="playerData">
</table>
<script>addPlayers();</script>
<script>
var winner1 = <?php echo json_encode($winner1, JSON_HEX_TAG); ?>;
var winner2 = <?php echo json_encode($winner2, JSON_HEX_TAG); ?>;
var winner3 = <?php echo json_encode($winner3, JSON_HEX_TAG); ?>;
var winner4 = <?php echo json_encode($winner4, JSON_HEX_TAG); ?>;
document.getElementById("1").value = winner1;
document.getElementById("2").value = winner2;
document.getElementById("3").value = winner3;
document.getElementById("4").value = winner4;
</script>
<p class="newLine"></p>
</div>
<p class="newLine"></p>
<div class="optionsArea">
<p class="newLine"></p>
<p class="newLine">Notes</p>
<textarea name="notes" id="notes" tabindex="4"><?php echo $notes; ?></textarea>
<p class="newLine"></p>
<input type="hidden" id="tourneyID" name="tourneyID" value="<?php echo $tourneyID; ?>">
<input type="hidden" id="tourneyUID" name="tourneyUID" value="<?php echo $tourneyUID; ?>">
</div>
<p class="newLine"></p>
<div id="submitButtonDiv">
<p class="newLine"></p>
<input type="submit" value="Save" id="submitButton" tabindex="4">
</div>
<p class="newLine"></p>
</form>
</div>
<?php include_once('../display/subnav.php'); ?>
</div>
</body>
</html>

View File

@ -44,17 +44,29 @@ if (isset($tourneyResults)) {
</head>
<body id="body">
<script>getURL();</script>
<div id="contentFrame">
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
<?php include_once('../display/header.html'); ?>
<div class="header">
<div id="headerLeft">
<img src="/assets/trojan_image_1.png" alt="Trojan Destiny logo" id="headerImage">
</div>
<div id="headerCentre">
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
<div id="youtubeImage" onclick="redirect('this', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
<div id="twitchImage" onclick="redirect('this', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
<div id="discordImage" onclick="redirect('this', 'https://discord.gg/bzU5fVxCZJ')"><img src="/assets/discord.svg" alt="discord logo"></div>
</div>
<div id="headerRight">
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
</div>
</div>
<p></p>
<h1>Tournament Information</h1>
<p class="newLine"></p>
<div id="tournamentDisplayPanel">
<?php
if ($tourneyExists) {
// TOURNEY PANEL - LEFT PANEL
// Set variables from SQL data
$tourneyID = $tourneyResults["tournamentID"];
$tourneyName = $tourneyResults["tournamentName"];
$tourneyDate = $tourneyResults["tournamentDate"];
$division = ucfirst($tourneyResults["tournamentDivision"]);
@ -69,8 +81,6 @@ if (isset($tourneyResults)) {
// Format date
$tourneyDate = DateTime::createFromFormat('Y-m-d', $tourneyDate);
$tourneyDate = $tourneyDate->format('M j, Y');
// Print page
echo "<div class=\"tournamentDisplay\">";
echo "<h3>Details</h2>";
echo "<hr class=\"regularLine\">";
@ -99,14 +109,8 @@ if (isset($tourneyResults)) {
echo "<h4>Notes:</h4>";
echo "<p style=\"width:70%;\">$notes</p>";
}
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1) {
echo "<p class=\"editButton\"><a href=\"/tournament/edit.php?tournamentID=" . $tourneyID . "\" onclick=\"redirect('this', '/admin/data_management/edit_tourney.php?tourneyID=" . $tourneyID . "');\">Edit</a></p>";
}
echo "</div>";
// GAME DISPLAY - RIGHT PANEL
echo "<div class=\"gameDisplay\">";
echo "<h3>Games</h3>";
echo "<hr class=\"regularLine\">";
@ -114,7 +118,6 @@ if (isset($tourneyResults)) {
} else {
// TOURNAMENT NOT FOUND
echo "<div class=\"noTourney\">";
echo "<hr class=\"regularLine\">";
echo "<h1>TOURNAMENT NOT FOUND</h1>";
@ -124,7 +127,33 @@ if (isset($tourneyResults)) {
</div>
</div>
<p class="newLine"></p>
<?php include_once('../display/subnav.php'); ?>
<div class="subNav">
<?php
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1) {
echo "<a href=\"/admin/\" class=\"subNavLink\" id=\"adminHomeButton\">ADMIN PANEL</a>";
}
?>
<a href="../" class="subNavLink" id="mainHomeButton">HOME</a>
<?php
// If we're showing someone other than who's logged in, offer a link to their own page
if (isset($_SESSION["userID"])){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">MY ACCOUNT</a>";
}
?>
<p class="newLine"></p>
<?php
// If someone is logged in, give them the opportunity to log out
if (isset($_SESSION["userID"])){
echo "<a href=\"../user/logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
} else {
echo "<a href=\"/user/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
}
?>
</div>
</div>
</body>

View File

@ -55,7 +55,21 @@ try { // Try opening the SQL database connection
<script>getURL();</script>
<div id="contentFrame">
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
<?php include_once('../display/header.html'); ?>
<div class="header">
<div id="headerLeft">
<img src="/assets/trojan_image_1.png" alt="Trojan Destiny logo" id="headerImage">
</div>
<div id="headerCentre">
<h1 id="headerText"><a href="/" class="plainLinkBlue">TrojanDestinyRL</a></h1>
<div id="youtubeImage" onclick="redirect('this', 'https://www.youtube.com/@TrojanDestinyRL')"><img src="/assets/youtube.svg" alt="youtube logo"></div>
<div id="twitchImage" onclick="redirect('this', 'https://www.twitch.tv/trojandestinyrl')"><img src="/assets/twitch.svg" alt="twitch logo"></div>
<div id="discordImage" onclick="redirect('this', 'https://discord.gg/bzU5fVxCZJ')"><img src="/assets/discord.svg" alt="discord logo"></div>
</div>
<div id="headerRight">
<img src="/assets/trojan_image_2.png" alt="Trojan Destiny logo" id="headerImage">
</div>
</div>
<p></p>
<?php
if ($userExists) {
echo ("<iframe src=\"/user/account.php?username=" . $_GET["username"] . "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>");
@ -68,7 +82,34 @@ try { // Try opening the SQL database connection
echo "</div>";
}
?>
<?php include_once('../display/subnav.php'); ?>
<div class="subNav">
<?php
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1) {
echo "<a href=\"/admin/\" class=\"subNavLink\" id=\"adminHomeButton\">ADMIN PANEL</a>";
}
?>
<a href="../" class="subNavLink" id="mainHomeButton">HOME</a>
<?php
// If we're showing someone other than who's logged in, offer a link to their own page
if (isset($_SESSION["userID"]) && $_SESSION["username"] != $_GET["username"]){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">MY ACCOUNT</a>";
}
?>
<p class="newLine"></p>
<?php
// If someone is logged in, give them the opportunity to log out
if (isset($_SESSION["userID"])){
echo "<a href=\"../user/logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
} else {
echo "<a href=\"/user/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
}
?>
</div>
</div>
</body>
</html>