0 AND $swingd < 32))
$swingd = 6;
if( date('d') >= $swingd)
{
$query_Recordset1 = 'SELECT custom AS name, option_selection1 as showname, ';
$query_Recordset1 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
$query_Recordset1 .= 'CONCAT(\'£\',SUM(mc_gross)) AS amt ';
$query_Recordset1 .= ' FROM transactions'
. ' WHERE ( transactions.payment_date >= DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) '
. ' GROUP BY txn_id ORDER BY payment_date DESC';
} else
{
$query_Recordset1 = 'SELECT custom AS name, option_selection1 as showname, ';
// if( $tr_config['don_show_date'] )
$query_Recordset1 .= 'DATE_FORMAT( payment_date, \'%b-%e\' ) AS date, ';
// else
// $query_Recordset1 .= '\'\' AS date, ';
// if( $tr_config['don_show_amt'] )
$query_Recordset1 .= 'CONCAT(\'£\',SUM(mc_gross)) AS amt ';
// else
// $query_Recordset1 .= '\'\' AS amt ';
$query_Recordset1 .= ' FROM transactions'
. ' WHERE ( transactions.payment_date < DATE_FORMAT( NOW( ) , \'%Y-%m-' . $swingd . '\' ) ) AND transactions.payment_date > DATE_FORMAT( SUBDATE( NOW( ) , INTERVAL ' . $swingd . ' '
. ' DAY ) , \'%Y-%m-' . $swingd . '\' ) '
. ' GROUP BY txn_id ORDER BY payment_date DESC';
}
$Recordset1 = mysql_query($query_Recordset1, $ipnppd) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
// Insert the appropriate column headers
if( $tr_config[don_show_amt] )
$DON_AMT = "Amount";
else
$DON_AMT = "";
if( $tr_config[don_show_date] )
$DON_DATE = "Date";
else
$DON_DATE = "";
$ROWS_DONATORS = "";
// Fill out the donators table tag
while ($row_Recordset1 = mysql_fetch_assoc($Recordset1))
{
if( $row_Recordset1['amt'] > "£0" )
{
$ROWS_DONATORS .= "
";
$ROWS_DONATORS .= "| ";
if( strcmp($row_Recordset1['showname'],"Yes") == 0)
$ROWS_DONATORS .= $row_Recordset1['name'];
else
$ROWS_DONATORS .= "Anonymous";
$ROWS_DONATORS .= " | ";
$ROWS_DONATORS .= " ";
if( $tr_config[don_show_amt] )
$ROWS_DONATORS .= $row_Recordset1['amt'];
$ROWS_DONATORS .= " | ";
$ROWS_DONATORS .= " ";
if( $tr_config[don_show_date] )
$ROWS_DONATORS .= $row_Recordset1['date'];
$ROWS_DONATORS .= " | ";
$ROWS_DONATORS .= "
";
}
} ;
// Fill out some more template tags
$DON_BUTTON_SUBMIT = $tr_config[don_button_submit];
$DON_BUTTON_TOP = $tr_config[don_button_top];
$USERNAME = $username;
$PP_NO_SHIP = $tr_config[pp_get_addr] ? "0" : "1" ;
$PP_IMAGE_URL = $tr_config[pp_image_url];
$DON_TOP_IMG_DIMS = '';
if( is_numeric($tr_config[don_top_img_width]) )
$DON_TOP_IMG_DIMS .= "width=\"$tr_config[don_top_img_width]\" ";
if( is_numeric($tr_config[don_top_img_height]) )
$DON_TOP_IMG_DIMS .= "height=\"$tr_config[don_top_img_height]\" ";
$DON_SUB_IMG_DIMS = '';
if( is_numeric($tr_config[don_sub_img_width]) )
$DON_SUB_IMG_DIMS .= "width=\"$tr_config[don_sub_img_width]\" ";
if( is_numeric($tr_config[don_sub_img_height]) )
$DON_SUB_IMG_DIMS .= "height=\"$tr_config[don_sub_img_height]\" ";
$sql = $sql = "SELECT * FROM config WHERE name = 'don_text'";
$Recordset = mysql_query($sql, $ipnppd) or die(mysql_error());
$row = mysql_fetch_assoc($Recordset);
$DON_TEXT = $row[text];
$sql = "SELECT * from config WHERE name='don_amount' ORDER BY subtype";
$Recordset1 = mysql_query($sql, $ipnppd) or die(mysql_error());
$DONATION_AMOUNTS = "";
while ($row_Recordset1 = mysql_fetch_assoc($Recordset1))
{
if( is_numeric($row_Recordset1[value]) && $row_Recordset1[value] > 0 )
{
if( $row_Recordset1[subtype] == $tr_config[don_amt_checked] )
$checked = "checked";
else
$checked = "";
$DONATION_AMOUNTS .= ' £' . $row_Recordset1[value] . '
' . "\n";
}
}
// Ok, output the page
include("header.php");
OpenTable();
$tmpl_file = "modules/Donations/Donations.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
echo "
$dentry
";
CloseTable();
include("footer.php");
?>