Exemplo n.º 1
0
function getItemsByKey($array, $key)
{
    $founded = false;
    if (isset($array[$key])) {
        return $array[$key];
    }
    foreach ($array as $sub_array) {
        $founded = @getItemsByKey($sub_array, $key);
        if ($founded) {
            return $founded;
        }
    }
    return False;
}
}
$page1 = !empty($_REQUEST['page']) ? preg_replace("/[^0-9]/", "", $_REQUEST['page']) : false;
/*

getAffilliateTransactionsTotal(
        $count=false, $page=false, $per_page=false,  $c_currency=false, $currency=false,
        $user=false,  $type=false, $order_by=false,   $order_desc=false,
        $public_api_all=false, $dont_paginate=false, $affiliates=false)
*/
// getAffiliatesTotal30Days($count=false,$paginated=false,$page=0,$results_per_page=30)
API::add('Affiliates', 'getAffiliatesTotal30Days', array(1, 1, $page1, 30));
$query = API::send();
$total = getItemsByKey($query, 'total');
API::add('Affiliates', 'getAffiliatesTotal30Days', array(0, 1, $page1, 30));
$query = API::send();
$transactions = current(getItemsByKey($query, 'results'));
$pagination = Content::pagination('affiliate_info.php', $page1, $total, 30, 5, false);
$currency_info = $currency1 ? $CFG->currencies[strtoupper($currency1)] : array();
if ($trans_realized1 > 0) {
    Messages::add(str_replace('[transactions]', $trans_realized1, Lang::string('transactions-done-message')));
}
$page_title = Lang::string('transactions');
if (!$bypass) {
    include 'includes/head.php';
    ?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
    echo Lang::string('title_my_subordinates');
    ?>
</h1></div>