Joomla pagination - click on footer doesn´t work
I´m using Joomla and want to use pagination at my backend. I added some
code and the footer in my view, but if I click onto the footer there
happens nothing. I dont get my fault there.
If I click on a the second page at the footer the link gets an hash behind.
Any Ideas how to fix that?
Controller: function display(){
$mainframe =& JFactory::getApplication();
$limit = $mainframe->getUserStateFromRequest('limit', 'limit',
$mainframe->getCfg('list_limit'), 'int' );
$limitstart = $mainframe->getUserStateFromRequest('limitstart',
'limitstart', 0, 'int' );
$jshopConfig = &JSFactory::getConfig();
$statistic = &$this->getModel("statistic_sells");
$total = $statistic->getCountAllStatistic();
jimport('joomla.html.pagination');
$pagination = new JPagination($total, $limitstart, $limit);
$rows =
$statistic->getAllStatisticOrderByAnzahl($pagination->limitstart,
$pagination->limit);
$view=&$this->getView("statistic_sells", 'html');
$view->assign('pagination', $pagination);
$view->assign('rows', $rows);
$view->display();
}
model:
function getAllStatisticOrderByAnzahl($limitstart=null, $limit=null) {
$db =& JFactory::getDBO();
$lang = &JSFactory::getLang();
if($limit > 0){
$limit = " LIMIT ".$limitstart." , ".$limit;
}else{
$limit = "";
}
$query = "SELECT pr.`name_de-DE` as produkt, pr.orders,
pr.min_price , pr.product_date_added, mf.`name_de-DE` as
hersteller
FROM #__jshopping_products pr
LEFT JOIN #__jshopping_manufacturers mf
ON pr.product_manufacturer_id = mf.manufacturer_id
ORDER BY orders DESC" . $limit;
$db->setQuery($query);
return $db->loadAssocList();
}
function getCountAllStatistic(){
$db =& JFactory::getDBO();
$lang = &JSFactory::getLang();
$query = "SELECT count(*) FROM #__jshopping_products";
$db->setQuery($query);
return $db->loadResult();
}
view:
<form action = "index.php?option=com_jshopping&controller=statistic_sells"
method = "post" name = "adminForm">
<table class = "adminlist">
<thead>
<tr>
<th class = "title" width = "10">#</th>
<th width = "200" align = "left">
<?php echo _JSHOP_STATISTIK_PRODUCT;?>
</th>
<th>
<?php echo _JSHOP_STATISTIK_PRODUCER;?>
</th>
<th align = "left">
<?php echo _JSHOP_STATISTIK_COUNT;?>
</th>
<th width = "80" align = "left">
<?php echo _JSHOP_STATISTIK_PRICE;?>
</th>
<th width = "80" align = "left">
<?php echo _JSHOP_STATISTIK_ADD_DATE;?>
</th>
</tr>
<?php foreach ($rows as $row){
?>
<tr class="row<?php echo $i % 2;?>">
<td>
<?php $i++;
echo $i;
?>
</td>
<td align="left">
<?php echo $row['produkt']?>
</td>
<td>
<?php echo $row['hersteller']?>
</td>
<td>
<?php echo $row['orders']?>
</td>
<td>
<?php echo $row['min_price'] . " "?>
</td>
<td>
<?php echo $row['product_date_added']?>
</td>
</tr>
<?php
}
?>
</thead>
<tfoot>
<tr>
<td colspan="18"><?php echo $pageNav->getListFooter();?></td>
</tr>
</tfoot>
</table>
<input type = "hidden" name = "task" value = "" />
<input type = "hidden" name = "hidemainmenu" value = "0" />
</form>
No comments:
Post a Comment