commit
c38f36c651
1 changed files with 36 additions and 33 deletions
|
|
@ -80,53 +80,56 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
|||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
$directory = 'data/killstats/';
|
||||
$prefix = $matchdata['id'];
|
||||
$files = glob($directory . $prefix . '*');
|
||||
|
||||
if (count($files) == 0) {
|
||||
echo "No individual player data available (yet) check back in half hour.";
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
echo "<table class='sortable'>";
|
||||
echo "<tr>
|
||||
|
||||
echo "<table class='sortable'>";
|
||||
echo "<tr>
|
||||
<th>Player Name</th>
|
||||
<th>Kills</th>
|
||||
<th>humankills</th>
|
||||
<th>Kills</th>
|
||||
<th>Total Damage</th>
|
||||
<th>Rank</th>
|
||||
<th>DBNOs</th>
|
||||
</tr>";
|
||||
|
||||
$directory = 'data/killstats/';
|
||||
$prefix = $matchdata['id'];
|
||||
$files = glob($directory . $prefix . '*');
|
||||
foreach ($files as $file) {
|
||||
$jsonData_individual_player = json_decode(file_get_contents($file), true);
|
||||
$individualPlayerName = $jsonData_individual_player['stats']['playername'];
|
||||
|
||||
|
||||
foreach ($files as $file) {
|
||||
$jsonData_individual_player = json_decode(file_get_contents($file), true);
|
||||
$individualPlayerName = $jsonData_individual_player['stats']['playername'];
|
||||
|
||||
// Search for the player in $jsonData['included'] to find damageDealt
|
||||
$damageDealt = 0;
|
||||
foreach ($jsonData['included'] as $includedItem) {
|
||||
if ($includedItem['type'] == "participant") {
|
||||
$playerStats = $includedItem['attributes']['stats'];
|
||||
if ($individualPlayerName == $playerStats['name']) {
|
||||
$damageDealt = $playerStats['damageDealt'];
|
||||
$rank = $playerStats['winPlace'];
|
||||
$DBNOs = $playerStats['DBNOs'];
|
||||
break;
|
||||
// Search for the player in $jsonData['included'] to find damageDealt
|
||||
$damageDealt = 0;
|
||||
foreach ($jsonData['included'] as $includedItem) {
|
||||
if ($includedItem['type'] == "participant") {
|
||||
$playerStats = $includedItem['attributes']['stats'];
|
||||
if ($individualPlayerName == $playerStats['name']) {
|
||||
$damageDealt = $playerStats['damageDealt'];
|
||||
$rank = $playerStats['winPlace'];
|
||||
$DBNOs = $playerStats['DBNOs'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($individualPlayerName) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($damageDealt) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($rank) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($DBNOs) . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($individualPlayerName) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($damageDealt) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($rank) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($DBNOs) . "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo "<table class='sortable'>";
|
||||
echo "<tr>
|
||||
<th>Player Name</th>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue