Fix myway_timeliness_route
--- /dev/null
+++ b/.gitmodules
@@ -1,1 +1,4 @@
+[submodule "lib/amon-php"]
+ path = lib/amon-php
+ url = https://github.com/martinrusev/amon-php.git
--- a/about.php
+++ b/about.php
@@ -20,8 +20,8 @@
<p>
Busness Time - An ACT bus timetable webapp<br />
Based on the maxious-canberra-transit-feed (<a
- href="http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip">download</a>,
- last updated <?php echo date("F d Y.", @filemtime('cbrfeed.zip')); ?>)<br />
+ href="http://busresources.lambdacomplex.org/cbrfeed.zip">download</a>,
+ last updated <?php echo date("F d Y.", @filemtime('../busresources/cbrfeed.zip')); ?>)<br />
Source code for the <a
href="https://github.com/maxious/ACTBus-data">transit
feed</a> and <a href="https://github.com/maxious/ACTBus-ui">this
--- a/feedback.php
+++ b/feedback.php
@@ -67,7 +67,7 @@
echo "\nServer host/IP: ".php_uname("n");
echo "\nCurrent date/time: ". date("c");
echo "\nCurrent code revision: ".exec("git rev-parse --short HEAD");
- echo "\nCurrent timetables version: ".date("c",@filemtime('cbrfeed.zip'));
+ echo "\nCurrent timetables version: ".date("c",@filemtime('../busresources/cbrfeed.zip'));
echo "\nDump of session: ".print_r($_SESSION,true);
?>
</textarea>
--- a/include/common-request.inc.php
+++ b/include/common-request.inc.php
@@ -51,6 +51,9 @@
if (isset($_REQUEST['routeDestination'])) {
$routeDestination = urldecode(filter_var($_REQUEST['routeDestination'], FILTER_SANITIZE_ENCODED));
}
+if (isset($_REQUEST['routename'])) {
+ $routename = urldecode(filter_var($_REQUEST['routename'], FILTER_SANITIZE_ENCODED));
+}
if (isset($_REQUEST['stopcode'])) {
$stopcode = filter_var($_REQUEST['stopcode'], FILTER_SANITIZE_STRING);
}
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -61,6 +61,12 @@
|| $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || $_SERVER['SERVER_NAME'] == "192.168.1.8" || $_SERVER['SERVER_NAME'] == "192.168.178.24");
}
+if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == "maxious.xen.prgmr.com") {
+// Set the exception handler
+require $basePath."/lib/amon-php/amon.php";
+Amon::setup_exception_handler();
+}
+
include_once ("common-geo.inc.php");
include_once ("common-net.inc.php");
include_once ("common-transit.inc.php");
--- /dev/null
+++ b/lib/amon-php
--- a/myway/myway_timeliness_route.json.php
+++ b/myway/myway_timeliness_route.json.php
@@ -21,12 +21,12 @@
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
?>
{
-"label": "<?php echo $_REQUEST['routeid']; ?>",
+"label": "<?php echo $routename; ?>",
"data": <?php
-$query = "select * from myway_timingdeltas where route_name = :route_name AND abs(timing_delta) < 2*(select stddev(timing_delta) from myway_timingdeltas) order by stop_sequence;";
+$query = "select * from myway_timingdeltas where route_name = :route_name
+AND abs(timing_delta) < 2*(select stddev(timing_delta) from myway_timingdeltas) order by stop_sequence;";
$query = $conn->prepare($query);
-$_REQUEST['routeid'].=" ";
-$query->bindParam(':route_name', $_REQUEST['routeid'], PDO::PARAM_STR);
+$query->bindParam(':route_name', $routename, PDO::PARAM_STR);
$query->execute();
if (!$query) {
@@ -39,3 +39,4 @@
echo "[" . implode(",", $points) . "]";
?>
}
+
--- a/myway/myway_timeliness_route.php
+++ b/myway/myway_timeliness_route.php
@@ -22,7 +22,7 @@
<script language="javascript" type="text/javascript" src="../js/flot/jquery.flot.js"></script>
<form method="get" action="">
- <select id="routeid" name="routeid">
+ <select id="routename" name="routename">
<?php
$query = "select distinct route_name from myway_timingdeltas order by route_name";
$query = $conn->prepare($query);
@@ -59,12 +59,12 @@
// fetch one series, adding to what we got
var alreadyFetched = {};
- $("#routeid").change(function () {
+ $("#routename").change(function () {
var select = $(this);
// find the URL in the link right next to us
// var dataurl = button.siblings('a').attr('href');
- var dataurl = "myway_timeliness_route.json.php?routeid=" + select.val();
+ var dataurl = "myway_timeliness_route.json.php?routename=" + select.val();
// then fetch the data with jQuery
function onDataReceived(series) {
// extract the first coordinate pair so you can see that