diff --git a/DonationsStats.php b/DonationsStats.php index 00da480..474af45 100755 --- a/DonationsStats.php +++ b/DonationsStats.php @@ -8,6 +8,10 @@ include_once("includes/header.php"); require "donate/config.php"; require "donate/connect.php"; +global $biggest_donation_date; +global $biggest_donation_value; +global $total_ever; + $biggest_donation_date = "Unknown"; $biggest_donation_value = 0.0; $total_ever = 0.0; @@ -21,6 +25,10 @@ if ($db_link === false) { return; } +global $biggest_donation_date; +global $biggest_donation_value; +global $total_ever; + $amount = 0.0; $max_month = 0.0; @@ -50,14 +58,14 @@ $total_ever += $total_year; echo ''; echo ' ' . $year . ''; echo ' ' . $donation_count . ''; -echo ' ' . $total_year . '€'; +echo ' ' . number_format($total_year, 2) . '€'; if ($donation_count > 0.0) { - echo ' ' . ($total_year/$donation_count) . '€'; + echo ' ' . number_format($total_year/$donation_count, 2) . '€'; } else { echo ' 0€'; } -echo ' ' . ($total_year/12.0) . '€'; -echo ' ' . $max_month . '€'; +echo ' ' . number_format($total_year/12.0, 2) . '€'; +echo ' ' . number_format($max_month, 2) . '€'; echo ''; } @@ -72,8 +80,8 @@ echo '';

This page contain statistics regarding donations made to the KXStudio project over time.
- So far the KXStudio project has received € in donations.
- The biggest donation ever made was on , with a value of €.
+ So far the KXStudio project has received € in donations.
+ The biggest donation ever made was on , with a value of €.
Thank you very much for your generosity!

@@ -81,7 +89,7 @@ echo ''; - + @@ -89,7 +97,7 @@ echo ''; = "2014"; $year -= 1) { +for ($year = strftime("%Y"); $year >= "2012"; $year -= 1) { print_donation_year($year); }
 Year  Donations count  Donation count   Total received   Average per donation   Average per month