From: Maxious Date: Sun, 26 Feb 2012 04:22:21 +0000 Subject: Fix myway_timeliness_route X-Git-Url: https://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=e5c6822ca0ed5f53c851987c1ccc212f46c8def7 --- Fix myway_timeliness_route --- --- 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/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": "", +"label": "", "data": 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 @@
- 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