@@ -79,17 +79,21 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $actionURL = $this->getCurrentURL() . '?' ; |
| 81 | 81 | $QSList=array(); |
| 82 | - if ($caller != 'filter' && $this->curFilterQuery() != '') |
|
| 83 | - array_push($QSList , $this->curFilterQuery()); |
|
| 82 | + if ($caller != 'filter' && $this->curFilterQuery() != '') { |
|
| 83 | + array_push($QSList , $this->curFilterQuery()); |
|
| 84 | + } |
|
| 84 | 85 | |
| 85 | - if ($caller != 'paging' && $caller != 'filter' && $this->curPagingQuery() != '') |
|
| 86 | - array_push($QSList , $this->curPagingQuery()); |
|
| 86 | + if ($caller != 'paging' && $caller != 'filter' && $this->curPagingQuery() != '') { |
|
| 87 | + array_push($QSList , $this->curPagingQuery()); |
|
| 88 | + } |
|
| 87 | 89 | |
| 88 | - if ($caller != 'order' && $this->curOrderQuery() != '') |
|
| 89 | - array_push($QSList , $this->curOrderQuery()); |
|
| 90 | + if ($caller != 'order' && $this->curOrderQuery() != '') { |
|
| 91 | + array_push($QSList , $this->curOrderQuery()); |
|
| 92 | + } |
|
| 90 | 93 | |
| 91 | - if (count($QSList) != 0) |
|
| 92 | - $actionURL .= implode('&', $QSList); |
|
| 94 | + if (count($QSList) != 0) { |
|
| 95 | + $actionURL .= implode('&', $QSList); |
|
| 96 | + } |
|
| 93 | 97 | |
| 94 | 98 | return $actionURL; |
| 95 | 99 | } |
@@ -133,7 +137,9 @@ discard block |
||
| 133 | 137 | $filter=''; |
| 134 | 138 | foreach ($this->filterColumn as $column) |
| 135 | 139 | { |
| 136 | - if ($filter != "") $filter.=' OR '; |
|
| 140 | + if ($filter != "") { |
|
| 141 | + $filter.=' OR '; |
|
| 142 | + } |
|
| 137 | 143 | //$filter .= "'" . $column . "' LIKE '%" . $this->filterString. "%'"; |
| 138 | 144 | $filter .= $column . " LIKE '%" . $this->filterString. "%'"; |
| 139 | 145 | } |
@@ -176,7 +182,9 @@ discard block |
||
| 176 | 182 | |
| 177 | 183 | protected function curFilterQuery() |
| 178 | 184 | { |
| 179 | - if ($this->filterQuery == '') return ''; |
|
| 185 | + if ($this->filterQuery == '') { |
|
| 186 | + return ''; |
|
| 187 | + } |
|
| 180 | 188 | return 'f='.$this->filterQuery; |
| 181 | 189 | } |
| 182 | 190 | |
@@ -191,7 +199,9 @@ discard block |
||
| 191 | 199 | $orderSQL=''; |
| 192 | 200 | foreach ($this->order as $column => $direction) |
| 193 | 201 | { |
| 194 | - if ($orderSQL != "") $orderSQL.=','; |
|
| 202 | + if ($orderSQL != "") { |
|
| 203 | + $orderSQL.=','; |
|
| 204 | + } |
|
| 195 | 205 | |
| 196 | 206 | $orderSQL .= $column . ' ' . $direction; |
| 197 | 207 | } |
@@ -223,7 +233,9 @@ discard block |
||
| 223 | 233 | |
| 224 | 234 | protected function curOrderQuery() |
| 225 | 235 | { |
| 226 | - if ($this->orderQuery == '') return ''; |
|
| 236 | + if ($this->orderQuery == '') { |
|
| 237 | + return ''; |
|
| 238 | + } |
|
| 227 | 239 | return 'o='.$this->orderQuery; |
| 228 | 240 | } |
| 229 | 241 | |
@@ -261,7 +273,9 @@ discard block |
||
| 261 | 273 | |
| 262 | 274 | protected function curPagingQuery() |
| 263 | 275 | { |
| 264 | - if ($this->currentPage == '') return ''; |
|
| 276 | + if ($this->currentPage == '') { |
|
| 277 | + return ''; |
|
| 278 | + } |
|
| 265 | 279 | return 'page='.$this->currentPage; |
| 266 | 280 | } |
| 267 | 281 | |
@@ -273,10 +287,14 @@ discard block |
||
| 273 | 287 | return 'count : ' . $this->count() . '<br>'; |
| 274 | 288 | } |
| 275 | 289 | |
| 276 | - if ($this->currentPage == 0) $this->currentPage = 1; |
|
| 290 | + if ($this->currentPage == 0) { |
|
| 291 | + $this->currentPage = 1; |
|
| 292 | + } |
|
| 277 | 293 | |
| 278 | 294 | $numPages = intdiv($count , $this->maxPerPage); |
| 279 | - if ($count % $this->maxPerPage != 0 ) $numPages++; |
|
| 295 | + if ($count % $this->maxPerPage != 0 ) { |
|
| 296 | + $numPages++; |
|
| 297 | + } |
|
| 280 | 298 | |
| 281 | 299 | $html = '<div class="pagination-control" role="navigation">'; |
| 282 | 300 | $html .= '<ul class="nav tab-nav">'; |
@@ -290,8 +308,7 @@ discard block |
||
| 290 | 308 | </span> |
| 291 | 309 | </li> |
| 292 | 310 | '; |
| 293 | - } |
|
| 294 | - else |
|
| 311 | + } else |
|
| 295 | 312 | { |
| 296 | 313 | $html .= ' |
| 297 | 314 | <li class="nav-item"> |
@@ -307,7 +324,9 @@ discard block |
||
| 307 | 324 | $active = ($this->currentPage == $i) ? 'active' : ''; |
| 308 | 325 | $first = ($i-1)*$this->maxPerPage+1; |
| 309 | 326 | $last = $i * $this->maxPerPage; |
| 310 | - if ($last > $count) $last = $count; |
|
| 327 | + if ($last > $count) { |
|
| 328 | + $last = $count; |
|
| 329 | + } |
|
| 311 | 330 | $display = 'Show rows '. $first . ' to '. $last .' of '. $count; |
| 312 | 331 | $html .= '<li class="' . $active . ' nav-item"> |
| 313 | 332 | <a href="'. $this->getCurrentURLAndQS('paging') .'&page='. $i .'" title="' . $display . '" aria-label="' . $display . '"> |
@@ -326,8 +345,7 @@ discard block |
||
| 326 | 345 | </span> |
| 327 | 346 | </li> |
| 328 | 347 | '; |
| 329 | - } |
|
| 330 | - else |
|
| 348 | + } else |
|
| 331 | 349 | { |
| 332 | 350 | $html .= ' |
| 333 | 351 | <li class="nav-item"> |
@@ -369,20 +387,17 @@ discard block |
||
| 369 | 387 | if ($this->order[$titleOrder] == 'ASC') |
| 370 | 388 | { |
| 371 | 389 | $titleOrder.='DESC'; |
| 372 | - } |
|
| 373 | - else |
|
| 390 | + } else |
|
| 374 | 391 | { |
| 375 | 392 | $titleOrder.='ASC'; |
| 376 | 393 | } |
| 377 | - } |
|
| 378 | - else |
|
| 394 | + } else |
|
| 379 | 395 | { |
| 380 | 396 | $titleOrder.='ASC'; |
| 381 | 397 | } |
| 382 | 398 | $actionURL = $this->getCurrentURLAndQS('order').'o='.$titleOrder; |
| 383 | 399 | $html .= '<th><a href="'.$actionURL.'">' . $values . '</a></th>'; |
| 384 | - } |
|
| 385 | - else |
|
| 400 | + } else |
|
| 386 | 401 | { |
| 387 | 402 | $html .= '<th>' . $values . '</th>'; |
| 388 | 403 | } |