$_REQUEST['listInfo']['page_records'] = count($statsByReferer['hosts']); $gBitSmarty->assign_by_ref('listInfo', $_REQUEST['listInfo']); $gBitSmarty->assign('statsByReferer', $stats->getRevenueByReferer($_REQUEST)); $gBitSystem->display('bitpackage:bitcommerce/admin_revenue_referer.tpl', 'Revenue By Referer', array('display_mode' => 'admin')); } elseif (!empty($_REQUEST['timeframe'])) { $statsByType = $stats->getRevenueByType($_REQUEST); $gBitSmarty->assign_by_ref('statsByType', $statsByType); $statsByOption = $stats->getRevenueByOption($_REQUEST); foreach ($statsByOption as $stat) { @($statsByOptionTotalUnits[$stat['products_options_id']] += $stat['total_units']); } $gBitSmarty->assign('statsByOption', $statsByOption); $gBitSmarty->assign('statsByOptionTotalUnits', $statsByOptionTotalUnits); $gBitSmarty->assign('statsCustomers', $stats->getCustomerConversions($_REQUEST)); $gBitSmarty->assign('valuableInterests', $stats->getMostValuableInterests($_REQUEST)); $gBitSmarty->assign('valuableCustomers', $stats->getMostValuableCustomers($_REQUEST)); $gBitSystem->display('bitpackage:bitcommerce/admin_revenue_timeframe.tpl', 'Revenue By Timeframe', array('display_mode' => 'admin')); } else { $listHash['max_records'] = -1; $revStats = $stats->getAggregateRevenue($listHash); $gBitSmarty->assign('stats', $revStats); if (BitBase::getParameter($_REQUEST, 'display') == 'matrix') { switch (BitBase::getParameter($_REQUEST, 'period')) { case 'Y-': $headers = array(''); break; case 'Y-\\QQ': $headers = array('Q1', 'Q2', 'Q3', 'Q4'); break; case 'Y-m': $headers = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');