- //pageNow当前页 rowCount总记录数 pageSize 每页显示条数 //pageCount显示多少页
-
- if($pageNow>1){
- $prePage=$pageNow-1;
- echo "<a href='emplist.php?pageNow=$prePage'>上一页</a> ";
- }
- if($pageNow<$pageCount){
- $nextPage=$pageNow+1;
- echo "<a href='emplist.php?pageNow=$nextPage'>下一页</a> ";
- }
-
- $index=floor(($pageNow-1)/10)*10+1;
- $pre2Page = floor(($pageNow-10)/10)*10+1;
- if($pre2Page>0){
- echo "<a href='emplist.php?pageNow=$pre2Page'><<</a> ";
- }
-
- for($start=$index;$start<$index+10;$start++){
- if($start<=$pageCount){
- echo "<a href='emplist.php?pageNow=$start'>$start</a> ";
- }
- }
- if($start<=$pageCount){
- echo "<a href='emplist.php?pageNow=$start'>>></a> ";
- }
- echo "当前页{$pageNow}/共有{$pageCount}页";
|