Php google-style paging code
Public function showCtrlPanel_g ($ halfPer = 5 ){
$ Re = '<div class = "pageMore">
<Ul>
<Li> <span> '. $ this-> lineCount.' </span> </li>
<Li> <span> '. $ this-> currentPage.'/'. $ this-> pageCount.' page </span> </li> ';
If ($ this-> currentPage-$ halfPer> 1 ){
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = 1 "> <span> 1 </span> </a> </li> ';
If ($ this-> currentPage-$ halfPer * 2> 1 ){
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = '. ($ this-> currentPage-$ halfPer * 2 ). '"> <span>... </span> </a> </li> ';
} Else {
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = 1 "> <span>... </span> </a> </li> ';
}
}
For ($ I = $ this-> currentPage-$ halfPer, $ I> 1 | $ I = 1, $ j = $ this-> currentPage + $ halfPer, $ j <$ this-> pageCount | $ j = $ this-> pageCount; $ I <= $ j; $ I ++)
{
$ Re. = $ I ==$ this-> currentPage
? '<Li class = "linkOn"> <a href = "'. $ this-> fileName. 'pageno = '. $ I. '"> <span> '. $ I. '</span> </a> </li> '. ""
: '<Li> <a href = "'. $ this-> fileName. 'pageno = '. $ I. '"> <span> '. $ I. '</span> </a> </li> '. "";
}
If ($ this-> currentPage + $ halfPer <$ this-> pageCount ){
If ($ this-> currentPage + $ halfPer * 2 <$ this-> pageCount ){
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = '. ($ this-> currentPage + $ halfPer * 2 ). '"> <span>... </span> </a> </li> ';
} Else {
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = '. $ this-> pageCount. '"> <span>... </span> </a> </li> ';
}
$ Re. = '<li> <a href = "'. $ this-> fileName. 'pageno = '. $ this-> pageCount. '"> <span> '. $ this-> pageCount. '</span> </a> </li> ';
}
$ Re. ='
</Ul>
</Div> ';
Return $ re;
}