More work on mobile UI, changed to network 10 start date
[bus.git] / betweenpoint.submit.php
blob:a/betweenpoint.submit.php -> blob:b/betweenpoint.submit.php
--- a/betweenpoint.submit.php
+++ b/betweenpoint.submit.php
@@ -16,9 +16,11 @@
          echo("Error in SQL query: " . pg_last_error() ."<br>\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')";

+	$ep = explode(";",$points);

+	$epr = array_reverse($ep); 

+	$p = implode(";",$epr).";";

+	$pointsString = substr($p,1);

+$sql = "INSERT INTO between_stops ( toLocation, fromLocation, points, routes) VALUES('$from','$to','$pointsString','$routes')";

 $result = pg_query($conn, $sql);

      if (!$result) {

          echo("Error in SQL query: " . pg_last_error() ."<br>\n");