$obj->toHTML();
}
}
- printfl('<table summary="Paginador" border="0"><tr>');
+
$pags = ceil($total / $cant);
if ($pags == 1) return;
- // Arrastro query string, si corresponde
+ printfl('<table summary="Paginador" border="0"><tr>');
+ // Arrastro query string, si corresponde
if ( isset($_SERVER['QUERY_STRING'] ) )
{
- $query = $_SERVER['QUERY_STRING'];
+ $query = str_replace('&', '&', $_SERVER['QUERY_STRING']);
}
else
{
$query = '';
}
- if (($pos = strpos($query, 'lista_from=')) !== false)
+ if (($pos = strpos($query, '&lista_from=')) !== false)
+ {
+ if ($pos) $query = substr($query, 0, $pos);
+ else $query = '';
+ }
+ if (($pos = strpos($query, 'lista_from=')) !== false)
{
- if ($pos) $query = substr($query, 0, --$pos);
+ if ($pos) $query = substr($query, 0, $pos );
else $query = '';
}
for ($i = 0; $i < $pags; ++$i)
{
- $from = $i * $cant;
- $q = $query ? "$query&lista_from=$from" : "lista_from=$from";
- printfl('<td><a href="%s?%s">%s</a></td>', $link, $q, $i + 1);
+ $from = $i * $cant;
+ $q = $query ? "$query&lista_from=$from" : "lista_from=$from";
+ printfl('<td><a href="%s?%s">%s</a></td>', $link, $q, $i + 1);
}
printfl('</tr></table>');
}