Основная проблема в том что сайт на локале, и мы не обладая телепатическими знаниями не видим ни код ни как все выглядит (
По этому и помочь вам пока не увидим код вряд ли получится!
Попробую,
Модель
protected function getListQuery()
{
// Создаем новый query объект.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Выбераем поля.
$query->select('h.id, h.first_name, h.price, h.state, h.ordering');
// Из таблицы avto.
$query->from('tbl AS h');
// Из таблицы repair
$query->select('c.repair AS repair_title');
$query->leftJoin('tbl_rep AS c ON c.id = h.rep');
// Из таблицы estate_type
$query->select('x.name AS estate_title');
$query->leftJoin('tbl_estate AS x ON x.id = h.estate');
// Из таблицы district
$query->select('d.distr AS distr_title');
$query->leftJoin('tbl_distr AS d ON d.id = h.distr');
// Фильтруем по состоянию.
$published = $this->getState('filter.type');
if (is_numeric($published))
{
$query->where('h.estate = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(h.estate = 1 OR h.estate = 2 OR h.estate = 3 OR h.estate = 4 OR h.estate = 5 OR h.estate = 6 OR h.estate = 7 OR h.estate = 9 OR h.estate = 10 OR h.estate = 21 OR h.estate = 22 OR h.estate = 23 OR h.estate = 24)');
}
// Фильтруем по цене.
$maxprice = $this->getState('filter.maxprice');
$minprice = $this->getState('filter.minprice');
if (is_numeric($minprice))
{
$query->where('h.price >= ' . (int) $minprice);
}
if (is_numeric($maxprice))
{
$query->where('h.price <= ' . (int) $maxprice);
}
// Фильтруем по поиску в тексте сообщения.
$search = $this->getState('filter.search');
if (!empty($search))
{
$search = $db->quote('%' . $db->escape($search, true). '%', false);
$query->where('h.first_name LIKE ' . $search);
}
// Добавляем сортировку.
$orderCol = $this->state->get('list.ordering', 'h.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$query->order($db->escape($orderCol . ' ' . $orderDirn));
return $query;
}
/**
* Метод для авто-заполнения состояния модели.
*
* Заметка. Вызов метода getState в этом методе приведет к рекурсии.
*
* @return void
*/
protected function populateState($ordering = null, $direction = null)
{
// Получаем и устанавливаем значение фильтра состояния.
$published = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'string');
$this->setState('filter.type', $published);
$session = JFactory::getSession();
$session->set('filter.type', $published);
// Получаем и устанавливаем значение фильтра поиска по тексту сообщения.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$session->set('filter.search', $search);
// Получаем и устанавливаем значение фильтра поиска по цене.
$minprice = $this->getUserStateFromRequest($this->context . '.filter.minprice', 'filter_minprice');
$this->setState('filter.minprice', $minprice);
$session->set('filter.minprice', $minprice);
$maxprice = $this->getUserStateFromRequest($this->context . '.filter.maxprice', 'filter_maxprice');
$this->setState('filter.maxprice', $maxprice);
$session->set('filter.maxprice', $maxprice);
parent::populateState('h.id', 'desc');
}
это из шаблона вида default_body.php
// Данные по сортировке.
$listDirn = $this->escape($this->state->get('list.direction'));
$listOrder = $this->escape($this->state->get('list.ordering'));
$saveOrder = $listOrder == 'ordering';
foreach ($this->items as $i => $item) :
//$canEdit = JFactory::getUser()->authorise('core.edit', 'com_avto.message.' . $item->id);
//$canChange = JFactory::getUser()->authorise('core.edit.state', 'com_avto.message.' . $item->id);
?>
<tr class="row<?php //echo $i % 2; ?>">
<td>
<?php //echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td width="100%">
<div class="ad_box">
<?php
echo '<p><div><span>Имя:</span> '.$item->first_name.'</div><div><span>Ремонт:</span> '.$item->repair_title.'</div><div><span>Район:</span> '.$item->district_title.'</div><div><span>Тип:</span> '.$item->estate_type_title.'</div><div><span>Цена:</span> '.$item->price.'</div><div><a href="'.JRoute::_('index.php?option=com_avto&view=avto&id='.(int)$item->id).'">Подробнее...</a></div></p>';
?>
</div>
</td>
<td class="center">
<?php //echo $this->escape($item->category_title); ?>
</td>
<td class="center">
<?php //echo JHtml::_('jgrid.published', $item->state, $i, 'avtos.', $canChange); ?>
</td>
<td class="order">
<?php if ($saveOrder) : ?>
<?php if ($listDirn == 'asc') : ?>
<span><?php echo $this->pagination->orderUpIcon($i, true, 'avtos.orderup', 'JLIB_HTML_MOVE_UP', $saveOrder); ?></span>
<span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'avtos.orderdown', 'JLIB_HTML_MOVE_DOWN', $saveOrder); ?></span>
<?php elseif ($listDirn == 'desc') : ?>
<span><?php echo $this->pagination->orderUpIcon($i, true, 'avtos.orderdown', 'JLIB_HTML_MOVE_UP', $saveOrder); ?></span>
<span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'avtos.orderup', 'JLIB_HTML_MOVE_DOWN', $saveOrder); ?></span>
<?php endif; ?>
<?php endif; ?>
<?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
<!--<input type="text" name="order[]" size="5" value="<?php //echo $item->ordering; ?>" <?php //echo $disabled; ?> class="text-area-order" />-->
</td>
<td>
<?php //echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
И фильтры я попытался вынести в отдельный модуль, вот код шаблона
<?php
// Запрет прямого доступа.
defined('_JEXEC') or die;
// Загружаем тултипы.
JHtml::_('behavior.tooltip');
$options = array();
//$options[] = JHtml::_('select.checkbox', '0', 'Выберите район');
//JHTML::_( 'input.checkbox', $name, $label, $value );
$options[] = JHtml::_('select.option', '1', 'Комната');
$options[] = JHtml::_('select.option', '2', '1-ком квартира');
$options[] = JHtml::_('select.option', '3', '2-ком квартира');
$options[] = JHtml::_('select.option', '4', '3-ком квартира');
$options[] = JHtml::_('select.option', '5', '4-ком и более квартира');
$options[] = JHtml::_('select.option', '6', 'Гостинка');
$options[] = JHtml::_('select.option', '7', 'Малосемейка');
$options[] = JHtml::_('select.option', '9', 'Коммуналка');
$options[] = JHtml::_('select.option', '10', 'Общежитие');
$options[] = JHtml::_('select.option', '21', 'Частный дом');
$options[] = JHtml::_('select.option', '22', 'часть дома');
$options[] = JHtml::_('select.option', '23', 'Койко-место');
$options[] = JHtml::_('select.option', '24', 'Не определено');
?>
<form action="<?php echo JRoute::_('index.php?option=com_avto'); ?>" method="post" name="adminForm" id="adminForm">
<fieldset id="filter-bar">
<div class="filter-search fltlft">
<label class="filter-search-lbl" for="filter_search"><span><?php echo JText::_('Поиск:'); ?></span></label>
<input type="text" name="filter_search" id="filter_search" value="<?php $session = JFactory::getSession(); echo $session->get('filter.search'); ?>" title="<?php echo JText::_('COM_AVTO_FILTER_SEARCH_DESC'); ?>" />
<button type="submit" class="uk-button uk-button-primary"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button type="button" class="uk-button uk-button-primary" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<div class="filter-pricef fltlft">
<label class="filter-pricef-lbl" for="filter_maxprice"><span><?php echo JText::_('Фильтр по цене:'); ?></span></label>
<label><?php echo JText::_('От'); ?></label>
<input type="text" name="filter_minprice" id="filter_minprice" value="<?php $session = JFactory::getSession(); echo $session->get('filter.minprice'); ?>" title="<?php echo JText::_('COM_AVTO_FILTER_MIN_PRICE_DESC'); ?>" />
<label><?php echo JText::_('- До'); ?></label>
<input type="text" name="filter_maxprice" id="filter_maxprice" value="<?php $session = JFactory::getSession(); echo $session->get('filter.maxprice'); ?>" title="<?php echo JText::_('COM_AVTO_FILTER_MAX_PRICE_DESC'); ?>" />
<button type="submit" class="uk-button uk-button-primary"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button type="button" class="uk-button uk-button-primary" onclick="document.id('filter_minprice').value=''; document.id('filter_maxprice').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<div class="filter-select fltrt">
<select name="filter_type" class="inputbox" onchange="this.form.submit()">
<option value=""><?php echo JText::_('Фильтр');?></option>
<?php
echo JHtml::_('select.options', $options, 'value', 'text', $session->get('filter.type'), true);
?>
</select>
</div>
</fieldset>
<div class="clr"> </div>
<table class="adminlist">
<thead><?php// echo $this->loadTemplate('head');?></thead>
<tbody><?php// echo $this->loadTemplate('body');?></tbody>
<tfoot><?php// echo $this->loadTemplate('foot');?></tfoot>
</table>
<div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php //echo $this->escape($this->state->get('list.ordering')); ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php// echo $this->escape($this->state->get('list.direction')); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
И да я новичек, поэтому извините если что)))