@@ -17,28 +17,28 @@ discard block |
||
17 | 17 | * @return string Returns the pagination menu |
18 | 18 | */ |
19 | 19 | public static function paging($records, $pageURL, $start = 0, $additional = '', $maxshown = 50, $numpagesshown = 11) { |
20 | - if($records > $maxshown){ |
|
21 | - if ($start >= 1) {self::$current = $start;} else {self::$current = 1;} |
|
20 | + if ($records > $maxshown) { |
|
21 | + if ($start >= 1) {self::$current = $start; }else {self::$current = 1; } |
|
22 | 22 | self::$lastpage = ceil($records / $maxshown); |
23 | 23 | |
24 | - if (!empty($additional)) {$additional = 'search='.$additional.'&';} |
|
24 | + if (!empty($additional)) {$additional = 'search='.$additional.'&'; } |
|
25 | 25 | |
26 | 26 | self::getPage($records, $maxshown, $numpagesshown); |
27 | 27 | $paging = '<ul class="pagination">'; |
28 | 28 | if (self::$current != 1) { |
29 | - if (self::$current != 2) {$paging.= '<li><a href="'.$pageURL.'?'.$additional.'">«</a></li>';} |
|
30 | - $paging.= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start - 1).'"><</a></li>'; |
|
29 | + if (self::$current != 2) {$paging .= '<li><a href="'.$pageURL.'?'.$additional.'">«</a></li>'; } |
|
30 | + $paging .= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start - 1).'"><</a></li>'; |
|
31 | 31 | } |
32 | 32 | while (self::$page <= self::$lastpage) { |
33 | - if (self::$current == self::$page) {$curselect = ' class="active"';}else {$curselect = '';} |
|
34 | - $paging.= '<li'.$curselect.'><a href="'.$pageURL.'?'.$additional.'page='.self::$page.'">'.self::$page.'</a></li>'; |
|
33 | + if (self::$current == self::$page) {$curselect = ' class="active"'; }else {$curselect = ''; } |
|
34 | + $paging .= '<li'.$curselect.'><a href="'.$pageURL.'?'.$additional.'page='.self::$page.'">'.self::$page.'</a></li>'; |
|
35 | 35 | self::$page = (self::$page + 1); |
36 | 36 | } |
37 | - if(self::$current != self::$lastpage){ |
|
38 | - $paging.= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start + 1).'">></a></li>'; |
|
39 | - if (self::$current != (self::$lastpage - 1)) {$paging.= '<li><a href="'.$pageURL.'?'.$additional.'page='.ceil($records / $maxshown).'">»</a></li>';} |
|
37 | + if (self::$current != self::$lastpage) { |
|
38 | + $paging .= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start + 1).'">></a></li>'; |
|
39 | + if (self::$current != (self::$lastpage - 1)) {$paging .= '<li><a href="'.$pageURL.'?'.$additional.'page='.ceil($records / $maxshown).'">»</a></li>'; } |
|
40 | 40 | } |
41 | - $paging.= '</ul>'; |
|
41 | + $paging .= '</ul>'; |
|
42 | 42 | return $paging; |
43 | 43 | } |
44 | 44 | return false; |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | protected static function getPage($records, $maxshown, $numpages) { |
55 | 55 | $show = floor($numpages / 2); |
56 | 56 | if (self::$lastpage > $numpages) { |
57 | - if (self::$current > $show) {self::$page = self::$current - $show;}else{self::$page = 1;} |
|
57 | + if (self::$current > $show) {self::$page = self::$current - $show; }else {self::$page = 1; } |
|
58 | 58 | |
59 | 59 | if (self::$current < (self::$lastpage - $show)) { |
60 | 60 | self::$lastpage = self::$current + $show; |
61 | - if (self::$current <= $show) {self::$lastpage = self::$current + ($numpages - self::$current);} |
|
62 | - } else {self::$page = self::$current - ($numpages - ((ceil($records / $maxshown) - self::$current)) - 1);} |
|
63 | - } else {self::$page = 1;} |
|
61 | + if (self::$current <= $show) {self::$lastpage = self::$current + ($numpages - self::$current); } |
|
62 | + }else {self::$page = self::$current - ($numpages - ((ceil($records / $maxshown) - self::$current)) - 1); } |
|
63 | + }else {self::$page = 1; } |
|
64 | 64 | } |
65 | 65 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $paging.= '<li><a href="'.$pageURL.'?'.$additional.'page='.($start - 1).'"><</a></li>'; |
31 | 31 | } |
32 | 32 | while (self::$page <= self::$lastpage) { |
33 | - if (self::$current == self::$page) {$curselect = ' class="active"';}else {$curselect = '';} |
|
33 | + if (self::$current == self::$page) {$curselect = ' class="active"';} else {$curselect = '';} |
|
34 | 34 | $paging.= '<li'.$curselect.'><a href="'.$pageURL.'?'.$additional.'page='.self::$page.'">'.self::$page.'</a></li>'; |
35 | 35 | self::$page = (self::$page + 1); |
36 | 36 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | protected static function getPage($records, $maxshown, $numpages) { |
55 | 55 | $show = floor($numpages / 2); |
56 | 56 | if (self::$lastpage > $numpages) { |
57 | - if (self::$current > $show) {self::$page = self::$current - $show;}else{self::$page = 1;} |
|
57 | + if (self::$current > $show) {self::$page = self::$current - $show;} else{self::$page = 1;} |
|
58 | 58 | |
59 | 59 | if (self::$current < (self::$lastpage - $show)) { |
60 | 60 | self::$lastpage = self::$current + $show; |