|
@@ -14,34 +14,46 @@ $total_ever = 0.0; |
|
|
|
|
|
|
|
|
function print_donation_year($year) { |
|
|
function print_donation_year($year) { |
|
|
|
|
|
|
|
|
if (! $db_link) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$amount = 0.0; |
|
|
$amount = 0.0; |
|
|
|
|
|
|
|
|
$max_month = 0.0; |
|
|
$max_month = 0.0; |
|
|
$total_year = 0.0; |
|
|
$total_year = 0.0; |
|
|
|
|
|
|
|
|
$sql_donations = mysql_query("SELECT * FROM donations WHERE YEAR(dt) = " . $year); |
|
|
|
|
|
|
|
|
|
|
|
if (mysql_num_rows($sql_donations)) { |
|
|
|
|
|
while ($sql_row = mysql_fetch_assoc($sql_donations)) { |
|
|
|
|
|
$amount = $sql_row["amount"] |
|
|
|
|
|
if ($amount > $max_month) { |
|
|
|
|
|
$max_month = $amount; |
|
|
|
|
|
if ($amount > $biggest_donation_value) { |
|
|
|
|
|
$biggest_donation_date = date("Y-m-d", strtotime($sql_row["dt"])); |
|
|
|
|
|
$biggest_donation_value = $amount; |
|
|
|
|
|
|
|
|
$donation_count = 0.0; |
|
|
|
|
|
|
|
|
|
|
|
if ($db_link) { |
|
|
|
|
|
$sql_donations = mysql_query("SELECT * FROM donations WHERE YEAR(dt) = " . $year); |
|
|
|
|
|
|
|
|
|
|
|
if (mysql_num_rows($sql_donations)) { |
|
|
|
|
|
while ($sql_row = mysql_fetch_assoc($sql_donations)) { |
|
|
|
|
|
$amount = $sql_row["amount"]; |
|
|
|
|
|
$donation_count += 1.0; |
|
|
|
|
|
if ($amount > $max_month) { |
|
|
|
|
|
$max_month = $amount; |
|
|
|
|
|
if ($amount > $biggest_donation_value) { |
|
|
|
|
|
$biggest_donation_date = date("Y-m-d", strtotime($sql_row["dt"])); |
|
|
|
|
|
$biggest_donation_value = $amount; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
$total_year += $amount; |
|
|
} |
|
|
} |
|
|
$total_year += $amount; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$total_ever += $total_year; |
|
|
$total_ever += $total_year; |
|
|
|
|
|
|
|
|
echo '<tr><td>' . $year . '</td><td>' . ($total_year/12.0) . '€</td><td>' . $max_month . '€</td></tr>'; |
|
|
|
|
|
|
|
|
echo '<tr>'; |
|
|
|
|
|
echo ' <td>' . $year . '</td>'; |
|
|
|
|
|
echo ' <td>' . $donation_count . '</td>'; |
|
|
|
|
|
echo ' <td>' . $total_year . '€</td>'; |
|
|
|
|
|
if ($donation_count > 0.0) { |
|
|
|
|
|
echo ' <td>' . ($total_year/$donation_count) . '€</td>'; |
|
|
|
|
|
} else { |
|
|
|
|
|
echo ' <td>0€</td>'; |
|
|
|
|
|
} |
|
|
|
|
|
echo ' <td>' . ($total_year/12.0) . '€</td>'; |
|
|
|
|
|
echo ' <td>' . $max_month . '€</td>'; |
|
|
|
|
|
echo '</tr>'; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -60,8 +72,16 @@ echo '<tr><td>' . $year . '</td><td>' . ($total_year/12.0) . '€</td><td>' . |
|
|
Thank you very much for your generosity! |
|
|
Thank you very much for your generosity! |
|
|
</p> |
|
|
</p> |
|
|
|
|
|
|
|
|
<table> |
|
|
|
|
|
<tr><th>Year></th><th>Total</th><th>Average per month</th><th>Biggest single donation</th></tr> |
|
|
|
|
|
|
|
|
<div class="box box-description"> |
|
|
|
|
|
<table style="text-align:center;"> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td> Year </td> |
|
|
|
|
|
<td> Donations count </td> |
|
|
|
|
|
<td> Total received </td> |
|
|
|
|
|
<td> Average per donation </td> |
|
|
|
|
|
<td> Average per month </td> |
|
|
|
|
|
<td> Biggest single donation </td> |
|
|
|
|
|
</tr> |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
for ($year = strftime("%Y"); $year >= "2014"; $year -= 1) { |
|
|
for ($year = strftime("%Y"); $year >= "2014"; $year -= 1) { |
|
@@ -70,6 +90,7 @@ for ($year = strftime("%Y"); $year >= "2014"; $year -= 1) { |
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
</table> |
|
|
</table> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<p><br/></p> |
|
|
<p><br/></p> |
|
|
|
|
|
|
|
|