summaryrefslogtreecommitdiff
path: root/charges.php
blob: e0eb95d929f99cc62a1eac143e900536fb3d64a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

echo <<<HTML
<!DOCTYPE html>

<html>
<head>
	<title>Miami-Dade Clerk of Courts: Charges </title>
	<link rel='stylesheet' media='all' type='text/css' href='style.css' />
</head>
<body>
HTML;

$dbh = new PDO('mysql:host=localhost;dbname=mdcc', 'mdcc', 'Mdcc.');

echo <<<HTML
<table class="results_table">
	<tr class="tablehead">
		<th>ID</th>
		<th>Case ID</th>
		<th>Seq. No.</th>
		<th>Charge</th>
		<th>Charge Type</th>
		<th>Disposition</th>
	</tr>
HTML;

echo "<h3>Charges for case <a href='./search.php?case_id={$_REQUEST['case_id']}'><em>{$_GET['case_no']}</em></a></h3>";

$st = $dbh->prepare("SELECT * FROM charges WHERE case_id = '{$_GET['case_id']}'");
if ( $st->execute() ) {
	$alt = 'alt';
	while ( $row = $st->fetch(PDO::FETCH_ASSOC) ) {
		$alt = $alt ? '' : 'alt';
		echo "	<tr class='$alt'>\n";
		foreach ( $row as $field ) {
			echo "		<td>$field</td>\n";
		}
		echo "	</tr>\n";
	}
}

echo <<<HTML
</table>

</body>
</html>
HTML;

?>