Skip to content

Commit 0441277

Browse files
committed
Make the aColumns and having arrays easier to maintain
1 parent e692244 commit 0441277

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

Diff for: list-ajax.php

+40-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,47 @@
22

33
require('init.php');
44

5-
$aColumns = array( 'checksum', 'count', 'time', 'time_avg', 'disk_tmp_table', 'tmp_table', 'first_seen', 'last_seen', 'fingerprint', 'reviewed_on', 'reviewed_by', 'comments' );
5+
$aColumns = array();
66
// Controls if we use a HAVING clause vs a WHERE clause
7-
$having = array( false, true, true, true, true, true, false, false, false, false, false, false );
8-
7+
$having = array();
8+
9+
$aColumns[] = 'checksum';
10+
$having[] = false;
11+
12+
$aColumns[] = 'count';
13+
$having[] = true;
14+
15+
$aColumns[] = 'time';
16+
$having[] = true;
17+
18+
$aColumns[] = 'time_avg';
19+
$having[] = true;
20+
21+
$aColumns[] = 'disk_tmp_table';
22+
$having[] = true;
23+
24+
$aColumns[] = 'tmp_table';
25+
$having[] = true;
26+
27+
$aColumns[] = 'first_seen';
28+
$having[] = false;
29+
30+
$aColumns[] = 'last_seen';
31+
$having[] = false;
32+
33+
$aColumns[] = 'fingerprint';
34+
$having[] = false;
35+
36+
$aColumns[] = 'reviewed_on';
37+
$having[] = false;
38+
39+
$aColumns[] = 'reviewed_by';
40+
$having[] = false;
41+
42+
$aColumns[] = 'comments';
43+
$having[] = false;
44+
45+
946
$query = 'SELECT SQL_CALC_FOUND_ROWS ';
1047
$query .= ' review.checksum AS checksum,';
1148
$query .= ' review.fingerprint AS fingerprint,';

0 commit comments

Comments
 (0)