matchinfo
This commit is contained in:
parent
d87267f5cf
commit
d6a0ad0bc3
1 changed files with 43 additions and 38 deletions
|
|
@ -37,18 +37,7 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
||||||
<section>
|
<section>
|
||||||
<h2>Latest Matches</h2>
|
<h2>Latest Matches</h2>
|
||||||
|
|
||||||
<table class='sortable'>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<!-- <th>Match Date</th> -->
|
|
||||||
|
|
||||||
<th>Player Name</th>
|
|
||||||
<th>Kills</th>
|
|
||||||
<th>Damage Dealt</th>
|
|
||||||
<th>Time Survived</th>
|
|
||||||
<th>Rank</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -61,6 +50,22 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
// Read and decode the JSON file
|
// Read and decode the JSON file
|
||||||
$jsonData = json_decode(file_get_contents($filename), true);
|
$jsonData = json_decode(file_get_contents($filename), true);
|
||||||
|
$matchinfo = $jsonData['data']['attributes'];
|
||||||
|
$matchdata = $jsonData['data']
|
||||||
|
echo "<table class='sortable'><tr><th>matchType</th><th>duration</th><th>gameMode</th><th>mapName</th><th>createdAt</th><th>id</th></tr>";
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<td>" . htmlspecialchars($matchinfo['matchType']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($matchinfo['duration']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($matchinfo['gameMode']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($matchinfo['mapName']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($matchinfo['createdAt']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($$matchdata['id']) . "</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
|
||||||
|
echo "</table>";
|
||||||
|
|
||||||
|
|
||||||
|
echo "<table class='sortable'><tr><th>Player Name</th><th>Kills</th><th>Damage Dealt</th><th>Time Survived</th><th>Rank</th></tr>";
|
||||||
|
|
||||||
foreach ($jsonData['included'] as $includedItem) {
|
foreach ($jsonData['included'] as $includedItem) {
|
||||||
if ($includedItem['type'] == "participant") {
|
if ($includedItem['type'] == "participant") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue