Пример #1
0
<?php

$tpl = erLhcoreClassTemplate::getInstance('lhfile/list.tpl.php');
if (isset($_GET['doSearch'])) {
    $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
    $filterParams['is_search'] = true;
} else {
    $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
    $filterParams['is_search'] = false;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('file/list') . $append;
$pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], 'lh_chat_file');
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
    $items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC'), $filterParams['filter']), 'erLhcoreClassModelChatFile', 'lh_chat_file');
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('file/list');
$tpl->set('input', $filterParams['input_form']);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('file/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'List of files')));
Пример #2
0
        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);