This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?>

prepare("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY deadline"); $q->execute(); ?> fetch(PDO::FETCH_OBJ)) { //lookup all donations made towards this goal $recq=$pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_goal='$r->goal' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'"); $recq->execute(); echo $pdo->errorInfo(); $recr=$recq->fetch(PDO::FETCH_OBJ); $received=$recr->received; if($r->budget) $percent=round($received/$r->budget*100,1); else $percent=0; echo ""; echo ""; echo ""; $col=colour_to_percent($percent); echo ""; echo "\n"; } ?>
$r->name".format_money($r->budget,false)."".format_money($received,false)."{$percent}%".format_date($r->deadline)."

prepare("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}'"); $q->execute(); while($r=$q->fetch(PDO::FETCH_OBJ)) { $goalq=$pdo->prepare("SELECT * FROM fundraising_goals WHERE goal='{$r->fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'"); $goalq->execute(); $goalr=$goalq->fetch(PDO:FETCH_OBJ); $recq=$pdo->prepare("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'"); $recq->execute(); echo $pdo->errorInfo(); $recr=$recq->fetch(PDO::FETCH_OBJ); $received=$recr->received; if($r->target) $percent=round($received/$r->target*100,1); else $percent=0; $col=colour_to_percent($percent); echo "id'\">\n"; echo " \n"; echo " \n"; echo " \n"; echo " "; echo " \n"; echo " \n"; echo " \n"; echo " "; echo "\n"; } ?>
$r->name$r->type".format_date($r->startdate)."".format_date($r->enddate)."".format_money($r->target,false)."".format_money($received,false)."{$percent}%$goalr->name

prepare("SELECT id,value, thanked, status, sponsors_id, datereceived, DATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth, DATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth FROM fundraising_donations WHERE thanked='no' AND status='received' AND fiscalyear='{$config['FISCALYEAR']}' ORDER BY datereceived "); $q->execute(); echo $pdo->errorInfo(); if($q->rowCount()) { echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; while($r=$q->fetch(PDO::FETCH_OBJ)) { $dq=$pdo->prepare("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'"); $dq->execute(); $dr=$dq->fetch(PDO::FETCH_OBJ); if($r->twomonth) $s="style=\"background-color: ".colour_to_percent(0).";\""; else if($r->onemonth) $s="style=\"background-color: ".colour_to_percent(50).";\""; else $s=""; $u=getUserForSponsor($r->sponsors_id); echo ""; echo " "; echo " "; echo " "; echo " "; } else { echo i18n("No contact"); } echo "\n"; echo "\n"; } echo "
".i18n("Name")."".i18n("Date Received")."".i18n("Amount")."".i18n("Generate Thank You")."".i18n("Thanked")."
$dr->name".format_date($r->datereceived)."".format_money($r->value).""; if($u) { echo "".i18n("Generate Thank You")."id\" onclick=\"return thanked($r->id)\">
\n"; }else { echo i18n("No Thank You's pending"); echo "
\n"; } ?>

prepare("SELECT value, receiptrequired, receiptsent, status, sponsors_id, datereceived, DATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth, DATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth FROM fundraising_donations WHERE (receiptrequired='yes' AND receiptsent='no') AND status='received' AND fiscalyear='{$config['FISCALYEAR']}' ORDER BY datereceived "); $q->execute(); echo $pdo->errorInfo(); if($q->rowCount()) { echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; while($r=$q->fetch(PDO::FETCH_OBJ)) { $dq=$pdo->prepare("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'"); $dq->execute(); $dr=$dq->fetch(PDO::FETCH_OBJ); if($r->twomonth) $s="style=\"background-color: ".colour_to_percent(0).";\""; else if($r->onemonth) $s="style=\"background-color: ".colour_to_percent(50).";\""; else $s=""; echo ""; echo " "; echo " "; echo " "; echo " "; echo "\n"; } echo "
".i18n("Name")."".i18n("Date Received")."".i18n("Amount")."".i18n("Generate Receipt")."
$dr->name".format_date($r->datereceived)."".format_money($r->value).""; echo "".i18n("Generate Receipt")."
\n"; }else { echo i18n("No Receipts pending"); echo "
\n"; } ?>

prepare("SELECT * FROM fundraising_campaigns WHERE followupdate>=NOW() ORDER BY followupdate LIMIT 5"); $q->execute(); echo $pdo->errorInfo(); if($q->rowCount()) { echo ""; echo ""; echo " \n"; echo " \n"; echo " \n"; echo "\n"; while($r=$q->fetch(PDO::FETCH_OBJ)) { echo "\n"; } echo "
".i18n("Appeal")."".i18n("Start Date")."".i18n("Follow-Up Date")."
$r->name".format_date($r->startdate)."".format_date($r->followupdate)."
\n"; } else { echo i18n("No appeal follow-ups"); echo "
\n"; } ?>

Upcoming Proposals

prepare("SELECT * FROM sponsors WHERE fundingselectiondate>=NOW() OR proposalsubmissiondate>=NOW() ORDER BY fundingselectiondate LIMIT 5"); $q->execute(); echo $pdo->errorInfo(); if($q->rowCount()) { echo ""; echo ""; echo " \n"; echo " \n"; echo " \n"; echo "\n"; while($r=$q->fetch(PDO::FETCH_OBJ)) { echo ""; echo ""; echo ""; echo "\n"; } echo "
".i18n("Name")."".i18n("Proposal Submission Date")."".i18n("Funding Selection Date")."
$r->organization".format_date($r->proposalsubmissiondate)."".format_date($r->fundingselectiondate)."
\n"; } else { echo i18n("No proposals upcoming"); } exit; } else if (count($_POST['thanked'])) { foreach($_POST['thanked'] AS $t) { $stmt = $pdo->prepare("UPDATE fundraising_donations SET thanked='yes' WHERE id='$t'"); $stmt->execute(); } } send_header("Fundraising", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Fundraising' => 'admin/fundraising.php'), "fundraising" ); ?>