<?php
require_once(LIB_PATH . 'Dashboard.inc'); 
function x_25($x_16f = 'html', $x_16g = 0, $x_3k = Array()) { 
global $_DB; 
global $x_33; 
define('TOP_CATEGORIES', 5); 
define('TOP_PROTOCOLS', 5); 
define('TOP_WEBSITES', 5); 
define('TOP_USERS', 5); 
$x_z = new x_10(); 
$x_z->x_23 = $x_3k['x_23']; 
$x_e2 = Array(); 
$x_8b = new x_8c(); 
$x_mq = false; 
if (1 == $x_16g || 'html' == $x_16f) { 
$x_mq = Array(); 
$x_mq = $x_8b->x_mv($x_3k['periodStart'], 
$x_3k['periodEnd']); 
$x_16t = $x_8b->x_nu($x_3k['periodStart'], 
$x_3k['periodEnd'], 
false, 
$x_33); 
$x_e2[1] = Array('x_6u' => x_6s($x_8b->x_mt($x_3k['periodStart'], $x_3k['periodEnd'])), 
'x_dw' => $x_16t, 
'x_dx' => $x_z->kp_getOverviewTable( 
Array( '<kerio:text id="lang_total" />', 
x_4p( 
x_4q($x_mq['dataTotal']), 
$x_33->x_4r()) 
. ' KB', 
'<kerio:text id="lang_inbound" />', 
x_4p( 
x_4q($x_mq['dataIn']), 
$x_33->x_4r()) 
. ' KB', 
'<kerio:text id="lang_outbound" />', 
x_4p( 
x_4q($x_mq['dataOut']), 
$x_33->x_4r()) 
. ' KB') 
) 
); 
} 
if (2 == $x_16g || 'html' == $x_16f) { 
$x_16u = $x_8b->x_lv($x_3k['periodStart'], 
$x_3k['periodEnd'], 
false, TOP_WEBSITES, $x_33); 
if (isset($x_16u['message'])) { 
$x_16u['message'] = $x_z->x_cj( $x_16u['message'], 
'overall', 
false, 
$x_33->x_34(), 
'<kerio:text id="websites_noData" /><br><kerio:text id="websites_periods"/>:'); 
} 
$x_e2[2] = Array('x_6u' => '<kerio:text id="topWebsites" />', 'x_dw' => $x_16u); 
} 
if (3 == $x_16g || 'html' == $x_16f) { 
$x_7d = Array(); 
$x_lr = Array(); 
$x_lr = $x_8b->x_n6( $x_3k['periodStart'], 
$x_3k['periodEnd'], 
TOP_CATEGORIES, 
false, 
$x_33); 
$x_7d = $x_8b->x_n1( $x_lr, 
TOP_CATEGORIES); 
$x_e2[3] = Array('x_6u' => '<kerio:text id="requestedCategories" />', 'x_dw' => $x_7d); 
} 
if (4 == $x_16g || 'html' == $x_16f) { 
$x_lr = Array(); 
$x_lr = $x_8b->x_nr($x_3k['periodStart'], 
$x_3k['periodEnd'], 
TOP_USERS, 
false, 
$x_33->x_4r()); 
$x_16w = x_66($x_lr['data'], 1, $x_33->x_4r()); 
if (!isset($x_mq['dataTotal'])) { 
$x_mq = Array(); 
$x_mq = $x_8b->x_mv($x_3k['periodStart'], 
$x_3k['periodEnd'], 
false, 
false, 
$x_33->x_4r()); 
} 
$x_16v = Array(); 
$x_16v = $x_8b->x_nq($x_lr, 
$x_mq['dataTotal'], 
TOP_USERS, 
$x_3k['periodStart'], 
$x_3k['periodEnd'], 
$x_33->x_4r()); 
$x_in = Array(); 
if (!empty($x_lr['links'])) { 
$x_7p = 0; 
$x_3u = Array(); 
foreach ($x_lr['links'] as $x_hu) { 
$x_3u['x_71'] = Array('x_72'=>'tp'); 
$x_3u['x_76'] = Array($x_hu['label'], 
'<b>' . x_4a('lang_total') . '</b>', 
$x_hu['dataTotal'] . ' KB', 
'<b>' . x_4a('lang_inbound') . '</b>', 
$x_hu['dataIn'] . ' KB', 
'<b>' . x_4a('lang_outbound') . '</b>', 
$x_hu['dataOut'] . ' KB'); 
$x_in[$x_7p]['label'] = $x_z->x_79($x_3u); 
$x_in[$x_7p]['link'] = 'x_6r(\'individual\', ' . $x_hu['userId'] . ')'; 
$x_7p++; 
} 
} 
$x_e2[4] = Array( 'x_6u' => '<kerio:text id="top" /> ' . TOP_USERS .' <kerio:text id="usersSmall" />', 
'x_dw' => $x_16v, 
'x_dx' => (!empty($x_16w) ? $x_z->kp_getListTable($x_16w, 
Array('<kerio:text id="lang_user" />', 
'<kerio:text id="lang_total" /> [KB]'), 
'', 
$x_in) 
: '') 
); 
} 
if (5 == $x_16g || 'html' == $x_16f) { 
$x_16v = Array(); 
$x_16v = $x_8b->x_mp( Array(), 
$x_mq, 
$x_3k['periodStart'], 
$x_3k['periodEnd'], 
TOP_PROTOCOLS, 
false, 
$x_33); 
$x_e2[5] = Array('x_6u' => '<kerio:text id="usedProtocols" />', 'x_dw' => $x_16v); 
} 
if ('html' == $x_16f) { 
$x_z->x_dv('L1'); 
foreach ($x_e2 as $x_kv => $x_7d) { 
$x_z->x_e0($x_kv, $x_7d); 
} 
$x_16k = $x_z->x_eb('overall') . $x_z->x_1u(); 
return $x_16k; 
} elseif('xml' == $x_16f) { 
$x_z->x_dv('L1'); 
$x_z->x_e0($x_16g, $x_e2[$x_16g]); 
return $x_z->x_e3($x_16g); 
} 
} 
?>
