Correction affichage des numeros de pages lorsque l'on est sur la dernière

This commit is contained in:
Michael RICOIS 2010-01-04 11:04:36 +00:00
parent bcafb8c509
commit 89966f292f

View File

@ -36,16 +36,30 @@ else
echo '<p class="StyleInfoLib">';
echo $O['nbReponsesTotal'].' r&eacute;ponses. avec les critères <a title="Retour au formulaire de recherche" href="./index.php?page=recherche&vue=annonce">'.$strCriteres.'</a>';
if ($O['nbReponses']<$O['nbReponsesTotal'])
$firephp->log($p+$O['nbReponses'], 'quantite');
$firephp->log($O['nbReponsesTotal'], 'nbReponsesTotal');
if ( $p+$O['nbReponses']<$O['nbReponsesTotal'] )
{
$totPage = ceil($O['nbReponsesTotal']/$O['nbReponses']);
$curPage = ceil($p/$O['nbReponses'])+1;
$firephp->info('Inferieur');
$totPage = ceil($O['nbReponsesTotal']/$_SESSION['tabInfo']['nbReponses']);
$curPage = ceil($p/$_SESSION['tabInfo']['nbReponses'])+1;
echo $_SESSION['tabInfo']['nbReponses'].' r&eacute;sultats affich&eacute;s.';
echo 'Page '.$curPage.'/'.$totPage.'.';
$prec = $p-$_SESSION['tabInfo']['nbReponses'];
$suiv = $p+$_SESSION['tabInfo']['nbReponses'];
} else {
}
elseif( $p+$O['nbReponses']==$O['nbReponsesTotal'] )
{
$firephp->info('egale');
$totPage = ceil($O['nbReponsesTotal']/$_SESSION['tabInfo']['nbReponses']);
$curPage = $totPage;
echo $_SESSION['tabInfo']['nbReponses'].' r&eacute;sultats affich&eacute;s.';
echo 'Page '.$curPage.'/'.$totPage.'.';
$prec = $p-$_SESSION['tabInfo']['nbReponses'];
$suiv = $p+$_SESSION['tabInfo']['nbReponses'];
}
else
{
$totPage = $curPage = 1;
}
echo '</p>';