Compare commits
10 Commits
0f1013d54e
...
aa0a44116b
Author | SHA1 | Date | |
---|---|---|---|
aa0a44116b | |||
e83639f8d8 | |||
e56ffdb076 | |||
00cab61c65 | |||
578326cb03 | |||
40f1dcee6e | |||
66fdaf8ebd | |||
133bb19911 | |||
4a880b93dd | |||
15c3475a4f |
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
<body id="generalBody">
|
<body id="generalBody">
|
||||||
<div id="informationContentPanel">
|
<div id="informationContentPanel">
|
||||||
|
<hr class="regularLine">
|
||||||
<h3>USER MANAGEMENT</h3>
|
<h3>USER MANAGEMENT</h3>
|
||||||
<div class="navPanel" id="userManagementPanel">
|
<div class="navPanel" id="userManagementPanel">
|
||||||
<a href="user_management/user_form.php" target="dataFrame" class="navLink">CREATE USER</a>
|
<a href="user_management/user_form.php" target="dataFrame" class="navLink">CREATE USER</a>
|
||||||
@ -32,18 +33,27 @@
|
|||||||
<!-- <a href="user_management/create_safe_admin.php" target="dataFrame" class="navLink">CREATE PERMA-ADMIN</a> -->
|
<!-- <a href="user_management/create_safe_admin.php" target="dataFrame" class="navLink">CREATE PERMA-ADMIN</a> -->
|
||||||
</div>
|
</div>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
<hr class="regularLine">
|
||||||
<h3>DATA MANAGEMENT</h3>
|
<h3>DATA MANAGEMENT</h3>
|
||||||
<div class="navPanel" id="tourneyManagementPanel">
|
<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>
|
<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_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>
|
</div>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
<hr class="regularLine">
|
||||||
<h3>!!!!! DANGER ZONE !!!!!</h3>
|
<h3>!!!!! DANGER ZONE !!!!!</h3>
|
||||||
<div class="navPanel" id="dbManagementPanel">
|
<div class="navPanel" id="dbManagementPanel">
|
||||||
<a href="db_management/conn_check.php" target="dataFrame" class="navLink">CHECK DB CONNECTION</a>
|
<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> -->
|
<!-- <a href="db_management/reinitialise.php" target="dataFrame" class="navLink">REINITIALISE DB</a> -->
|
||||||
</div>
|
</div>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
<hr class="regularLine">
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -119,6 +119,23 @@
|
|||||||
|
|
||||||
echo "Successfully uploaded new tournament record";
|
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
|
} catch (PDOException $e) { // failed connection
|
||||||
echo "Connection failed: " . $e->getMessage();
|
echo "Connection failed: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
|
132
admin/data_management/edit_tourney.php
Normal file
132
admin/data_management/edit_tourney.php
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<?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>
|
95
admin/data_management/tourney_display_frame.php
Normal file
95
admin/data_management/tourney_display_frame.php
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<?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"> </p>
|
||||||
|
<p class="deleteTournamentCol"> </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> </p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -127,7 +127,7 @@ try { // Try opening the SQL database connection
|
|||||||
<p class="newLine"></p>
|
<p class="newLine"></p>
|
||||||
<div id="playerDataInputArea">
|
<div id="playerDataInputArea">
|
||||||
<p id="teamNameHeader">WINNING TEAM NAME:</p>
|
<p id="teamNameHeader">WINNING TEAM NAME:</p>
|
||||||
<input type="text" name="winningTeamName" class="teamInput" maxlength="35" tabindex="1">
|
<input type="text" name="winningTeamName" class="teamInput" maxlength="30" tabindex="1">
|
||||||
<h4>Roster</h4>
|
<h4>Roster</h4>
|
||||||
<table id="playerData">
|
<table id="playerData">
|
||||||
</table>
|
</table>
|
||||||
|
@ -23,22 +23,8 @@ session_start();
|
|||||||
<body id="body">
|
<body id="body">
|
||||||
<script>getURL();</script>
|
<script>getURL();</script>
|
||||||
<div id="contentFrame">
|
<div id="contentFrame">
|
||||||
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
||||||
<div class="header">
|
<?php include_once('../display/header.html'); ?>
|
||||||
<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>
|
<h2 id="adminHeader">ADMIN PANEL</h2>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -89,29 +75,15 @@ session_start();
|
|||||||
if (!isset($_SESSION["userID"])){
|
if (!isset($_SESSION["userID"])){
|
||||||
echo "<iframe src=\"../user/login_page.php?redirect=admin\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
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) {
|
} else if (isset($_SESSION["userID"]) && $_SESSION["privileges"] == 1) {
|
||||||
echo "<iframe src=\"admin_nav.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
echo "<iframe src=\"admin_nav.html\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
||||||
} else {
|
} else {
|
||||||
echo "<iframe src=\"not_admin.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
echo "<iframe src=\"not_admin.html\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<div class="subNav">
|
<?php include_once('../display/subnav.php'); ?>
|
||||||
<?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>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -38,7 +38,7 @@ try { // Try opening the SQL database connection
|
|||||||
|
|
||||||
foreach ($sqlWinnersList as $winner) {
|
foreach ($sqlWinnersList as $winner) {
|
||||||
for ($i = 1; $i < 4; $i++) {
|
for ($i = 1; $i < 4; $i++) {
|
||||||
if ($winner["winner" . $i] != "N/A") {
|
if ($winner["winner" . $i] != "N/A" && $winner["winner" . $i] != "-nobody-" && $winner["winner" . $i] != "") {
|
||||||
$winnersList[] = $winner["winner" . $i];
|
$winnersList[] = $winner["winner" . $i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ session_start();
|
|||||||
<link rel="stylesheet" href="/styles/primary.css" />
|
<link rel="stylesheet" href="/styles/primary.css" />
|
||||||
<link rel="stylesheet" href="/styles/data_display.css" />
|
<link rel="stylesheet" href="/styles/data_display.css" />
|
||||||
<link rel="stylesheet" href="/styles/tourney_results.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/tools.js"></script>
|
||||||
<script src="/scripts/results.js"></script>
|
<script src="/scripts/results.js"></script>
|
||||||
<script>verifyPageInFrame()</script>
|
<script>verifyPageInFrame()</script>
|
||||||
@ -210,12 +211,12 @@ session_start();
|
|||||||
<div id="divisionDisplayPanel">
|
<div id="divisionDisplayPanel">
|
||||||
<h2>Per-Division Results</h2>
|
<h2>Per-Division Results</h2>
|
||||||
<div class="divisionNavPanel">
|
<div class="divisionNavPanel">
|
||||||
<input type="radio" id="openButton" name="division" value="open" onclick="refreshDisplay();" checked="checked">
|
<input type="radio" id="divisionOpenButton" name="division" value="open" onclick="refreshDisplay();" checked="checked">
|
||||||
<label for="openButton" id="openButton">Open</label>
|
<label for="divisionOpenButton" id="divisionOpenButton">Open</label>
|
||||||
<input type="radio" id="intermediateButton" name="division" value="intermediate" onclick="refreshDisplay();">
|
<input type="radio" id="divisionIntermediateButton" name="division" value="intermediate" onclick="refreshDisplay();">
|
||||||
<label for="intermediateButton" id="intermediateButton">Intermediate</label>
|
<label for="divisionIntermediateButton" id="divisionIntermediateButton">Intermediate</label>
|
||||||
<input type="radio" id="mainButton" name="division" value="main" onclick="refreshDisplay();">
|
<input type="radio" id="divisionMainButton" name="division" value="main" onclick="refreshDisplay();">
|
||||||
<label for="mainButton" id="mainButton">Main</label>
|
<label for="divisionMainButton" id="divisionMainButton">Main</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="dateSelector">
|
<div class="dateSelector">
|
||||||
<select size="1" name="month" id="month" onchange="refreshDisplay();">
|
<select size="1" name="month" id="month" onchange="refreshDisplay();">
|
||||||
|
17
display/header.html
Normal file
17
display/header.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<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>
|
20
display/subnav.php
Normal file
20
display/subnav.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<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>
|
41
index.php
41
index.php
@ -20,47 +20,12 @@ session_start();
|
|||||||
|
|
||||||
<body id="body">
|
<body id="body">
|
||||||
<div id="contentFrame">
|
<div id="contentFrame">
|
||||||
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
||||||
<div class="header">
|
<?php include_once('./display/header.html'); ?>
|
||||||
<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>
|
<h1>Trojan's Trophy Room</h1>
|
||||||
<h4 style="font-size:150%;margin:auto;"><a href="/giveaway" id="giveawayLink">Giveaway Disclaimer</a></h4>
|
<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>
|
<iframe src="/display/general_results.php" name="dataFrame" class="dataFrame" id="dataFrame" onload="resizeIframe(this);"></iframe>
|
||||||
<p class="newLine"></p>
|
<?php include_once('./display/subnav.php'); ?>
|
||||||
<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>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -43,3 +43,8 @@ function redirect(location, address) {
|
|||||||
window.open(address).focus();
|
window.open(address).focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectElement(id, valueToSelect) {
|
||||||
|
let element = document.getElementById(id);
|
||||||
|
element.value = valueToSelect;
|
||||||
|
}
|
@ -64,3 +64,14 @@ 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;
|
||||||
|
}
|
||||||
|
@ -239,13 +239,17 @@
|
|||||||
|
|
||||||
.divisionResultsTableLeft {
|
.divisionResultsTableLeft {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: 80%;
|
width: 70%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divisionResultsTableRight {
|
.divisionResultsTableRight {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
width: 14%;
|
width: 14%;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divisionResultsTable {
|
.divisionResultsTable {
|
||||||
|
@ -182,18 +182,3 @@
|
|||||||
visibility: hidden;
|
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;
|
|
||||||
}
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
|
margin-bottom: 2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headerLeft {
|
#headerLeft {
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
/* Import Header */
|
/* Import Header */
|
||||||
@import url('/styles/header.css');
|
@import url('/styles/header.css');
|
||||||
|
|
||||||
|
/* Sub-Nav */
|
||||||
|
@import url('/styles/subnav.css');
|
||||||
|
|
||||||
/* Line break for flex layout */
|
/* Line break for flex layout */
|
||||||
.newLine {
|
.newLine {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -157,53 +160,6 @@ 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"] {
|
.submitButton input[type="submit"] {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@ -281,6 +237,23 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
39
styles/subnav.css
Normal file
39
styles/subnav.css
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
.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);
|
||||||
|
}
|
@ -52,8 +52,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tourneyCardRight {
|
.tourneyCardRight {
|
||||||
|
max-width: 55%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
@ -14,7 +14,6 @@
|
|||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
border-top: 2px solid black;
|
border-top: 2px solid black;
|
||||||
border-bottom: 2px solid black;
|
border-bottom: 2px solid black;
|
||||||
padding-bottom: 2%;
|
|
||||||
margin-bottom: 2%;
|
margin-bottom: 2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,5 +39,44 @@
|
|||||||
text-align: center;
|
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 ////
|
/*// MOBILE ////
|
||||||
///////////////*/
|
///////////////*/
|
@ -20,6 +20,15 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tourneyEditPanel {
|
||||||
|
width: 95%;
|
||||||
|
min-height: 400px;
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.optionsArea {
|
.optionsArea {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -178,6 +187,68 @@
|
|||||||
font-weight: bold;
|
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
|
This section affects the auto-complete menu for player names
|
||||||
*/
|
*/
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
}
|
}
|
||||||
#userEditPanel {
|
#userEditPanel {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
min-height: 400px;
|
min-height: 600px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
193
tournament/edit.php
Normal file
193
tournament/edit.php
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
<?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>
|
@ -44,29 +44,17 @@ if (isset($tourneyResults)) {
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="body">
|
<body id="body">
|
||||||
<script>getURL();</script>
|
|
||||||
<div id="contentFrame">
|
<div id="contentFrame">
|
||||||
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
||||||
<div class="header">
|
<?php include_once('../display/header.html'); ?>
|
||||||
<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>
|
<h1>Tournament Information</h1>
|
||||||
<p class="newLine"></p>
|
<p class="newLine"></p>
|
||||||
<div id="tournamentDisplayPanel">
|
<div id="tournamentDisplayPanel">
|
||||||
<?php
|
<?php
|
||||||
if ($tourneyExists) {
|
if ($tourneyExists) {
|
||||||
|
// TOURNEY PANEL - LEFT PANEL
|
||||||
|
// Set variables from SQL data
|
||||||
|
$tourneyID = $tourneyResults["tournamentID"];
|
||||||
$tourneyName = $tourneyResults["tournamentName"];
|
$tourneyName = $tourneyResults["tournamentName"];
|
||||||
$tourneyDate = $tourneyResults["tournamentDate"];
|
$tourneyDate = $tourneyResults["tournamentDate"];
|
||||||
$division = ucfirst($tourneyResults["tournamentDivision"]);
|
$division = ucfirst($tourneyResults["tournamentDivision"]);
|
||||||
@ -81,6 +69,8 @@ if (isset($tourneyResults)) {
|
|||||||
// Format date
|
// Format date
|
||||||
$tourneyDate = DateTime::createFromFormat('Y-m-d', $tourneyDate);
|
$tourneyDate = DateTime::createFromFormat('Y-m-d', $tourneyDate);
|
||||||
$tourneyDate = $tourneyDate->format('M j, Y');
|
$tourneyDate = $tourneyDate->format('M j, Y');
|
||||||
|
|
||||||
|
// Print page
|
||||||
echo "<div class=\"tournamentDisplay\">";
|
echo "<div class=\"tournamentDisplay\">";
|
||||||
echo "<h3>Details</h2>";
|
echo "<h3>Details</h2>";
|
||||||
echo "<hr class=\"regularLine\">";
|
echo "<hr class=\"regularLine\">";
|
||||||
@ -109,8 +99,14 @@ if (isset($tourneyResults)) {
|
|||||||
echo "<h4>Notes:</h4>";
|
echo "<h4>Notes:</h4>";
|
||||||
echo "<p style=\"width:70%;\">$notes</p>";
|
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>";
|
echo "</div>";
|
||||||
|
|
||||||
|
|
||||||
|
// GAME DISPLAY - RIGHT PANEL
|
||||||
echo "<div class=\"gameDisplay\">";
|
echo "<div class=\"gameDisplay\">";
|
||||||
echo "<h3>Games</h3>";
|
echo "<h3>Games</h3>";
|
||||||
echo "<hr class=\"regularLine\">";
|
echo "<hr class=\"regularLine\">";
|
||||||
@ -118,6 +114,7 @@ if (isset($tourneyResults)) {
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// TOURNAMENT NOT FOUND
|
||||||
echo "<div class=\"noTourney\">";
|
echo "<div class=\"noTourney\">";
|
||||||
echo "<hr class=\"regularLine\">";
|
echo "<hr class=\"regularLine\">";
|
||||||
echo "<h1>TOURNAMENT NOT FOUND</h1>";
|
echo "<h1>TOURNAMENT NOT FOUND</h1>";
|
||||||
@ -127,33 +124,7 @@ if (isset($tourneyResults)) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="newLine"></p>
|
<p class="newLine"></p>
|
||||||
<div class="subNav">
|
<?php include_once('../display/subnav.php'); ?>
|
||||||
<?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>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -54,22 +54,8 @@ try { // Try opening the SQL database connection
|
|||||||
<body id="body">
|
<body id="body">
|
||||||
<script>getURL();</script>
|
<script>getURL();</script>
|
||||||
<div id="contentFrame">
|
<div id="contentFrame">
|
||||||
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
<img src="/assets/rl_logo_background.svg" alt="Rocket League logo for background" class="backgroundImage">
|
||||||
<div class="header">
|
<?php include_once('../display/header.html'); ?>
|
||||||
<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
|
<?php
|
||||||
if ($userExists) {
|
if ($userExists) {
|
||||||
echo ("<iframe src=\"/user/account.php?username=" . $_GET["username"] . "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>");
|
echo ("<iframe src=\"/user/account.php?username=" . $_GET["username"] . "\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>");
|
||||||
@ -82,34 +68,7 @@ try { // Try opening the SQL database connection
|
|||||||
echo "</div>";
|
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>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user