<?php

require_once "_header.php";
?>
	
	<?php 
//
// Sanity Check Inputs
//
require_once "./tools/UtilityManager.class.php";
$util = new UtilityManager();
$shortname = $_GET["agency"];
// check that the the short name is valid
if ($util->IsValidAgenyShortName($shortname) == False) {
    // not a valid short name
    echo '<script>';
    echo 'window.location = "./index.php"';
    echo '</script>';
}
?>


	<?php 
require_once "./tools/AgencyManager.class.php";
require_once "./tools/Agency.class.php";
require_once "./tools/IncidentManager.class.php";
require_once "./tools/Incident.class.php";
// get the agency we are viewing
$agencyshortname = $_GET['agency'];
// TODO: sanity check this
// create an instance of our agency manager object
<?php

require_once "_header.php";
?>

	<?php 
//
// Sanity Check Inputs
//
require_once "./tools/UtilityManager.class.php";
$eventtypeid = $_GET['eventtypeid'];
$util = new UtilityManager();
if ($util->IsNumber($eventtypeid) == False) {
    // not a valid number was passed in
    echo '<script>';
    echo 'window.location = "./index.php"';
    echo '</script>';
}
?>

	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<!--[if IE]><script src="js/excanvas.js"></script><![endif]-->
	<script src="js/html5-canvas-bar-graph.js"></script>
	
	<!-- Script for Bar Gragh, gets printed in HourlyTodayDiv -->
	<script>

		$(document).ready(function() {
		
			// function to create the canvas that we are going to draw the bar graph in
			function createCanvas(divName) {
Beispiel #3
0
// tell the client that it is a JSON object
header('content-type: application/json; charset=utf-8');
require_once "../tools/UtilityManager.class.php";
require_once "../tools/LocationManager.class.php";
if (isset($_GET['agency'])) {
    $agencyShortName = $_GET['agency'];
} else {
    $agencyShortName = "";
}
$date = $_GET["date"];
$typeid = "";
if (isset($_GET['year'])) {
    $typeid = $_GET["typeid"];
    if ($util->IsNumber($typeid) == false) {
        $typeid = "";
    }
}
// do some sanity checking
$util = new UtilityManager();
if ($date == "" || $util->IsValidDate($date) == 0 || $util->IsValidDate($date) == False) {
    // not a valid date, set to today's date
    $date = date("Y-m-d");
}
$mgr = new LocationManager();
if ($typeid == "") {
    $locations = $mgr->GetLocationsByDay($date, $agencyShortName);
    echo json_encode($locations);
} else {
    $locations = $mgr->GetLocationsByDayByType($date, $typeid);
    echo '{"typeid": "' . $typeid . '", "locations": ' . json_encode($locations) . '}';
}
Beispiel #4
0
<?php

require_once "_header.php";
?>

	<?php 
//
// Sanity Check Inputs
//
require_once "./tools/UtilityManager.class.php";
$util = new UtilityManager();
$eventtypeid = $_GET['eventtypeid'];
// check that the ID is valid
if ($util->IsNumber($eventtypeid) == False) {
    // not a valid number
    echo '<script>';
    echo 'window.location = "./index.php"';
    echo '</script>';
}
$date = $_GET["date"];
// check that the date is valid
if ($util->IsValidDate($date) == 0 || $util->IsValidDate($date) == False) {
    // not a valid date
    echo '<script>';
    echo 'window.location = "./index.php"';
    echo '</script>';
}
?>

	<center><h3>Hourly Data for <?php 
if ($_GET["date"] == "") {