diff --git a/images/equal.png b/images/equal.png new file mode 100644 index 0000000..a8f5d5a Binary files /dev/null and b/images/equal.png differ diff --git a/images/green.png b/images/green.png new file mode 100644 index 0000000..82a0e62 Binary files /dev/null and b/images/green.png differ diff --git a/images/red.png b/images/red.png new file mode 100644 index 0000000..db6f650 Binary files /dev/null and b/images/red.png differ diff --git a/last_stats.php b/last_stats.php index 856928b..8458376 100644 --- a/last_stats.php +++ b/last_stats.php @@ -29,7 +29,7 @@ error_reporting(E_ALL); $players_matches = json_decode(file_get_contents('./data/player_last_stats.json'), true); foreach ($players_matches as $key => $player_datas) { - if ($key == 'updated') { + if ($key == 'updated') { continue; } echo "
"; @@ -45,6 +45,8 @@ error_reporting(E_ALL); Matches Wins Deaths + WinRatio change + "; foreach ($player_datas as $player_data) { @@ -77,6 +79,16 @@ error_reporting(E_ALL); : "0")); // or any other default string for non-numerical values $wins = number_format($player_data['wins'], 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 " @@ -89,6 +101,7 @@ error_reporting(E_ALL); $matches $wins $deaths + $change Change Indicator "; } @@ -97,9 +110,9 @@ error_reporting(E_ALL); } foreach ($players_matches as $key => $update) { - if ($key == 'updated'){ - echo "Last update: $update "; - + if ($key == 'updated') { + echo "Last update: $update "; + } }