stats
This commit is contained in:
parent
3a78be1ae4
commit
e275f2748c
1 changed files with 14 additions and 14 deletions
|
|
@ -17,9 +17,9 @@ if (isset($_GET['matchid'])) {
|
|||
echo "<tr><th>Player Name</th><th>Kills</th><th>Damage Dealt</th><th>Time Survived</th><th>Rank</th></tr>";
|
||||
|
||||
// Loop through the JSON data to extract player stats
|
||||
foreach ($jsonData['data']['relationships']['rosters']['data'] as $roster) {
|
||||
|
||||
foreach ($jsonData['included'] as $includedItem) {
|
||||
if ($includedItem['type'] === 'participant' && in_array(['type' => 'participant', 'id' => $includedItem['id']], $roster['relationships']['participants']['data'])) {
|
||||
|
||||
$playerStats = $includedItem['attributes']['stats'];
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($playerStats['name']) . "</td>";
|
||||
|
|
@ -28,9 +28,9 @@ if (isset($_GET['matchid'])) {
|
|||
echo "<td>" . htmlspecialchars($playerStats['timeSurvived']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($playerStats['winPlace']) . "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo "JSON file not found for the given match ID.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue