From 8faeea7f9ba158832e5b7f36fad1c00123359f42 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 27 Sep 2023 15:35:40 +0200 Subject: [PATCH 1/3] if isset --- latestmatches.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latestmatches.php b/latestmatches.php index a151365..b496740 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -50,7 +50,7 @@ error_reporting(E_ALL); ); // Display the player's match stats foreach ($players_matches as $player_data) { - if ($player_data['playername'] === $selected_player) { + if (isset($player_data['playername']) && $player_data['playername'] === $selected_player) { echo "

Recent Matches for $selected_player

"; echo ""; echo ""; From debbb454e18cdcec75dd31db3860f1f3386a9d36 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 27 Sep 2023 15:38:52 +0200 Subject: [PATCH 2/3] date format --- latestmatches.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latestmatches.php b/latestmatches.php index b496740..9a914c5 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -57,7 +57,7 @@ error_reporting(E_ALL); foreach ($player_data['player_matches'] as $match) { $date = new DateTime($match['createdAt']); $date->modify('+2 hours'); - $formattedDate = $date->format('d F Y, H:i:s'); + $formattedDate = $date->format('Y-m-d H:i:s'); $matchType = $match['matchType']; $gameMode = $match['gameMode']; From 382d57e8066b9bbaa73bed09fa9bc0ad47dbeb22 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 27 Sep 2023 15:40:43 +0200 Subject: [PATCH 3/3] foreachloop --- latestmatches.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/latestmatches.php b/latestmatches.php index 9a914c5..017ae48 100644 --- a/latestmatches.php +++ b/latestmatches.php @@ -29,9 +29,12 @@ error_reporting(E_ALL); // Display buttons for each player echo "
"; foreach ($players_matches as $player_data) { - $player_name = $player_data['playername']; - echo ""; + if (isset($player_data['playername'])) { + $player_name = $player_data['playername']; + echo ""; + } } + echo "
"; $selected_player = $_POST['selected_player'] ?? $players_matches[0]['playername'];
Match DateGame ModeMatchTypeMapKillsDamage DealtTime SurvivedwinPlace