From ae973621e97b8c20cb59fb19441087bffb8a7235 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Tue, 14 Nov 2023 21:45:06 +0100 Subject: [PATCH] table --- matchinfo.php | 78 +++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index f267698..8898567 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -37,47 +37,53 @@ $lastMatches = array_slice($allMatches, 0, 8);

Latest Matches

- - - - - - - - - - // Check if the JSON file for the given match ID exists - if (file_exists($filename)) { - // Read and decode the JSON file - $jsonData = json_decode(file_get_contents($filename), true); - - foreach ($jsonData['included'] as $includedItem) { - if ($includedItem['type'] == "participant") { - $playerStats = $includedItem['attributes']['stats']; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } + + + + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; } - - echo "
Player NameKillsDamage DealtTime SurvivedRank
" . htmlspecialchars($playerStats['name']) . "" . htmlspecialchars($playerStats['kills']) . "" . htmlspecialchars($playerStats['damageDealt']) . "" . htmlspecialchars($playerStats['timeSurvived']) . "" . htmlspecialchars($playerStats['winPlace']) . "
Player NameKillsDamage DealtTime SurvivedRank
" . htmlspecialchars($playerStats['name']) . "" . htmlspecialchars($playerStats['kills']) . "" . htmlspecialchars($playerStats['damageDealt']) . "" . htmlspecialchars($playerStats['timeSurvived']) . "" . htmlspecialchars($playerStats['winPlace']) . "
"; - } else { - echo "JSON file not found for the given match ID."; } + + echo ""; } else { - echo "No match ID provided."; + echo "JSON file not found for the given match ID."; } - ?> - + } else { + echo "No match ID provided."; + } + ?> +