diff options
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; + +?> |
