$totalPageCount){ error_log("UtilitiesPagination::createPaginationBar - CurrentPageNum must be less than or equals to totalPageCount. CurrentPageNum:".$currentPageNum." , TotalPageCount:".$totalPageCount); return null; } if($totalPageCount>10){ if($currentPageNum>1){ $retVal .= " "; $retVal .= " "; } if($currentPageNum>6){ $retVal .= "1... "; } //calculate the starting page and starting offset $startingPageNum = $currentPageNum-5; if($startingPageNum<1){ $startingOffset = 1-$startingPageNum; $startingPageNum = 1; } else{ $startingOffset = 0; } //calculate the end page $endPageNum = $currentPageNum+$startingOffset+4; if($endPageNum>$totalPageCount){ $endOffset = $endPageNum - $totalPageCount; $endPageNum = $totalPageCount; $startingPageNum = $startingPageNum-$endOffset; if($startingPageNum<1) $startingPageNum = 1; } for ($pageNum=$startingPageNum; $pageNum<=$endPageNum; $pageNum++) { if ($pageNum == $currentPageNum) { $retVal .= "".$pageNum." "; } else { $retVal .= "".$pageNum." "; } } if(($currentPageNum+5)<=$totalPageCount){ $retVal .= "... ".$totalPageCount." "; } if($currentPageNum<$totalPageCount){ $retVal .= " "; $retVal .= " "; } } else{ for ($pageNum=1; $pageNum<=$totalPageCount; $pageNum++) { if ($pageNum == $currentPageNum) { $retVal .= "".$pageNum." "; } else { $retVal .= "".$pageNum." "; } } } return $retVal; } } ?> Tarife Karşılaştırma

Vodafone

Tarife Karşılaştırma