@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | if (isset($r[0][1], $r[0][1]['class']) && |
32 | 32 | $r[0][1]['class'] === 'no-results' |
33 | 33 | ) { |
34 | - $trs .= '<tr><td'.self::attributes($r[0][1]).'>' |
|
35 | - .$r[0][0].'</td></tr>'; |
|
34 | + $trs .= '<tr><td' . self::attributes($r[0][1]) . '>' |
|
35 | + .$r[0][0] . '</td></tr>'; |
|
36 | 36 | } else { |
37 | - $trs .= '<tr><td>'.implode('</td><td>', $r) |
|
37 | + $trs .= '<tr><td>' . implode('</td><td>', $r) |
|
38 | 38 | .'</td></tr>'; |
39 | 39 | } |
40 | 40 | } |
@@ -49,16 +49,14 @@ discard block |
||
49 | 49 | $rows = [$header]; |
50 | 50 | |
51 | 51 | $data = self::$exportDataAsDisplayed ? |
52 | - self::$data : |
|
53 | - self::select(self::$t['q']); |
|
52 | + self::$data : self::select(self::$t['q']); |
|
54 | 53 | |
55 | 54 | if (count($data) > 0) { |
56 | 55 | foreach ($data as $row) { |
57 | 56 | $cells = []; |
58 | 57 | foreach ($columns as $column) { |
59 | 58 | $cells[] = is_array($row[$column]) ? |
60 | - $row[$column][0] : |
|
61 | - $row[$column]; |
|
59 | + $row[$column][0] : $row[$column]; |
|
62 | 60 | } |
63 | 61 | $rows[] = $cells; |
64 | 62 | } |
@@ -87,21 +85,20 @@ discard block |
||
87 | 85 | switch (self::$export) { |
88 | 86 | case 'Excel': |
89 | 87 | case 'CSV': |
90 | - $escape = function ($value) { |
|
88 | + $escape = function($value) { |
|
91 | 89 | return str_replace("\t", '	', $value); |
92 | 90 | }; |
93 | 91 | |
94 | 92 | if (($output = fopen('php://output', 'w'))) { |
95 | 93 | if (substr($filename, -2) !== '()') { //4 testing |
96 | 94 | header('Content-Type:application/csv'); |
97 | - header('Content-Disposition:attachment; filename='. |
|
98 | - $filename.'.csv'); |
|
95 | + header('Content-Disposition:attachment; filename=' . |
|
96 | + $filename . '.csv'); |
|
99 | 97 | } |
100 | 98 | foreach ($eData as $v) { |
101 | 99 | self::$export === 'CSV' ? |
102 | - fputcsv($output, $v) : |
|
103 | - fwrite($output, |
|
104 | - implode("\t", array_map($escape, $v))."\r\n"); |
|
100 | + fputcsv($output, $v) : fwrite($output, |
|
101 | + implode("\t", array_map($escape, $v)) . "\r\n"); |
|
105 | 102 | } |
106 | 103 | |
107 | 104 | return fclose($output); |
@@ -116,7 +113,7 @@ discard block |
||
116 | 113 | $fnReplace[':app'] = self::config('APP'); |
117 | 114 | $fnReplace[':items'] = self::$t['items']; |
118 | 115 | $format = str_replace(':', '.', '%d.%m.%Y %H:%i:%s'); |
119 | - $timeQuery = 'SELECT DATE_FORMAT(Now(), "'.$format.'") AS `now`;'; |
|
116 | + $timeQuery = 'SELECT DATE_FORMAT(Now(), "' . $format . '") AS `now`;'; |
|
120 | 117 | $fnReplace[':datetime'] = self::select($timeQuery); |
121 | 118 | |
122 | 119 | return strtr((string) self::config('EXPORT_FILE_NAME'), $fnReplace); |