|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| - require('config.php'); |
4 |
| - |
5 |
| - $dbh = new PDO("mysql:host={$reviewhost['db_host']};dbname={$reviewhost['db_database']}", $reviewhost['db_user'], $reviewhost['db_password']); |
6 |
| - |
| 3 | + require('init.php'); |
| 4 | + |
7 | 5 | $list = $dbh->prepare('SELECT review.checksum AS checksum,
|
8 | 6 | SUBSTR(review.fingerprint, 1, 99999) AS sample,
|
9 |
| - |
| 7 | +
|
10 | 8 | DATE(review.first_seen) AS first_seen,
|
11 | 9 | DATE(review.last_seen) AS last_seen,
|
12 | 10 | IFNULL(review.reviewed_by, "-") AS reviewed_by,
|
13 | 11 | DATE(review.reviewed_on) AS reviewed_on,
|
14 | 12 | review.comments AS comments,
|
15 |
| - |
| 13 | +
|
16 | 14 | SUM(history.ts_cnt) AS count,
|
17 | 15 | ROUND(SUM(history.query_time_sum), 2) AS time,
|
18 | 16 | ROUND(SUM(history.query_time_sum)/SUM(history.ts_cnt), 2) AS time_avg
|
19 |
| - |
| 17 | +
|
20 | 18 | FROM '.$reviewhost['review_table'].' AS review
|
21 |
| - LEFT JOIN '.$reviewhost['review_history_table'].' AS history |
| 19 | + LEFT JOIN '.$reviewhost['history_table'].' AS history |
22 | 20 | ON history.checksum = review.checksum
|
23 | 21 | GROUP BY review.checksum
|
24 | 22 | ');
|
|
51 | 49 | echo "<td class='firstSeen date'>".$row['first_seen']."</td>";
|
52 | 50 | echo "<td class='lastSeen date'>".$row['last_seen']."</td>";
|
53 | 51 | echo "<td class='sample'>".$row['sample']."</td>";
|
54 |
| - |
| 52 | + |
55 | 53 | echo "<td class='reviewed_on'>".$row['reviewed_on']."</td>";
|
56 | 54 | echo "<td class='reviewed_by'>".$row['reviewed_by']."</td>";
|
57 | 55 | echo "<td class='comments'>".$row['comments']."</td>";
|
58 |
| - |
| 56 | + |
59 | 57 | echo '<td class="details"><a class="details" href="review.php?checksum='.$row['checksum'].'"><img src="images/details_open.png"></a></td>';
|
60 | 58 | echo "</tr>";
|
61 | 59 | }
|
|
79 | 77 |
|
80 | 78 | <script type="text/javascript">
|
81 | 79 | $(function() {
|
82 |
| - |
| 80 | + |
83 | 81 | oTable = $('#Queries').dataTable({
|
84 | 82 | "sDom": '"R<"H"rCp>t<"F"il>"',
|
85 | 83 | "bJQueryUI": true,
|
86 | 84 | "bStateSave": true,
|
87 | 85 | "bProcessing": false,
|
88 | 86 | "aaSort": [],
|
89 | 87 | "aoColumnDefs": [
|
90 |
| - { "bSearchable": false, "bVisible": true, "aTargets": [ 0 ] }, |
| 88 | + { "bSearchable": false, "bVisible": true, "aTargets": [ 0 ] }, |
91 | 89 | { "bSearchable": false, "bVisible": true, "aTargets": [ 1 ] },
|
92 |
| - { "bSearchable": false, "bVisible": true, "aTargets": [ 2 ] }, |
| 90 | + { "bSearchable": false, "bVisible": true, "aTargets": [ 2 ] }, |
93 | 91 | { "bSearchable": false, "bVisible": true, "aTargets": [ 3 ] },
|
94 |
| - { "bSearchable": false, "bVisible": true, "aTargets": [ 4 ] }, |
95 |
| - { "bSearchable": true, "bVisible": true, "aTargets": [ 5 ] }, |
| 92 | + { "bSearchable": false, "bVisible": true, "aTargets": [ 4 ] }, |
| 93 | + { "bSearchable": true, "bVisible": true, "aTargets": [ 5 ] }, |
96 | 94 | { "bSearchable": false, "bVisible": true, "aTargets": [ 6 ] },
|
97 | 95 | { "bSearchable": true, "bVisible": true, "aTargets": [ 7 ] },
|
98 | 96 | { "bSearchable": true, "bVisible": true, "aTargets": [ 8 ] },
|
99 |
| - { "bSearchable": false, "bVisible": true, "aTargets": [ 9 ], "bSortable": false }, |
| 97 | + { "bSearchable": false, "bVisible": true, "aTargets": [ 9 ], "bSortable": false }, |
100 | 98 | ],
|
101 | 99 | "oColVis": {
|
102 | 100 | "aiExclude": [ 9 ]
|
|
131 | 129 | null
|
132 | 130 | ]
|
133 | 131 | });
|
134 |
| - |
| 132 | + |
135 | 133 | if (oldVis.length == oTable.fnSettings().aoColumns.length)
|
136 | 134 | for (var i=0; i < oTable.fnSettings().aoColumns.length; i++)
|
137 | 135 | oTable.fnSetColumnVis(i, oldVis[i]);
|
|
0 commit comments