summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2014-04-12 13:25:03 +0000
committerNathan Kinkade <nath@nkinka.de>2014-04-12 13:25:03 +0000
commitc1ea47789989b08e919645d8b8133cfea0ad97c9 (patch)
tree8475a74fb159756896e90a802eca32e2545ed86d
parenta670c3f81ff441271054336fa2c3eb25c08b6576 (diff)
Added a small PHP script to show how many cases were pulled in on a given day a certain times.
-rw-r--r--daily_run_report.php49
-rw-r--r--style.css3
2 files changed, 52 insertions, 0 deletions
diff --git a/daily_run_report.php b/daily_run_report.php
new file mode 100644
index 0000000..8cab7e9
--- /dev/null
+++ b/daily_run_report.php
@@ -0,0 +1,49 @@
+<?php
+
+echo <<<HTML
+<!DOCTYPE html>
+
+<html>
+<head>
+ <title>Miami-Dade Clerk of Courts: Daily run report</title>
+ <link rel='stylesheet' media='all' type='text/css' href='style.css' />
+</head>
+
+<body>
+
+<h3>MDCC daily run report</h3>
+HTML;
+
+$dbh = new PDO('mysql:host=localhost;dbname=mdcc', 'mdcc', 'Mdcc.');
+
+for ( $i=0; $i<7; $i++ ) {
+ $this_day = date("Y-m-d", strtotime("-{$i} days"));
+ $pretty_day = date("l, F j, Y", strtotime("-{$i} days"));
+ $sql_first_run = "SELECT count(court_case_no) AS cnt FROM cases WHERE DATE(date_entered) = '{$this_day}' AND TIME(date_entered) < '22:00:00'";
+ $sql_second_run = "SELECT count(court_case_no) AS cnt FROM cases WHERE DATE(date_entered) = '{$this_day}' AND TIME(date_entered) >= '22:00:00'";
+
+ $st_first_run = $dbh->prepare($sql_first_run);
+ if ( $st_first_run->execute() ) {
+ $first_run_count = $st_first_run->fetchColumn();
+ }
+ $st_second_run = $dbh->prepare($sql_second_run);
+ if ( $st_second_run->execute() ) {
+ $second_run_count = $st_second_run->fetchColumn();
+ }
+
+ echo <<<HTML
+<div class="pull">
+ <div>$pretty_day:</div>
+ <div class="pull_count">Noon pull: {$first_run_count}</div>
+ <div class="pull_count">6PM pull: {$second_run_count}</div>
+</div>
+HTML;
+
+}
+
+echo <<<HTML
+</body>
+</html>
+HTML;
+
+?>
diff --git a/style.css b/style.css
index ee8dd7a..323d302 100644
--- a/style.css
+++ b/style.css
@@ -82,3 +82,6 @@ label { vertical-align: top; }
#export a {
color: blue;
}
+
+.pull { margin-bottom: 2em; }
+.pull_count { margin-left: 1em; }