12005 Hwy 64
Eads, TN 38028 USA

Transactions History

[insert_php] $authUser = FALSE;

$yourId = wp_get_current_user()->user_login;
$allowed_users = array( “[email protected]”, “[email protected]”, “[email protected]”, “balajivalmiki”, “nkoka”, “[email protected]”);

if ( (is_user_logged_in() && current_user_can(‘administrator’) ) ||
(is_user_logged_in() && in_array($yourId, $allowed_users) )
)
$authUser = TRUE;

if($authUser == FALSE)
{
wp_redirect( site_url() ); exit;
}
[/insert_php] [insert_php]

$t = 14;

if (isset($_GET[‘t’]) && !empty($_GET[‘t’]))
$t = $_GET[‘t’];
if( $t > 120)
$t == 120;
if( $t < 1) $t == 14; [/insert_php] Last [insert_php] echo $t;[/insert_php] Days Transactions.

[insert_php]

global $wpdb;

$result = $wpdb->get_results ( ”

select DATE_FORMAT(receive_date, ‘%m/%d/%y’) as receive_date, first_name, last_name, name, total_amount, contribution_status_id, a.source
from civicrm_contribution a, civicrm_contact c, civicrm_financial_type f
where receive_date > NOW() – INTERVAL ” . $t . ” DAY and a.contact_id=c.id and a.financial_type_id=f.id
order by a.id desc
limit 200
” );

$grand_total_amount = 0;
$status = array(“”,”Complete“, “”, “Cancelled“, “Failed“);

foreach ( $result as $page )
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

$grand_total_amount += $page->total_amount;
}

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

[/insert_php]
Date Name Financial Type Amount Status Source
” . ($page->receive_date) . “ ” . ($page->first_name) . “, ” . ($page->last_name) . “ ” . str_replace(‘$’, ‘$ ‘, ($page->name)) . “ $ ” . number_format($page->total_amount) . “ ” . $status[$page->contribution_status_id] . “ ” . $page->source . “
Totals     $ ” . number_format( $grand_total_amount ) . “    

Facebook4k
YouTube2k
YouTube
WhatsApp