commit
e2ed4e11c7
4 changed files with 17 additions and 4 deletions
BIN
images/equal.png
Normal file
BIN
images/equal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
images/green.png
Normal file
BIN
images/green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
images/red.png
Normal file
BIN
images/red.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
|
|
@ -29,7 +29,7 @@ error_reporting(E_ALL);
|
||||||
$players_matches = json_decode(file_get_contents('./data/player_last_stats.json'), true);
|
$players_matches = json_decode(file_get_contents('./data/player_last_stats.json'), true);
|
||||||
|
|
||||||
foreach ($players_matches as $key => $player_datas) {
|
foreach ($players_matches as $key => $player_datas) {
|
||||||
if ($key == 'updated') {
|
if ($key == 'updated') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
|
|
@ -45,6 +45,8 @@ error_reporting(E_ALL);
|
||||||
<th>Matches</th>
|
<th>Matches</th>
|
||||||
<th>Wins</th>
|
<th>Wins</th>
|
||||||
<th>Deaths</th>
|
<th>Deaths</th>
|
||||||
|
<th>WinRatio change</th>
|
||||||
|
|
||||||
|
|
||||||
</tr>";
|
</tr>";
|
||||||
foreach ($player_datas as $player_data) {
|
foreach ($player_datas as $player_data) {
|
||||||
|
|
@ -77,6 +79,16 @@ error_reporting(E_ALL);
|
||||||
: "0")); // or any other default string for non-numerical values
|
: "0")); // or any other default string for non-numerical values
|
||||||
$wins = number_format($player_data['wins'], 2, ',', '');
|
$wins = number_format($player_data['wins'], 2, ',', '');
|
||||||
$winratio = number_format($player_data['winratio'], 2, ',', '');
|
$winratio = number_format($player_data['winratio'], 2, ',', '');
|
||||||
|
$change = number_format($player_data['change'], 2, ',', '');
|
||||||
|
|
||||||
|
if ($change < 0) {
|
||||||
|
$imagePath = 'images\red.png';
|
||||||
|
} elseif ($change > 0) {
|
||||||
|
$imagePath = 'images\green.png';
|
||||||
|
} else {
|
||||||
|
$imagePath = 'images\equal.png';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
|
|
@ -89,6 +101,7 @@ error_reporting(E_ALL);
|
||||||
<td>$matches</td>
|
<td>$matches</td>
|
||||||
<td>$wins</td>
|
<td>$wins</td>
|
||||||
<td>$deaths</td>
|
<td>$deaths</td>
|
||||||
|
<td>$change <img src='$imagePath' alt='Change Indicator' style='vertical-align: right;' width='25' height='25'/> </td>
|
||||||
|
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
@ -97,9 +110,9 @@ error_reporting(E_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($players_matches as $key => $update) {
|
foreach ($players_matches as $key => $update) {
|
||||||
if ($key == 'updated'){
|
if ($key == 'updated') {
|
||||||
echo "Last update: $update ";
|
echo "Last update: $update ";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue