diff options
| author | Nathan Kinkade <nkinkade@creativecommons.org> | 2014-05-19 18:18:52 -0400 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@creativecommons.org> | 2014-05-19 18:18:52 -0400 |
| commit | fea92fb73fc066701a4e5e578edee7d737045a41 (patch) | |
| tree | 8475a74fb159756896e90a802eca32e2545ed86d /daily_run_report.php | |
| parent | 03a01ac31a16cf7f44e827db15b7483b0ec330cd (diff) | |
| parent | c1ea47789989b08e919645d8b8133cfea0ad97c9 (diff) | |
Diffstat (limited to 'daily_run_report.php')
| -rw-r--r-- | daily_run_report.php | 49 |
1 files changed, 49 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; + +?> |
