<?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%"> </th> <th width="1%"> </th>
$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')));
$q = $session->database->createSelectQuery(); $q->select("COUNT(id)")->from("lh_faq"); $whereConditions = array(); $whereConditions[] = $q->expr->eq('active', 1); $whereConditions[] = $q->expr->lOr($q->expr->eq('url', $q->bindValue('')), $q->expr->eq('url', $q->bindValue(trim($matchStringURL))), $q->expr->lAnd($q->expr->eq('is_wildcard', $q->bindValue(1)), $q->expr->like($session->database->quote(trim($matchStringURL)), 'concat(left(url,length(url)-1),\'%\')'))); if ($identifier != '') { $whereConditions[] = $q->expr->eq('identifier', $q->bindValue($identifier)); } $q->where($whereConditions); $stmt = $q->prepare(); $stmt->execute(); $result = $stmt->fetchColumn(); $pages = new lhPaginator(); $pages->serverURL = erLhcoreClassDesign::baseurl('faq/faqwidget') . $dynamic_url_append; $pages->items_total = $result; $pages->setItemsPerPage(5); $pages->paginate(); $items = array(); if ($pages->items_total > 0) { $q = $session->createFindQuery('erLhcoreClassModelFaq'); $whereConditions = array(); $whereConditions[] = $q->expr->eq('active', 1); $whereConditions[] = $q->expr->lOr($q->expr->eq('url', $q->bindValue('')), $q->expr->eq('url', $q->bindValue(trim($matchStringURL))), $q->expr->lAnd($q->expr->eq('is_wildcard', $q->bindValue(1)), $q->expr->like($session->database->quote(trim($matchStringURL)), 'concat(left(url,length(url)-1),\'%\')'))); if ($identifier != '') { $whereConditions[] = $q->expr->eq('identifier', $q->bindValue($identifier)); } $q->where($whereConditions); $q->limit($pages->items_per_page, $pages->low); $q->orderBy('has_url DESC, id DESC'); // Questions with matched URL has higher priority $items = $session->find($q);
$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; }