@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | $sortable = !isset($arg['sort']) || $arg['sort'] !== false; |
| 23 | 23 | |
| 24 | 24 | $sort = $sortable ? |
| 25 | - (isset($arg['sort']) ? $arg['sort'] : $col) : |
|
| 26 | - null; |
|
| 25 | + (isset($arg['sort']) ? $arg['sort'] : $col) : null; |
|
| 27 | 26 | |
| 28 | 27 | if (($del = isset($arg['type']) && $arg['type'] == 'delete')) { |
| 29 | 28 | $sortable = false; |
@@ -37,11 +36,10 @@ discard block |
||
| 37 | 36 | if (isset($arg['width'])) { // Width attribute -> style |
| 38 | 37 | $width = 'width:' . $arg['width'] . ';'; |
| 39 | 38 | $arg['style'] = isset($arg['style']) ? |
| 40 | - $width . $arg['style'] : |
|
| 41 | - $width; |
|
| 39 | + $width . $arg['style'] : $width; |
|
| 42 | 40 | } |
| 43 | 41 | |
| 44 | - $attr = array_diff_key((array) $arg, ['sort', 'type', 'width']); |
|
| 42 | + $attr = array_diff_key((array)$arg, ['sort', 'type', 'width']); |
|
| 45 | 43 | |
| 46 | 44 | /*$th = '<th' . self::attributes($attr) . '>'; |
| 47 | 45 | if ($sortable) { |
@@ -81,8 +79,7 @@ discard block |
||
| 81 | 79 | if (!$del) { |
| 82 | 80 | if ($sort == self::$t['order']['col']) { |
| 83 | 81 | $span = self::$t['order']['dir'] === 'desc' ? |
| 84 | - self::config('UTF8_DESC_SYMBOL') : |
|
| 85 | - self::config('UTF8_ASC_SYMBOL'); |
|
| 82 | + self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL'); |
|
| 86 | 83 | } else { |
| 87 | 84 | $span = ""; |
| 88 | 85 | } |
@@ -21,14 +21,13 @@ discard block |
||
| 21 | 21 | $q = 'SELECT COUNT(*) FROM (' . self::$t['qAll'] . ') AS dt'; |
| 22 | 22 | self::$t['rows'] = self::select($q); |
| 23 | 23 | } |
| 24 | - self::$t['pages'] = ceil(self::$t['rows'] / self::$t['paging']); |
|
| 24 | + self::$t['pages'] = ceil(self::$t['rows']/self::$t['paging']); |
|
| 25 | 25 | |
| 26 | 26 | $v = []; |
| 27 | 27 | |
| 28 | - $v['from'] = ($pageNo - 1) * self::$t['paging'] + 1; |
|
| 29 | - $v['upto'] = ($pageNo * self::$t['paging'] < self::$t['rows']) ? |
|
| 30 | - $pageNo * self::$t['paging'] : |
|
| 31 | - self::$t['rows']; |
|
| 28 | + $v['from'] = ($pageNo - 1)*self::$t['paging'] + 1; |
|
| 29 | + $v['upto'] = ($pageNo*self::$t['paging'] < self::$t['rows']) ? |
|
| 30 | + $pageNo*self::$t['paging'] : self::$t['rows']; |
|
| 32 | 31 | |
| 33 | 32 | $v["total"] = self::$t['rows']; |
| 34 | 33 | $v["items"] = self::$t['items']; |
@@ -57,8 +56,8 @@ discard block |
||
| 57 | 56 | $ftr = self::jsonTfoot()[0][0]; |
| 58 | 57 | $trs .= '<tr><td' . self::attributes($ftr[1]) . '>' |
| 59 | 58 | . $ftr[0] . '</td></tr>'; |
| 60 | - } else if(count(self::$errors)>0) { |
|
| 61 | - $trs .= '<tr><td colspan="'.count(self::$cols).'">' . |
|
| 59 | + } else if (count(self::$errors) > 0) { |
|
| 60 | + $trs .= '<tr><td colspan="' . count(self::$cols) . '">' . |
|
| 62 | 61 | self::err() . '</td></tr>'; |
| 63 | 62 | } |
| 64 | 63 | return $trs; |
@@ -70,9 +69,8 @@ discard block |
||
| 70 | 69 | $select = static::$select; |
| 71 | 70 | $res = $select($expression, $bindings); |
| 72 | 71 | //if result is single cell value ($res[0]->value), return the value |
| 73 | - return (count($res) === 1 && count((array) $res[0]) === 1) ? |
|
| 74 | - reset($res[0]) : |
|
| 75 | - $res; |
|
| 72 | + return (count($res) === 1 && count((array)$res[0]) === 1) ? |
|
| 73 | + reset($res[0]) : $res; |
|
| 76 | 74 | } else { |
| 77 | 75 | throw new Exception('ERROR: table::$select is not a closure. '); |
| 78 | 76 | } |