--- a/documents/disclogsList.php +++ b/documents/disclogsList.php @@ -1,4 +1,5 @@ <?php + include('template.inc.php'); include_header_documents(""); include_once('../include/common.inc.php'); @@ -7,6 +8,11 @@ <tr><th>Agency Name</th><th>Disclosure Log URL recorded?</th><th>Do we monitor this URL?</th></tr>"; $agenciesdb = $server->get_db('disclosr-agencies'); $docsdb = $server->get_db('disclosr-documents'); +$agencies = 0; +$disclogs = 0; +$red = 0; +$green = 0; +$orange = 0; try { $rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows; @@ -14,24 +20,35 @@ if ($rows) { foreach ($rows as $row) { - echo "<tr><td><b>" . $row->value->name . "</b> (".$row->id.")</td>\n"; - - echo "<td>"; - if (isset($row->value->FOIDocumentsURL)) { - echo '<a href="viewDocument.php?hash='.md5($row->value->FOIDocumentsURL).'">' - .$row->value->FOIDocumentsURL.'</a>'; - } else { + echo "<tr><td><b>" . $row->value->name . "</b>"; + if ($ENV == "DEV") + echo "<br>(" . $row->id . ")"; + echo "</td>\n"; +$agencies++; + + echo "<td>"; + if (isset($row->value->FOIDocumentsURL)) { + $disclogs++; + echo '<a href="' . $row->value->FOIDocumentsURL . '">' + . $row->value->FOIDocumentsURL . '</a>'; + if ($ENV == "DEV") + echo '<br><small>(<a href="viewDocument.php?hash=' . md5($row->value->FOIDocumentsURL) . '">' + . 'view local copy</a>)</small>'; + } else { echo "<font color='red'>✘</font>"; } echo "</td>\n<td>"; if (isset($row->value->FOIDocumentsURL)) { - if (file_exists("./scrapers/".$row->id.'.py')) { - echo "<font color='green'>✔</font>"; - } else if (file_exists("./scrapers/".$row->id.'.txt')){ - echo "<font color='blue'><b>▬</b></font>"; - } else { - echo "<font color='red'>✘</font>"; - } + if (file_exists("./scrapers/" . $row->id . '.py')) { + echo "<font color='green'>✔</font>"; + $green++; + } else if (file_exists("./scrapers/" . $row->id . '.txt')) { + echo "<font color='orange'><b>▬</b></font>"; + $orange++; + } else { + echo "<font color='red'>✘</font>"; + $red++; + } } echo "</td></tr>\n"; } @@ -40,5 +57,8 @@ setteErrorHandler($e); } echo "</table>"; +echo $agencies." agencies ".(($disclogs/$agencies)*100)."% with disclosure logs, ".(($green/$disclogs)*100)."% with scrapers ".(($red/$disclogs)*100)."% without scrapers ".(($orange/$disclogs)*100)."% WIP scrapers "; + include_footer_documents(); ?> +