16 lines
394 B
PHP
16 lines
394 B
PHP
|
<?php
|
||
|
|
||
|
function getCurrentPage($StartRow, $NUM_ROWS)
|
||
|
{
|
||
|
return ($StartRow / $NUM_ROWS + 1);
|
||
|
}
|
||
|
|
||
|
function getNbOfPage($nbOfHits, $NUM_ROWS, $MAX_ROWS)
|
||
|
{
|
||
|
//(min(intval(99 / 10), 200 / 10) = 9 donc 9 page de 10 resultats.
|
||
|
$page = min(intval($nbOfHits / $NUM_ROWS), $MAX_ROWS / $NUM_ROWS);
|
||
|
if (intval($nbOfHits / $NUM_ROWS) < $nbOfHits / $NUM_ROWS)
|
||
|
$page;
|
||
|
return ($page++);
|
||
|
}
|
||
|
?>
|