echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only operators)'); ?> </td> <td><?php echo $totalMessagesCount - $systemMessagesCount - $totalVisitorsMessagesCount; ?> </td> </tr> </table> <h2><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Operators statistic, top 100 by chats number'); ?> </h2> <?php $operators = erLhcoreClassChatStatistic::getTopTodaysOperators(100, 0, $filter24); ?> <table class="table"> <thead> <tr> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'User'); ?> </td> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total chats'); ?> </td> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages');
<?php /** * This is optional if some extension AH decides to block usage of this module function completely * We don't do redirect here * */ $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.statistic', array()); $tpl = erLhcoreClassTemplate::getInstance('lhchat/statistic.tpl.php'); 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' => array())); } $tpl->set('input', $filterParams['input_form']); $tpl->setArray(array('userStats' => erLhcoreClassChatStatistic::getRatingByUser(30, $filterParams['filter']), 'countryStats' => erLhcoreClassChatStatistic::getTopChatsByCountry(30, $filterParams['filter']), 'userChatsStats' => erLhcoreClassChatStatistic::numberOfChatsDialogsByUser(30, $filterParams['filter']), 'userWaitTimeByOperator' => erLhcoreClassChatStatistic::avgWaitTimeyUser(30, $filterParams['filter']), 'numberOfChatsPerMonth' => erLhcoreClassChatStatistic::getNumberOfChatsPerMonth($filterParams['filter']), 'numberOfChatsPerWaitTimeMonth' => erLhcoreClassChatStatistic::getNumberOfChatsWaitTime($filterParams['filter']), 'numberOfChatsPerHour' => erLhcoreClassChatStatistic::getWorkLoadStatistic($filterParams['filter']), 'numberOfMsgByUser' => erLhcoreClassChatStatistic::numberOfMessagesByUser(30, $filterParams['filter']))); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Statistic')));
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') { if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'last24statistic', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'last24statistic', 'format_filter' => true, 'uparams' => array())); } if (empty($filterParams['filter'])) { $filter24 = array('filtergte' => array('time' => time() - 24 * 3600)); } else { $filter24 = $filterParams['filter']; } $tpl->set('input', $filterParams['input_form']); $tpl->set('filter24', $filter24);
</td> <td><?php echo $totalMessagesCount - $systemMessagesCount - $totalVisitorsMessagesCount; ?> </td> </tr> </table> </div> </div> <h2><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Operators last 24h statistic, top 100 by chats number'); ?> </h2> <?php $operators = erLhcoreClassChatStatistic::getTopTodaysOperators(100); ?> <table class="table"> <thead> <tr> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'User'); ?> </td> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total chats'); ?> </td> <td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages');