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 "| Match Date | Game Mode | Match Type | Map | Kills | Damage Dealt | Time Survived | win Place |
";
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 "
| " . $formattedDate . " |
" . $gameMode . " |