12005 Hwy 64
Eads, TN 38028 USA

2018 Revenue

[insert_php]

if ( !is_user_logged_in() && !current_user_can(‘administrator’) ){
wp_redirect( site_url() ); exit;
}

[/insert_php]

[insert_php] global $wpdb;

setlocale(LC_MONETARY, ‘en_US’);

$result = $wpdb->get_results ( ”

Select o.id, o.name, Sum(total_amount) as total_revenue
From civicrm_contribution c , civicrm_financial_type o
Where o.id = c.financial_type_id and contribution_status_id=1 and o.is_active=1 and YEAR(receive_date) = YEAR(CURDATE())
Group By o.id, o.name
Order by Sum(total_amount) desc

” );

$total_currentYear = 0;

foreach ( $result as $page )
{
echo “

“;
echo “

“;
echo “

“;

$total_currentYear += $page->total_revenue;
}
echo “

“;
echo “

“;
echo “

“;

[/insert_php]
Financial Type YTD Revenue Received
” . str_replace(‘$’, ‘$ ‘, ($page->name)) . “ $ ” . number_format($page->total_revenue) . “
Total $ ” . number_format($total_currentYear) . “