From 578326cb03b331187e70ca41710e958959054b18 Mon Sep 17 00:00:00 2001 From: FractalParadigm Date: Sat, 15 Mar 2025 17:00:47 -0400 Subject: [PATCH] Added tournament list to admin panel, with capability to edit them. Future ability to delete coming soon! --- admin/admin_nav.html | 10 ++ .../data_management/tourney_display_frame.php | 92 +++++++++++++++++++ admin/index.php | 4 +- scripts/tourney_management.js | 13 ++- styles/tourney_management.css | 61 ++++++++++++ 5 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 admin/data_management/tourney_display_frame.php diff --git a/admin/admin_nav.html b/admin/admin_nav.html index f1de473..ce3de58 100644 --- a/admin/admin_nav.html +++ b/admin/admin_nav.html @@ -25,6 +25,7 @@
+

USER MANAGEMENT

 

+

DATA MANAGEMENT

 

+

!!!!! DANGER ZONE !!!!!

 

+
\ No newline at end of file diff --git a/admin/data_management/tourney_display_frame.php b/admin/data_management/tourney_display_frame.php new file mode 100644 index 0000000..ba59188 --- /dev/null +++ b/admin/data_management/tourney_display_frame.php @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + TOURNEY EDITING FORM + + + +
+

TOURNEY EDITING

+

Edit tournaments here

+
+

+ +
+

ID

+

Name

+

 

+

 

+

+ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Grab the list of users from the user list + $sqlGetUserData = $conn->prepare("SELECT tournamentID,tournamentUID,tournamentName 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"]; + + echo "

$tournamentID

"; + echo "

$tournamentName

"; + echo "

EDIT

"; + echo "

DELETE

"; + echo "

"; + } + + + ?> +
+ +
+ +
+ +

 

+
+ + \ No newline at end of file diff --git a/admin/index.php b/admin/index.php index c78ef39..b019cdd 100644 --- a/admin/index.php +++ b/admin/index.php @@ -75,9 +75,9 @@ session_start(); if (!isset($_SESSION["userID"])){ echo ""; } else if (isset($_SESSION["userID"]) && $_SESSION["privileges"] == 1) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } } ?> diff --git a/scripts/tourney_management.js b/scripts/tourney_management.js index 4ed5d22..768f240 100644 --- a/scripts/tourney_management.js +++ b/scripts/tourney_management.js @@ -63,4 +63,15 @@ function checkIfScoreTied() { optionsToShow[i].style.visibility = "hidden"; } } -} \ No newline at end of file +} + +function editTourney(id) { + var div = document.getElementById("tourneyEditFrameDiv"); + var tournamentID = document.getElementById("tournament").value; + var html = ""; + + + html += ""; + + div.innerHTML = html; +} diff --git a/styles/tourney_management.css b/styles/tourney_management.css index 834d4d8..2461d6c 100644 --- a/styles/tourney_management.css +++ b/styles/tourney_management.css @@ -20,6 +20,15 @@ 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; @@ -178,6 +187,58 @@ font-weight: bold; } +.tourneyListPanel { + display: flex; + flex-direction: row; + flex-wrap: wrap; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + width: 98%; + justify-content: center; + margin: auto; + border-collapse: collapse; +} + +.tournamentIDCol { + width: 2.25em; + 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 */