<?php
require_once('configPrint.inc'); 
require_once('config.inc'); 
require_once(CORE_PATH . 'langHeader.inc'); 
require_once('configDashboards.inc'); 
require_once(CORE_PATH . 'common.inc'); 
require_once(CORE_PATH . 'dateTime.inc'); 
require_once(LIB_PATH . 'Page.inc'); 
require_once(LIB_PATH . 'PrintOutput.inc'); 
require_once(LIB_PATH . 'Queries.inc'); 
$x_1 = kerio("webiface::PhpSession"); 
$x_1->getCsrf(&$x_s); 
$x_t = $_POST['x_u']; 
if ('' == $x_t && $x_t != $x_s) { 
$x_v = new x_w(); 
$x_v->x_x('window.top.location = "index.php";'); 
$x_v->x_y(); 
exit(); 
} 
$x_g = Array(); 
$x_g['periodStart'] = $_POST['x_k']; 
$x_g['periodEnd'] = $_POST['x_l']; 
$x_g['page'] = $_POST['x_h']; 
$x_g['protoId'] = intval($_POST['x_o']); 
$x_g['userId'] = $_POST['x_m']; 
$x_g['dateString'] = Array(); 
$x_32 = $x_33->x_34(); 
if ($x_g['periodStart'] != $x_g['periodEnd']) { 
$x_g['dateString']['period'] = kp_getDate($x_g['periodStart'], $x_32) 
. ' - ' 
. kp_getDate($x_g['periodEnd'], $x_32); 
} else { 
$x_g['dateString']['period'] = kp_getDate($x_g['periodStart'], $x_32); 
} 
$x_g['dateString']['generated'] = kp_getDate(kp_getDay(), $x_32); 
if ($x_g['page'] != '' && (in_array($x_g['page'], $x_f) || 'network' == $x_g['page'])) { 
$x_1 = kerio("webiface::PhpSession"); 
if ('network' == $x_g['page']) { 
$x_35 = Array('overall', 'traffic', 'sites', 'categories'); 
} else { 
$x_35 = Array($x_g['page']); 
} 
if ($x_g['page'] != 'activity') { 
$x_1w = ''; 
$x_36 = count($x_35) - 1; 
foreach ($x_35 as $x_1m => $x_37) { 
require_once(TEMPLATE_PATH . 'print_' . $x_37 . '.inc'); 
switch ($x_37) { 
case 'overall': 
$x_1w .= x_38($x_g); 
break; 
case 'traffic': 
$x_1w .= x_39($x_g); 
break; 
case 'sites': 
$x_1w .= x_3a($x_g); 
break; 
case 'categories': 
$x_1w .= x_3b($x_g); 
break; 
case 'individual': 
$x_1w .= x_3c($x_g); 
break; 
} 
if ($x_1m < $x_36) { 
$x_1w .= '<div class="pageBreak"></div>'; 
} 
} 
$x_3d = TITLE; 
$x_v = new x_w($x_3d); 
$x_v->x_31 = ' onLoad="window.print();"'; 
$x_v->x_a(Array(STYLE_PATH . 'print.css')); 
$x_v->x_1o($x_1w); 
$x_v->x_y(); 
} else { 
require_once(TEMPLATE_PATH . 'print_activity.inc'); 
$x_v = new x_w('<kerio:text id="usersActivity" />'); 
$x_v->x_a(Array(STYLE_PATH . 'print.css')); 
$x_v->x_x(' function x_3e() {


							try {


								eval (document.getElementById(\'x_3f\').innerHTML);


							} catch (e) {}


						}


						'); 
echo $x_v->x_3g(); 
echo '<body onLoad="x_3e(); setTimeout(\'window.print();\', 2000);">'; flush(); 
x_3h($x_g); flush(); 
echo $x_v->x_3i(); 
echo '</body>'; 
} 
} else { 
$x_v = new x_w(); 
$x_v->x_31 = ' onLoad="window.location = \'index.php\';"'; 
$x_v->x_y(); 
} 
?>
