--- a/betweenpoint.submit.php
+++ b/betweenpoint.submit.php
@@ -1,76 +1,30 @@
nodes of the first movie.
- * Output the rating scale, too. */
-foreach ($xml->node as $node) {
- $geoPo = geopoEncode((float)$node['lat'],(float)$node['lon']);
- $node['lat'] = (int) ((float)$node['lat']*10000000);
- $node['lon'] = (int) ((float)$node['lon']*10000000);
- echo($node['lat'].",".$node['lon']."=$geoPo
");
- $sql = "INSERT INTO stops (geohash, lat, lng) VALUES('$geoPo','{$node['lat']}','{$node['lon']}')";
+print_r($_REQUEST);
+$reverse=$_REQUEST["reverse"];
+$from=$_REQUEST["from"];
+$to=$_REQUEST["to"];
+$routes=$_REQUEST["routes"] ;
+$points=$_REQUEST["between_points"];
+ $sql = "INSERT INTO between_stops (fromLocation, toLocation, points, routes) VALUES('$from','$to','$points','$routes')";
$result = pg_query($conn, $sql);
if (!$result) {
echo("Error in SQL query: " . pg_last_error() ."
\n");
}
+ if ($reverse === "on") {
+ $p = implode(";",array_reverse(explode(";",$points))).";";
+ $points = str_replace(";","",$p,1);
+$sql = "INSERT INTO between_stops ( toLocation, fromLocation, points, routes) VALUES('$from','$to','$points','$routes')";
+$result = pg_query($conn, $sql);
+ if (!$result) {
+ echo("Error in SQL query: " . pg_last_error() ."
\n");
+ }
+ }
flush();
-}
?>