예제 #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')));
<?php

$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('user/account') . '/(tab)/canned';
$pages->items_total = erLhcoreClassModelCannedMsg::getCount(array('filter' => array('user_id' => $user->id)));
$pages->setItemsPerPage(10);
$pages->paginate();
$cannedMessages = array();
if ($pages->items_total > 0) {
    $cannedMessages = erLhcoreClassModelCannedMsg::getList(array('filter' => array('user_id' => $user->id), 'offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'));
}
?>

<table class="twelve" cellpadding="0" cellspacing="0">
<thead>
<tr>
    <th width="1%">ID</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Message');
?>
</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Delay');
?>
</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Position');
?>
</th>
    <th width="1%">&nbsp;</th>
    <th width="1%">&nbsp;</th>
예제 #3
0
        $tpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Please choose at least one valid module!')));
    }
}
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassModelInstanceInvoice::getCount(array('filter' => array('instance_id' => $instance->id)));
$pages->translationContext = 'instance/billing';
$pages->serverURL = erLhcoreClassDesign::baseurl('instance/billing');
$pages->setItemsPerPage(20);
$pages->paginate();
$tpl->set('pages', $pages);
$items = array();
if ($pages->items_total > 0) {
    $items = erLhcoreClassModelInstanceInvoice::getList(array('filter' => array('instance_id' => $instance->id), 'offset' => $pages->low, 'limit' => $pages->items_per_page));
}
$tpl->set('items', $items);
if ($instance->is_reseller) {
    $pagesInstances = new lhPaginator();
    $pagesInstances->items_total = erLhcoreClassModelInstance::getCount(array('switch_db' => true, 'filter' => array('reseller_id' => $instance->id)));
    $pagesInstances->translationContext = 'instance/billing';
    $pagesInstances->serverURL = erLhcoreClassDesign::baseurl('instance/billinginstance');
    $pagesInstances->setItemsPerPage(20);
    $pagesInstances->paginate();
    $tpl->set('pagesInstance', $pagesInstances);
    $items = array();
    if ($pagesInstances->items_total > 0) {
        $items = erLhcoreClassModelInstance::getList(array('switch_db' => true, 'filter' => array('reseller_id' => $instance->id), 'offset' => $pagesInstances->low, 'limit' => $pagesInstances->items_per_page));
    }
    $tpl->set('itemsInstance', $items);
}
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Billing')));
예제 #4
0
} else {
    $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
    $filterParams['is_search'] = false;
}
if ($Params['user_parameters_unordered']['print'] == 1) {
    $tpl = erLhcoreClassTemplate::getInstance('lhchat/printchats.tpl.php');
    $items = erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter']);
    $tpl->set('items', $items);
    $Result['content'] = $tpl->fetch();
    $Result['pagelayout'] = 'popup';
    return;
}
if ($Params['user_parameters_unordered']['xls'] == 1) {
    erLhcoreClassChatExport::chatListExportXLS(erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter']));
    exit;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassChat::getOperatorsChatsCount($filterParams['filter']);
$pages->translationContext = 'chat/closedchats';
$pages->serverURL = erLhcoreClassDesign::baseurl('chat/operatorschats') . $append;
$pages->paginate();
$tpl->set('pages', $pages);
if ($pages->items_total > 0) {
    $items = erLhcoreClassChat::getOperatorsChats($pages->items_per_page, $pages->low, $filterParams['filter']);
    $tpl->set('items', $items);
}
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('chat/operatorschats');
$tpl->set('input', $filterParams['input_form']);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('chat/lists'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/closedchats', 'Chats list')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/operatorschats', 'Operators chats')));
예제 #5
0
<?php

$hash = (string) $Params['user_parameters']['hash'];
$format = (string) $Params['user_parameters_unordered']['format'] == 'xml' ? 'xml' : 'json';
$hashSecret = erLhcoreClassModelChatConfig::fetch('export_hash')->current_value;
try {
    if (sha1('getlist' . $hashSecret) == $hash) {
        $filter = array();
        if (is_array($Params['user_parameters_unordered']['status'])) {
            foreach ($Params['user_parameters_unordered']['status'] as $status) {
                $filter['filterin']['status'][] = (int) $status;
            }
        }
        $totalChats = erLhcoreClassChat::getCount($filter);
        $pages = new lhPaginator();
        $pages->items_total = $totalChats;
        $pages->setItemsPerPage(is_numeric($Params['user_parameters_unordered']['limit']) ? (int) $Params['user_parameters_unordered']['limit'] : 100);
        $pages->paginate();
        $list = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC'), $filter));
        if ($format == 'json') {
            header('Content-type: application/json');
            echo json_encode(array('list' => array_keys($list)));
            exit;
        } else {
            header('Content-type: text/xml');
            echo '<?xml version="1.0" encoding="utf-8" ?><lhc>';
            foreach (array_keys($list) as $id) {
                echo "<item>{$id}</item>";
            }
            echo '</lhc>';
            exit;