*/
function listar($item, $link = '', $caption = null, $summary = null, $cant = 15)
{
- if (!$summary) $summary = 'Listado de ' . get_class($item) . 's';
+ // Calculo posiciones
+ $total = $item->getTotal();
+ if (!$total)
+ {
+ echo error('No se encontraron ' . $item->getObjNamePl());
+ return;
+ }
+ $from = intval(@$_GET["lista_from"]);
+ $c = min($total - $from, $cant);
+ $item->seek($from);
+ if (is_null($summary)) $summary = 'Listado de ' . $item->getObjNamePl();
+ if (is_null($caption)) $caption = $summary;
printfl('<table border="1" summary="%s">', $summary);
if ($caption) printfl(' <caption>%s</caption>', $caption);
printfl(' <thead>');
printfl(' </tr>');
printfl(' </thead>');
printfl(' <tbody>');
- $total = $item->getTotal();
- $from = intval(@$_GET["lista_from"]);
- $c = min($total - $from, $cant);
- $item->seek($from);
while ($item->next() and $c--)
{
printfl(' <tr>');