Exemplo n.º 1
0
            $cash_admin->page_data['show_pagination'] = true;
            $cash_admin->page_data['show_next'] = true;
            if ($cash_admin->page_data['show_previous']) {
                $cash_admin->page_data['show_nextandprevious'] = true;
            }
            array_pop($all_order_details);
        }
        $cash_admin->page_data['orders_recent'] = new ArrayIterator($all_order_details);
        $cash_admin->page_data['show_filters'] = true;
    }
}
$user_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getuser', 'user_id' => $cash_admin->effective_user_id));
if (is_array($user_response['payload'])) {
    $current_userdata = $user_response['payload']['data'];
}
$session_news = AdminHelper::getActivity($current_userdata);
if ($session_news) {
    // now set up page variables
    $total_spend = 0;
    $orders_currency = 'USD';
    if (is_array($session_news['activity']['orders'])) {
        foreach ($session_news['activity']['orders'] as $order) {
            $order_contents = json_decode($order['order_contents']);
            if (is_array($order_contents)) {
                foreach ($order_contents as $item) {
                    $total_spend = $total_spend + $item->price;
                }
            }
            $orders_currency = $order['currency'];
        }
        $total_spend = round($total_spend);