prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY system DESC,goal"); $q->execute(); echo ""; while($r=$q->fetch(PDO::FETCH_OBJ)) { echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if($r->type=="general") $orsql.="OR fundraising_type IS NULL"; $typetotal=0; $typeprobtotal=0; $sq=$pdo->prepare(" 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 "); $sq->execute(); echo $pdo->errorInfo(); while($sr=$sq->fetch(PDO::FETCH_OBJ)) { echo "id\" class=\"fundraising{$sr->status}\">"; echo ""; echo "\n"; echo ""; echo ""; echo ""; } else echo "\n"; $probval=$sr->probability/100*$sr->value; echo ""; echo "\n"; echo "\n"; $typeprobtotal+=$probval; $typetotal+=$sr->value; } echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; $typediff=$typeprobtotal-$r->goal; echo "\n"; echo "\n"; $totalgoal+=$r->goal; $totaldiff+=$typediff; echo "\n"; } echo ""; echo ""; echo "\n"; 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 "".i18n($r->name)."".format_money($r->budget)."
"; echo "id)\" border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\">"; echo "id&fundraising_type=$r->type')\">"; echo "$sr->name$sr->status"; if($sr->status=="pending") { echo "$sr->probability%"; echo "".format_money($sr->value)."".format_money($probval)."
type')\" href=\"#\">add".i18n("%1 Total",array($r->name),array("Fundraising type total, eg) Award Sponsorship Total"))."".format_money($typetotal)."".format_money($typeprobtotal)."".format_money($typediff)."
 
add fund type".i18n("Total Net Position")."".format_money($totaldiff)."
\n"; exit; }