KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.1KB

  1. <?php
  2. $PAGE_TITLE = "KXStudio : Donations";
  3. $PAGE_TYPE = "DONATIONS";
  4. $PAGE_SOURCE_1 = ARRAY("/Donations");
  5. $PAGE_SOURCE_2 = ARRAY("Donations");
  6. include_once("includes/header.php");
  7. require "donate/config.php";
  8. require "donate/connect.php";
  9. $biggest_donation_date = "Unknown";
  10. $biggest_donation_value = 0.0;
  11. $total_ever = 0.0;
  12. function print_donation_year($year) {
  13. if (! $db_link) {
  14. return;
  15. }
  16. $amount = 0.0;
  17. $max_month = 0.0;
  18. $total_year = 0.0;
  19. $sql_donations = mysql_query("SELECT * FROM donations WHERE YEAR(dt) = " . $year);
  20. if (mysql_num_rows($sql_donations)) {
  21. while ($sql_row = mysql_fetch_assoc($sql_donations)) {
  22. $amount = $sql_row["amount"]
  23. if ($amount > $max_month) {
  24. $max_month = $amount;
  25. if ($amount > $biggest_donation_value) {
  26. $biggest_donation_date = date("Y-m-d", strtotime($sql_row["dt"]));
  27. $biggest_donation_value = $amount;
  28. }
  29. }
  30. $total_year += $amount;
  31. }
  32. }
  33. $total_ever += $total_year;
  34. echo '<tr><td>' . $year . '</td><td>' . ($total_year/12.0) . '&euro;</td><td>' . $max_month . '&euro;</td></tr>';
  35. }
  36. ?>
  37. <p>
  38. KXStudio is and always be a free and open-source project to everyone.<br/>
  39. Donations will help ensure that developers have the needed enthusiasm and motivation to keep working hard on the project.<br/>
  40. Just because we're open-source doesn't mean we're allergic to money. ;)
  41. </p>
  42. <p>
  43. This page contain statistics regarding donations made to the KXStudio project over time.<br/>
  44. So far the KXStudio project has received <?php echo $total_ever; ?>&euro; in donations.<br/>
  45. The biggest donation ever made was on <?php echo $biggest_donation_date; ?>, with a value of <?php echo $biggest_donation_value; ?>&euro;.<br/>
  46. Thank you very much for your generosity!
  47. </p>
  48. <table>
  49. <tr><th>Year></th><th>Total</th><th>Average per month</th><th>Biggest single donation</th></tr>
  50. <?php
  51. for ($year = strftime("%Y"); $year >= "2014"; $year -= 1) {
  52. print_donation_year($year);
  53. }
  54. ?>
  55. </table>
  56. <p><br/></p>
  57. <?php
  58. include_once("includes/footer.php");
  59. ?>