WHERE p.eid = {?} AND p2.eid IS NULL
GROUP BY p.uid', $evt['eid']);
- $ofs = Env::i('offset');
- $tot = (Env::v('initiale') ? $tot : $nb_tot);
- $nbp = ceil($tot / NB_PER_PAGE);
+ $ofs = Env::i('offset');
+ $tot = (is_null($evt['nb_tot']) ? $evt['nb'] : $evt['nb_tot']);
+ $nbp = ceil($tot / NB_PER_PAGE);
if ($nbp > 1) {
$links = array();
if ($ofs) {
for ($i = 1 ; $i <= $nbp; $i++) {
$links[(string)$i] = $i - 1;
}
- if ($ofs < $nbp) {
+ if ($ofs < $nbp - 1) {
$links['suivant'] = $ofs+1;
}
$page->assign('links', $links);
$page->assign('absents', $absents);
$page->assign('participants',
get_event_participants($evt, $item_id, UserFilter::sortByName(),
- new PLLimit(NB_PER_PAGE), $ofs * NB_PER_PAGE));
+ new PLLimit(NB_PER_PAGE, $ofs * NB_PER_PAGE)));
}
}