Update fundraising dashboard and colourchange overdue thankyous

This commit is contained in:
james 2009-10-13 01:01:48 +00:00
parent f4829bfd9e
commit ebf6c0e79b

View File

@ -122,13 +122,15 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISC
<br />
<h3><?=i18n("To Do List")?></h3>
<h4>Thank You's</h4>
<h4><?=i18n("Thank You's")?></h4>
<?
$q=mysql_query("SELECT value, thanked, status, users_uid, sponsors_id, datereceived
$q=mysql_query("SELECT value, thanked, status, users_uid, 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'
AND fiscalyear='{$config['FISCALYEAR']}'
ORDER BY datereceived
");
//AND (users.year IS NULL OR users.year='{$config['FISCALYEAR']}')
echo mysql_error();
@ -141,15 +143,20 @@ if(mysql_num_rows($q)) {
echo "</tr>\n";
while($r=mysql_fetch_object($q)) {
/*
if($r->users_uid) {
$dq=mysql_query("SELECT CONCAT(firstname,' ',lastname) AS name FROM users WHERE uid='$r->users_uid' ORDER BY fairyear DESC LIMIT 1");
}
else if ($r->sponsors_id) {
*/
$dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
}
// }
$dr=mysql_fetch_object($dq);
echo "<tr>";
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 "<tr $s>";
echo " <td>$dr->name</td>";
echo " <td>".format_date($r->datereceived)."</td>";
echo " <td style=\"text-align: right;\">".format_money($r->value)."</td>";
@ -165,7 +172,7 @@ if(mysql_num_rows($q)) {
?>
<br />
<h4>Appeal Follow-Ups</h4>
<h4><?=i18n("Appeal Follow-Ups")?></h4>
<?
$q=mysql_query("SELECT * FROM fundraising_campaigns WHERE followupdate>=NOW() ORDER BY followupdate LIMIT 5");
echo mysql_error();