Пример #1
0
// create an instance of our incident manager
$incidentManager = new IncidentManager();
// get agency information using the shortname passed in by the user
$agency = $agencyManager->GetAgencyFromShortName($agencyshortname);
// get the last 25 incidents this agency has seen
$incidents = $incidentManager->GetIncidentsByAgencyID($agency->agencyid, 25);
// note: 25 here is the number of incidents to return
// do some decode if we haven't decoded the 4 letter code yet
//if( $agency->longname == "" )
//	$agency->longname = "- unknown -";
// get the current year
$year = date("Y");
// get todays date for later use
$todaysdate = date("Y-m-d");
// get the total number of calls for todays date
$todaystotalcalls = $incidentManager->GetIncidentCountByAgencyIDAndDate($agency->agencyid, $todaysdate);
// get the total number of calls for this year for this agency
//$totalcalls = $agencyManager->GetTotalIncidentsByAgencyID($agency->agencyid, $year);
echo '<A HREF="javascript:history.back()">< Back</a><br><br>';
echo '<h2>' . $agency->longname . '</h2>';
echo '<br><br>';
echo 'Calls for Today: <b>' . $todaystotalcalls . '</b><br>';
echo 'Calls for ' . $year . ': <b>' . $agency->callcount . '</b><br>';
echo 'Monroe County 911 Code: <b>' . $agency->shortname . '</b><br>';
echo 'Organization Name: <b>' . $agency->longname . '</b><br>';
echo 'Agency Website: <b><a href="' . $agency->websiteurl . '">' . $agency->websiteurl . '</a></b><br>';
echo '<br>';
echo '<br>';
echo "The last " . count($incidents) . " incidents for this agency:<br>";
// use the count in case less than 25 come back
echo '<div>';