From: root Date: Fri, 04 Feb 2011 11:24:29 +0000 Subject: Use local green pin and upgrade jquery mobile to alpha 3 X-Git-Url: https://maxious.lambdacomplex.org/git/?p=bus.git&a=commitdiff&h=0e50a8d7f58dd2b5d86abdda89129255dd5673d7 --- Use local green pin and upgrade jquery mobile to alpha 3 --- --- a/betweenpoint.delete.php +++ b/betweenpoint.delete.php @@ -13,6 +13,20 @@ echo("Error in SQL query: " . pg_last_error() . "
\n"); } else { echo "Deleted {$_REQUEST['oldgeopo']}
"; + $updatedroutes = 0; + $result_outdatedroutes = pg_query($conn, "Select * FROM between_stops where points LIKE '%" . $_REQUEST['oldgeopo'] . ";%'"); + while ($outdatedroute = pg_fetch_assoc($result_outdatedroutes)) { + $newpoints = str_replace($_REQUEST['oldgeopo'].';', '', $outdatedroute['points']); + $sql = "UPDATE between_stops set points='$newpoints' where fromlocation = '{$outdatedroute['fromlocation']}' AND tolocation = '{$outdatedroute['tolocation']}' "; + $result = pg_query($conn, $sql); + if (!$result) { + echo("Error in SQL query: " . pg_last_error() . "
\n"); + } + echo "updated ".$outdatedroute['fromlocation']."->".$outdatedroute['tolocation']."
"; + + $updatedroutes++; + } + echo "updated $updatedroutes routes
"; } } flush(); --- a/betweenpoint.move.php +++ b/betweenpoint.move.php @@ -78,11 +78,14 @@ $result_outdatedroutes = pg_query($conn, "Select * FROM between_stops where points LIKE '%" . $_REQUEST['oldgeopo'] . ";%'"); while ($outdatedroute = pg_fetch_assoc($result_outdatedroutes)) { $newpoints = str_replace($_REQUEST['oldgeopo'], $geoPo, $outdatedroute['points']); - $sql = "UPDATE between_stops set points='$newpoints' where fromlocation = '{$outdatedroute['fromlocation']}' AND tolocation = '{$outdatedroute['tolocation']}' "; + $sql = "UPDATE between_stops set points='$newpoints' where + fromlocation = '".pg_escape_string($outdatedroute['fromlocation']). + "' AND tolocation = '".pg_escape_string($outdatedroute['tolocation'])."' "; $result = pg_query($conn, $sql); if (!$result) { echo("Error in SQL query: " . pg_last_error() . "
\n"); } + echo "updated ".$outdatedroute['fromlocation']."->".$outdatedroute['tolocation']."
"; $updatedroutes++; } echo "updated $updatedroutes routes
"; --- a/betweenpoint.php +++ b/betweenpoint.php @@ -76,7 +76,7 @@ '; } ?> -var timeicon = new OpenLayers.Icon("http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png",new OpenLayers.Size(32,32)); +var timeicon = new OpenLayers.Icon("icong.png",new OpenLayers.Size(32,32)); var timepoints = new OpenLayers.Layer.GeoRSS("Timing Points", "displaytimepoints.georss.php", { icon: timeicon }); map.addLayers([osmtiles, markers,timepoints]); @@ -88,7 +88,7 @@ function submitBetween () { $.post("betweenpoint.submit.php", $("#inputform").serialize(), function(html){ $("#response").html(html); - //clearForms(); + clearForms(); return false; }); }; @@ -203,10 +203,11 @@ } - + $processed = 0; foreach ($paths as $path => $routes) { if (!in_array($path, array_keys($completedPaths))) { - echo "\n"; + echo "\n"; + $processed++; } else { $completedRoutes = explode(";", $completedPaths[$path]); $incompleteRoutes = ""; @@ -218,13 +219,14 @@ } if ($incompleteRoutes != "") { - echo "\n"; + echo "\n"; + $processed++; } } } + echo "$processed"; ?> - from to
--- a/betweenpoint.submit.php +++ b/betweenpoint.submit.php @@ -5,7 +5,7 @@ exit; } print_r($_REQUEST); -$reverse=$_REQUEST["reverse"]; +$reverse=(isset($_REQUEST["reverse"]) ? $_REQUEST["reverse"] : "off"); $from=pg_escape_string($_REQUEST["from"]); $to=pg_escape_string($_REQUEST["to"]); $routes=$_REQUEST["routes"] ; --- a/busui/about.php +++ b/busui/about.php @@ -2,7 +2,22 @@ include('common.inc.php'); ?>

+ Busness Time - An ACT bus timetable webapp +Based on the maxious-canberra-transit-feed +Uses jQuery Mobile, PHP, Ruby, Python, Google Transit Feed Specification tools, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service + +Feedback encouraged; contact maxious@lambdacomplex.org + Some icons by Joseph Wain / glyphish.com + + +Disclaimer: The content of this website is of a general and informative nature. Please check with printed timetables or those available on http://action.act.gov.au before your trip. +Whilst every effort has been made to ensure the high quality and accuracy of the Site, the Author makes no warranty, +express or implied concerning the topicality, correctness, completeness or quality of the information, which is provided +"as is". The Author expressly disclaims all warranties, including but not limited to warranties of fitness for a particular purpose and warranties of merchantability. +All offers are not binding and without obligation. The Author expressly reserves the right, in his discretion, to suspend, +change, modify, add or remove portions of the Site and to restrict or terminate the use and accessibility of the Site +without prior notice. --- a/busui/common.inc.php +++ b/busui/common.inc.php @@ -27,12 +27,12 @@ - bus.lambdacomplex.org - '.$pageTitle.' + busness time - '.$pageTitle.' '; - if (isDebug()) echo ' - '; - else echo ' - '; + if (isDebug()) echo ' + '; + else echo ' + '; echo '