From f2885d69a3aafb74fdabc8c686d6b9fa213ebbe2 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 22 Nov 2023 15:59:39 +0100 Subject: [PATCH] stats --- latestmatches.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/latestmatches.php b/latestmatches.php index 5ee02ac..c9542ef 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -61,14 +61,15 @@ $ogDescription = "Dive into the detailed match stats of DTCH Clan in PUBG. Explo echo ""; echo ""; foreach ($players_matches as $match) { - if ($match['stats']['name'] == $selected_player) { + foreach($match['stats'] as $stats) + if ($stats['name'] === $selected_player) { - // if (isset($_GET['filter_by_match_type'])) { - // if ($_GET['filter_by_match_type'] !== 'all' && $match['matchType'] !== $_GET['filter_by_match_type']) { - // continue; - // } - // } + if (isset($_GET['filter_by_match_type'])) { + if ($_GET['filter_by_match_type'] !== 'all' && $match['matchType'] !== $_GET['filter_by_match_type']) { + continue; + } + } $date = new DateTime($match['createdAt']); $date->modify('+1 hours'); $formattedDate = $date->format('m-d H:i:s'); @@ -76,10 +77,10 @@ $ogDescription = "Dive into the detailed match stats of DTCH Clan in PUBG. Explo $matchType = $match['matchType']; $gameMode = $match['gameMode']; $mapName = isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']; - $kills = $match['stats']['kills']; - $damage = number_format($match['stats']['damageDealt'], 0, '.', ''); - $timeSurvived = $match['stats']['timeSurvived']; - $winPlace = $match['stats']['winPlace']; + $kills = $stats['kills']; + $damage = number_format($stats['damageDealt'], 0, '.', ''); + $timeSurvived = $stats['timeSurvived']; + $winPlace = $stats['winPlace']; echo "
Match DateGame ModeMatch TypeMapKillsDamage DealtTime Survivedwin Place
" . $formattedDate . " " . $gameMode . "