diff --git a/matchinfo.php b/matchinfo.php
index 7024885..02b4497 100644
--- a/matchinfo.php
+++ b/matchinfo.php
@@ -59,7 +59,7 @@ $lastMatches = array_slice($allMatches, 0, 8);
if (isset($_GET['matchid'])) {
$matchId = $_GET['matchid'];
$filename = "data/matches/" . $matchId . ".json";
-
+
// Check if the JSON file for the given match ID exists
if (file_exists($filename)) {
@@ -67,20 +67,7 @@ $lastMatches = array_slice($allMatches, 0, 8);
$jsonData = json_decode(file_get_contents($filename), true);
$matchinfo = $jsonData['data']['attributes'];
$matchdata = $jsonData['data'];
-
- $directory = 'data/killstats/';
- $prefix = $matchdata['id'];
- $files = glob($directory . $prefix . '*');
- foreach ($files as $file) {
- echo $file . "\n";
- }
- foreach($files as $file){
- $jsonData_individual_player = json_decode(file_get_contents($file), true);
- echo $jsonData_individual_player['stats']['humankills'];
- echo $jsonData_individual_player['stats']['kills'];
-
- }
echo "
| matchType | gameMode | duration | mapName | createdAt | id |
";
echo "";
@@ -94,6 +81,31 @@ $lastMatches = array_slice($allMatches, 0, 8);
echo "
";
+
+
+ echo "";
+ echo "
+ | Player Name |
+ Kills |
+ humankills |
+
+
";
+
+ $directory = 'data/killstats/';
+ $prefix = $matchdata['id'];
+ $files = glob($directory . $prefix . '*');
+
+
+ foreach ($files as $file) {
+ $jsonData_individual_player = json_decode(file_get_contents($file), true);
+ echo "";
+ echo "| " . htmlspecialchars($jsonData_individual_player['stats']['playername']) . " | ";
+ echo "" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . " | ";
+ echo "" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . " | ";
+ echo "
";
+ }
+ echo "
";
+
echo "";
echo "
| Player Name |
@@ -107,7 +119,6 @@ $lastMatches = array_slice($allMatches, 0, 8);
Headshot Kills |
Assists |
";
-
foreach ($jsonData['included'] as $includedItem) {
if ($includedItem['type'] == "participant") {
$playerStats = $includedItem['attributes']['stats'];