@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function paging($records, $pageURL, $start = 0, $additional = '', $maxshown = 50, $numpagesshown = 11){ |
| 25 | 25 | if($records > $maxshown){ |
| 26 | - if($start >= 1){self::$current = $start;}else{self::$current = 1;} |
|
| 26 | + if($start >= 1){self::$current = $start;} else{self::$current = 1;} |
|
| 27 | 27 | self::$lastpage = ceil($records / $maxshown); |
| 28 | 28 | |
| 29 | 29 | if(!empty($additional)){$additional = 'search='.$additional.'&';} |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $paging.= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start - 1).'"><</a></li>'; |
| 36 | 36 | } |
| 37 | 37 | while(self::$page <= self::$lastpage){ |
| 38 | - if(self::$current == self::$page){$curselect = ' class="active"';}else{$curselect = '';} |
|
| 38 | + if(self::$current == self::$page){$curselect = ' class="active"';} else{$curselect = '';} |
|
| 39 | 39 | $paging.= '<li'.$curselect.'><a href="'.$pageURL.'?'.$additional.'page='.self::$page.'">'.self::$page.'</a></li>'; |
| 40 | 40 | self::$page = (self::$page + 1); |
| 41 | 41 | } |
@@ -58,14 +58,12 @@ discard block |
||
| 58 | 58 | protected static function getPage($records, $maxshown, $numpages){ |
| 59 | 59 | $show = floor($numpages / 2); |
| 60 | 60 | if(self::$lastpage > $numpages){ |
| 61 | - if(self::$current > $show){self::$page = self::$current - $show;}else{self::$page = 1;} |
|
| 61 | + if(self::$current > $show){self::$page = self::$current - $show;} else{self::$page = 1;} |
|
| 62 | 62 | |
| 63 | 63 | if(self::$current < (self::$lastpage - $show)){ |
| 64 | 64 | self::$lastpage = self::$current + $show; |
| 65 | 65 | if(self::$current <= $show){self::$lastpage = self::$current + ($numpages - self::$current);} |
| 66 | - } |
|
| 67 | - else{self::$page = self::$current - ($numpages - ((ceil($records / $maxshown) - self::$current)) - 1);} |
|
| 68 | - } |
|
| 69 | - else{self::$page = 1;} |
|
| 66 | + } else{self::$page = self::$current - ($numpages - ((ceil($records / $maxshown) - self::$current)) - 1);} |
|
| 67 | + } else{self::$page = 1;} |
|
| 70 | 68 | } |
| 71 | 69 | } |