From cbc2bef7f044c2d842dfc5e2b8cb19ffa567a950 Mon Sep 17 00:00:00 2001 From: FractalParadigm Date: Mon, 10 Mar 2025 11:01:24 -0400 Subject: [PATCH] Updated tournament form to include a mobile version This will probably be the start of creating mobile versions of *some* pages... probably forms, mostly --- admin/data_management/tourney_form.php | 12 +- admin/data_management/tourney_form_mobile.php | 155 ++++++++++++++++++ scripts/tools.js | 3 +- styles/admin_nav.css | 8 - styles/mobile_forms.css | 14 ++ styles/tourney_management.css | 8 +- 6 files changed, 186 insertions(+), 14 deletions(-) create mode 100644 admin/data_management/tourney_form_mobile.php create mode 100644 styles/mobile_forms.css diff --git a/admin/data_management/tourney_form.php b/admin/data_management/tourney_form.php index 4f0c7e6..843d577 100644 --- a/admin/data_management/tourney_form.php +++ b/admin/data_management/tourney_form.php @@ -66,6 +66,16 @@ try { // Try opening the SQL database connection + TOURNAMENT ADDING FORM - +

ADD NEW TOURNAMENT

diff --git a/admin/data_management/tourney_form_mobile.php b/admin/data_management/tourney_form_mobile.php new file mode 100644 index 0000000..aaa184b --- /dev/null +++ b/admin/data_management/tourney_form_mobile.php @@ -0,0 +1,155 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // 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 . ""); + + // Execute SQL query + $sqlGetUserData->execute(); + $sqlGetTourneyData->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); + +} catch (PDOException $e) { // failed connection + echo "Connection failed: " . $e->getMessage(); +} + +?> + + + + + + + + + + + + + + + + + + TOURNAMENT ADDING FORM + + + + +
+ +

ADD NEW TOURNAMENT

+

Add a recently-played tournament and record the victors.

+

Users will be able to add their own replays and information to the tournaments (later).

+

This is also how trophies will be tracked!

+
+

+
+ +

+ +

+ +

+ " value="" tabindex="1" required> +

+
+
+ + +

+ + + + +
+

+
+

WINNING TEAM NAME:

+ +

Roster

+ +
+ +

+
+

+
+

+

If you have any notes about the tournament, leave them below

+ +

+

Once the tournament is created, users will be able to attribute their games to it through the game creation/editing screen.

+
+ +

+ + +
+

+ +
+

+ +
+ + + \ No newline at end of file diff --git a/scripts/tools.js b/scripts/tools.js index 9265d1d..6f31008 100644 --- a/scripts/tools.js +++ b/scripts/tools.js @@ -1,7 +1,6 @@ function resizeIframe(obj) { - console.log(obj); obj.style.height = "200px"; - obj.style.width = "500px"; + obj.style.width = "100px"; obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px'; obj.style.width = obj.contentWindow.document.documentElement.scrollWidth + 'px'; } diff --git a/styles/admin_nav.css b/styles/admin_nav.css index 615f59b..62f5d29 100644 --- a/styles/admin_nav.css +++ b/styles/admin_nav.css @@ -20,11 +20,3 @@ #dbManagementPanel { gap: 2%; } - - -@media only screen and (min-width: 360px) and (max-width: 1024px) { - #generalBody { - width: 300px; - } - -} \ No newline at end of file diff --git a/styles/mobile_forms.css b/styles/mobile_forms.css new file mode 100644 index 0000000..439ee35 --- /dev/null +++ b/styles/mobile_forms.css @@ -0,0 +1,14 @@ + +#tourneyFormPanel { + width: 300px; + margin: auto; +} + +#tourneyFormBody { + width: 300px; + margin: auto; +} + +#playerDataInputArea { + width: 98%; +} \ No newline at end of file diff --git a/styles/tourney_management.css b/styles/tourney_management.css index 376a62c..32df45e 100644 --- a/styles/tourney_management.css +++ b/styles/tourney_management.css @@ -1,13 +1,15 @@ #tourneyFormPanel { width: 500px; min-height: 1000px; -} - -#tourneyFormPanel { margin: auto; text-align: center; } +#tourneyFormBody { + width: 800px; + margin: 0; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} #textInputArea { padding-left: 10px;