Skip to content
Snippets Groups Projects
Commit 9c6933a7 authored by Rembert Oldenboom's avatar Rembert Oldenboom
Browse files

Fix pager

parent 7ceb3cb6
No related branches found
No related tags found
No related merge requests found
......@@ -72,9 +72,7 @@ $fieldstosearchall = array(
'd.lastname'=>'Lastname',
'd.firstname'=>'Firstname',
);
/*
* View
*/
......@@ -115,6 +113,12 @@ if (trim($search_name) != '')
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->plimit($limit+1, $offset);
$resql = $db->query($sql);
......@@ -124,18 +128,18 @@ if ($resql)
$i = 0;
$param = '&statut='.$statut;
if ($page > 0) $param.= '&page='.$page;
//if ($page > 0) $param.= '&page='.$page;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($statut >= 0)
{
$donationstatic->statut=$statut;
$label=$donationstatic->getLibStatut(0);
print_barre_liste($label, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
}
else
{
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords);
}
......@@ -200,7 +204,7 @@ if ($resql)
$var=True;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($result);
$objp = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
$donationstatic->id=$objp->rowid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment