From 1026404ad847b168f85e62cb5acc8dd2e47a41a6 Mon Sep 17 00:00:00 2001 From: Alex Fuchs Date: Tue, 6 Oct 2020 02:21:37 +0200 Subject: [PATCH] added result page --- css/bootstrap.css | 4 +-- index.php | 3 +- output.php | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 output.php diff --git a/css/bootstrap.css b/css/bootstrap.css index f4fbd7a..1d5eb70 100644 --- a/css/bootstrap.css +++ b/css/bootstrap.css @@ -60,7 +60,7 @@ body { line-height: 1.5; color: #212529; text-align: left; - background-color: #212121; + background-color: #ffffff; } [tabindex="-1"]:focus:not(:focus-visible) { @@ -77,7 +77,7 @@ h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.5rem; font-family: "Barlow Condensed", sans-serif; - color: #fff; + color: #000; } p { diff --git a/index.php b/index.php index 378df9d..0418155 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,7 @@ -
+
@@ -26,6 +26,7 @@
diff --git a/output.php b/output.php new file mode 100644 index 0000000..92cb9d8 --- /dev/null +++ b/output.php @@ -0,0 +1,77 @@ +load(); +$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'DB_PORT']); + +$remote = mysqli_connect(getenv('DB_HOST'), + getenv('DB_USER'), + getenv('DB_PASS'), + getenv('DB_NAME')); +if (mysqli_connect_errno()) { + printf("Couldn't connect to database! %s\n", mysqli_connect_error()); + exit(); +} + +$query = "select * from logocontest.output;"; +$result = mysqli_query($remote, $query); + + +echo ' + + + + +
+
+ +
+
+

Current ranking

+
+ +
+
+
+ +
+
+ + + + + + + + + + + '; +$count = 0; +$row = mysqli_fetch_assoc($result); +while ( $row!= NULL) { + echo ' + + + + + + + + + '; + $row = mysqli_fetch_assoc($result); +} +echo ' + +
PositionLogoNameDivisionWon matchups
'.++$count.''.$row['name'].''.$row['name'].''.$row['region'].' '.$row['division'].''.$row['won_matchups'].'/'.$row['matchups'].'
+
+ + ' + +?> + +