$so_system = new StatsOverall(array('domain' => 'System Totals')); $system_stats = load_overall_stats_system(); ?> <tbody> <?php foreach ($system_stats as $so) { $so_system->AddStats($so); _stats_overall_table_row($so, 'system-action-menu', true); } ?> </tbody> <tfoot> <?php _stats_overall_table_row($so_system, null, true); unset($system_stats); $so_total = new StatsOverall(array('domain' => 'Grand Total')); $so_total->AddStats($so_trades); $so_total->AddStats($so_system); _stats_overall_table_row($so_total, null, true); ?> </tfoot> </table> <!-- SYSTEM TRADE STATS END --> <!-- TOOLBAR START --> <div id="toolbar"> <div id="toolbar-content"> <div id="toolbar-icons"> <a href="_xTradesAddShow" class="dialog" title="Add Trade"><img src="images/add-32x32.png" border="0" /></a>
<input type="hidden" name="r" value="_xNetworkStatsShow"> </form> </div> <!-- SEARCH OPTIONS END --> <!-- NETWORK STATS START --> <table id="network-stats" class="item-table no-wrap" border="0" cellspacing="0" cellpadding="4" align="center" style="min-width: 1000px;"> <?php _stats_network_table_header(); ?> <tbody> <?php $all_cached = true; $so_total = new StatsOverall(array('domain' => 'Network Totals')); $db->AddFilter('owner', $_REQUEST['owner']); $db->AddFilter('category', $_REQUEST['category']); foreach ($db->RetrieveAll() as $site) { if (!$site['flag_stats']) { continue; } if (isset($cache[$site['domain']]) && $cache[$site['domain']]['timestamp'] >= time() - 300) { $so = $cache[$site['domain']]['so']; } else { $all_cached = false; $so = new StatsOverall($site); $so->SetUnknown(); } _stats_network_table_row($so, $site); $so_total->AddStats($so);
function _xNetworkStatsTotalGet() { require_once 'stats.php'; $so_total = new StatsOverall(array('domain' => 'Network Totals')); $cache = unserialize(file_get_contents(FILE_NETWORK_SITES_CACHE)); if (is_array($cache)) { foreach ($cache as $domain => $data) { $so_total->AddStats($data['so']); } } JSON::Success(array('response' => $so_total)); }