12005 Hwy 64
Eads, TN 38028 USA

Music Festival 2018

[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]

global $wpdb;

$query = ”
select
(select CONCAT( first_name , ‘ ‘ , last_name) from civicrm_contact c where b.contact_id = c.id) as Name,
(select email from civicrm_email e where b.contact_id = e.contact_id and e.is_primary=1) as Email,
(select phone from civicrm_phone p where b.contact_id = p.contact_id and p.is_primary=1) as Phone,
label as Event, DATE_FORMAT(receive_date, ‘%m/%d/%Y’) as Purchased, FORMAT(qty, 0) as Quantity, CONCAT(‘$’,FORMAT(unit_price, 0)) as UnitPrice, CONCAT(‘$’,FORMAT(line_total, 0)) as TotalPrice, line_total
from civicrm_line_item l, civicrm_contribution b
where l.financial_type_id=264 and b.id=l.contribution_id
order by Name, label
“;

//echo $query;
$_SESSION[“sponsors_query”] = $query;

$results = $wpdb->get_results( $query );

$cnt=1;
$grand_total_paid = 0;

foreach ( $results as $page )
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

$grand_total_paid += $page->line_total;

}

[/insert_php]
# Name Email/Phone Event Type Purchased Quantity Unit Price Total Price
” . ($cnt++) . “ ” . ($page->Name) . “ ” . $page->Email . “
” . $page->Phone . “
” . ($page->Event) . “ ” . ($page->Purchased) . “
” . ($page->Quantity) . “
” . str_replace(‘$’, ‘$ ‘, ($page->UnitPrice)) . “ ” . str_replace(‘$’, ‘$ ‘, ($page->TotalPrice)) . “
Total: $ [insert_php]echo number_format($grand_total_paid); [/insert_php]

Facebook4k
YouTube2k
YouTube
WhatsApp