"; while($r=mysql_fetch_object($q)) { echo ""; echo "id')\" href=\"#\">"; if($r->system=="no") { //echo "id\">"; echo "id)\" border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\">"; // echo ""; } echo "\n"; echo "".i18n($r->name)."\n"; echo "".format_money($r->budget)."\n"; echo "\n"; if($r->type=="general") $orsql.="OR fundraising_type IS NULL"; $typetotal=0; $typeprobtotal=0; $sq=mysql_query(" SELECT fundraising_donations.id, sponsors.organization AS name, fundraising_donations.value, fundraising_donations.status, fundraising_donations.probability FROM fundraising_donations JOIN sponsors ON fundraising_donations.sponsors_id=sponsors.id WHERE (fundraising_donations.fundraising_goal='$r->goal' $orsql) AND fundraising_donations.fiscalyear='{$config['FISCALYEAR']}' UNION SELECT fundraising_donations.id, CONCAT(users.firstname,' ',users.lastname) AS name, fundraising_donations.value, fundraising_donations.status, fundraising_donations.probability FROM fundraising_donations JOIN users ON fundraising_donations.users_uid=users.uid WHERE (fundraising_donations.fundraising_goal='$r->goal' $orsql) AND fundraising_donations.fiscalyear='{$config['FISCALYEAR']}' ORDER BY status DESC, probability DESC, name "); echo mysql_error(); while($sr=mysql_fetch_object($sq)) { echo "id\" class=\"fundraising{$sr->status}\">"; echo ""; echo "id)\" border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\">"; echo ""; echo "id&fundraising_type=$r->type')\">"; echo "$sr->name\n"; echo "$sr->status"; echo ""; if($sr->status=="pending") { echo "$sr->probability%"; echo ""; echo "".format_money($sr->value).""; } else echo "\n"; $probval=$sr->probability/100*$sr->value; echo "".format_money($probval).""; echo "\n"; echo "\n"; $typeprobtotal+=$probval; $typetotal+=$sr->value; } echo ""; echo "type')\" href=\"#\">add"; echo "".i18n("%1 Total",array($r->name),array("Fundraising type total, eg) Award Sponsorship Total"))."\n"; echo "".format_money($typetotal)."\n"; echo "".format_money($typeprobtotal)."\n"; $typediff=$typeprobtotal-$r->goal; echo "".format_money($typediff)."\n"; echo "\n"; $totalgoal+=$r->goal; $totaldiff+=$typediff; echo " \n"; } echo ""; echo "add fund type"; echo "".i18n("Total Net Position")."".format_money($totaldiff)."\n"; echo "\n"; exit; }