";
- $q=mysql_query("SELECT * FROM fundraising_donations WHERE sponsors_id='$id' ORDER BY datereceived DESC");
- echo "FIXME: get the goal and campaign";
+ echo "
";
+ $q=mysql_query("SELECT fundraising_donations.*, fundraising_campaigns.name AS campaignname FROM fundraising_donations JOIN fundraising_campaigns ON fundraising_donations.fundraising_campaigns_id=fundraising_campaigns.id WHERE sponsors_id='$id' AND status='received' AND fundraising_donations.fiscalyear='{$config['fiscalyear']}' ORDER BY datereceived DESC");
+ echo mysql_Error();
+ if(mysql_num_rows($q)) {
echo "
";
echo "";
echo " ".i18n("Date")." | \n";
echo " ".i18n("Goal")." | \n";
- echo " ".i18n("Campaign")." | \n";
+ echo " ".i18n("Appeal")." | \n";
echo " ".i18n("Value")." | \n";
echo "
";
while($r=mysql_fetch_object($q)) {
echo "\n";
echo " ".format_date($r->datereceived)." | \n";
- echo " $r->fundraising_goal | ";
- echo " $r->fundraising_campaigns_id | ";
+ $goal=getGoal($r->fundraising_goal);
+ echo " $goal->name | ";
+ echo " $r->campaignname | ";
echo " ".format_money($r->value,false)." | ";
+ echo "
\n";
}
echo "
\n";
- echo "
\n";
+ }
+ else
+ echo i18n("No donations this year")."
";
+
+ echo "
".i18n("View full donation history")."";
+ echo "