예제 #1
0
$response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.statistic', array());
$tpl = erLhcoreClassTemplate::getInstance('lhstatistic/statistic.tpl.php');
$validTabs = array('active', 'total', 'last24', 'chatsstatistic');
$tab = isset($Params['user_parameters_unordered']['tab']) && in_array($Params['user_parameters_unordered']['tab'], $validTabs) ? $Params['user_parameters_unordered']['tab'] : 'active';
if ($tab == 'active') {
    if (isset($_GET['doSearch'])) {
        $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
    } else {
        $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
    }
    $tpl->set('input', $filterParams['input_form']);
    if (isset($_GET['xmlavguser'])) {
        erLhcoreClassChatStatistic::exportAverageOfChatsDialogsByUser(30, $filterParams['filter']);
        exit;
    }
    $tpl->setArray(array('userStats' => erLhcoreClassChatStatistic::getRatingByUser(30, $filterParams['filter']), 'countryStats' => erLhcoreClassChatStatistic::getTopChatsByCountry(30, $filterParams['filter']), 'userChatsStats' => erLhcoreClassChatStatistic::numberOfChatsDialogsByUser(30, $filterParams['filter']), 'userChatsAverageStats' => erLhcoreClassChatStatistic::averageOfChatsDialogsByUser(30, $filterParams['filter']), 'userWaitTimeByOperator' => erLhcoreClassChatStatistic::avgWaitTimeyUser(30, $filterParams['filter']), 'numberOfChatsPerMonth' => erLhcoreClassChatStatistic::getNumberOfChatsPerMonth($filterParams['filter']), 'numberOfChatsPerWaitTimeMonth' => erLhcoreClassChatStatistic::getNumberOfChatsWaitTime($filterParams['filter']), 'numberOfChatsPerHour' => erLhcoreClassChatStatistic::getWorkLoadStatistic($filterParams['filter']), 'averageChatTime' => erLhcoreClassChatStatistic::getAverageChatduration(30, $filterParams['filter']), 'numberOfMsgByUser' => erLhcoreClassChatStatistic::numberOfMessagesByUser(30, $filterParams['filter']), 'urlappend' => erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form'])));
} elseif ($tab == 'chatsstatistic') {
    if (isset($_GET['doSearch'])) {
        $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chatsstatistic_tab', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
    } else {
        $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chatsstatistic_tab', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
    }
    $tpl->set('input', $filterParams['input_form']);
    $tpl->set('groupby', $filterParams['input_form']->groupby == 1 ? 'Y.m.d' : 'Y.m');
    if ($filterParams['input_form']->groupby == 1) {
        $tpl->setArray(array('numberOfChatsPerMonth' => erLhcoreClassChatStatistic::getNumberOfChatsPerDay($filterParams['filter']), 'numberOfChatsPerWaitTimeMonth' => erLhcoreClassChatStatistic::getNumberOfChatsWaitTimePerDay($filterParams['filter']), 'urlappend' => erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form'])));
    } else {
        $tpl->setArray(array('numberOfChatsPerMonth' => erLhcoreClassChatStatistic::getNumberOfChatsPerMonth($filterParams['filter']), 'numberOfChatsPerWaitTimeMonth' => erLhcoreClassChatStatistic::getNumberOfChatsWaitTime($filterParams['filter']), 'urlappend' => erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form'])));
    }
} else {
    if ($tab == 'last24') {
예제 #2
0
foreach ($numberOfChatsPerHour as $hour => $chatsNumber) {
    ?>
				    	<?php 
    echo ',[\'' . $hour . '\',' . $chatsNumber . ']';
    ?>
				    <?php 
}
?>
				  ]);					                  		  
				  var view = new google.visualization.DataView(data);			                    
				  var options = {
					title: '<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Number of chats per hour, average chat duration');
?>
 <?php 
echo erLhcoreClassChat::formatSeconds(erLhcoreClassChatStatistic::getAverageChatduration());
?>
',
			        width: '100%',
			        height: '100%',
			        isStacked: true
				  };
				  var chartUp = new google.visualization.ColumnChart(document.getElementById('chart_div_per_hour'));
				  chartUp.draw(view, options);				  						  
			}
			
			$(window).on("resize", function (event) {
				redrawAllCharts(100);
			});
			$( document ).ready(function() {
				redrawAllCharts(100);