“;
echo “The following individuals have been arrested by the Windsor Locks Police Department and are presumed innocent until proven
guilty in a court of law. Arrests are shown starting with the most recent.
“;
$recordstart = $_POST[‘recordstart’];
$first = $_POST[‘first’];
$totalrows = $_POST[‘totalrows’];
$pagesize = 10;
$pageend = $recordstart + $pagesize;
$today = date(‘Y-m-d H:i:s’);
if ($first!=’no’)
{
$recordstart = 0;
/*Query to count rows*/
include(“/home/windsorl/include/connection.inc”);
$sql = “SELECT arrest_id FROM arrests WHERE 1”;
$result = mysql_query($sql) or die (“MYSQL ERROR: Unable to execute query1.”);
$totalrows = mysql_num_rows($result);
}
if ($pageend > $totalrows)
{
$pageend = $totalrows;
}
$pagestart = $recordstart +1;
/*Query*/
include(“/home/windsorl/include/connection.inc”);
$sql = “SELECT * FROM arrests
WHERE 1 ORDER BY arrest_date DESC LIMIT $recordstart,$pagesize”;
$result = mysql_query($sql) or die (“MYSQL ERROR: Unable to execute query2.”);
echo “
Displaying ($pagestart – $pageend) of $totalrows Arrests
“;
if ($recordstart > 0)
{
$prev = $recordstart – $pagesize;
echo “
“;
}
if ($totalrows > ($recordstart + $pagesize))
{
$next = $recordstart + $pagesize;
echo “
“;
}
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
extract($row);
$modifiedDate = date(‘F d, Y’,strtotime($arrest_date));
$modifiedTime = date(‘H:i’, strtotime($arrest_time));
echo “
“;
echo “
Date of Arrest:
$modifiedDate at $modifiedTime
“;
echo “
Name:
$arrest_name Age: $arrest_age
“;
echo “
Address:
$arrest_address
“;
echo “
Charged with:
$arrest_charge1″;
if ($arrest_charge2)
{
print “, “;
echo $arrest_charge2;
}
if ($arrest_charge3)
{
print “, “;
echo $arrest_charge3;
}
if ($arrest_charge4)
{
print “, “;
echo $arrest_charge4;
}
echo “
“;
}
echo “
Displaying ($pagestart – $pageend) of $totalrows Arrests
“;
if ($recordstart > 0)
{
$prev = $recordstart – $pagesize;
echo “
“;
}
if ($totalrows > ($recordstart + $pagesize))
{
$next = $recordstart + $pagesize;
echo “
“;
}
?>

