--- a/myway/myway_timeliness_reconcile.php
+++ b/myway/myway_timeliness_reconcile.php
@@ -1,31 +1,48 @@
$value) {
- if (strstr($key, "route") && !strstr($value, "Select")) {
- $myway_route = str_replace("route", "", $key);
- $route_full_name = $value;
- $query = "update myway_routes set route_full_name = :route_full_name where myway_route = :myway_route";
- debug($query, "database");
- $query = $conn->prepare($query);
- $query->bindParam(":myway_route", $myway_route,PDO::PARAM_STR, 5);
- $query->bindParam(":route_full_name", $route_full_name,PDO::PARAM_STR, 42);
- $query->execute();
- die(print_r($conn->errorInfo() , true));
- }
- if (strstr($key, "myway_stop")) {
- $myway_stop = $value;
- $stop_code = $_REQUEST['stop_code'];
- $stop_street = $_REQUEST['stop_street'];
- $query = "update myway_stops set stop_code = :stop_code, stop_street = :stop_street where myway_stop = :myway_stop";
- debug($query, "database");
- $query = $conn->prepare($query);
- $query->bindParam(":myway_stop", $myway_stop, PDO::PARAM_STR, 25);
- $query->bindParam(":stop_code", $stop_code, PDO::PARAM_STR, 32);
- $query->bindParam(":stop_street", $stop_street);
- $query->execute();
- die(print_r($conn->errorInfo() , true));
- }
+ if (strstr($key, "route") && !strstr($value, "Select")) {
+ $myway_route = str_replace("route", "", $key);
+ $vparts = explode("-",$value);
+ $route_short_name = $vparts[0];
+ $trip_headsign = $vparts[1];
+ $query = "update myway_routes set route_short_name = :route_short_name, trip_headsign = :trip_headsign where myway_route = :myway_route";
+ debug($query, "database");
+ $query = $conn->prepare($query);
+ $query->bindParam(":myway_route", $myway_route, PDO::PARAM_STR, 5);
+
+ $query->bindParam(":route_short_name", $route_short_name, PDO::PARAM_STR, 42);
+ $query->bindParam(":trip_headsign", $trip_headsign, PDO::PARAM_STR, 42);
+ $query->execute();
+ die(print_r($conn->errorInfo(), true));
+ }
+ if (strstr($key, "myway_stop")) {
+ $myway_stop = $value;
+ $stop_id = $_REQUEST['stop_id'];
+ $query = "update myway_stops set stop_id = :stop_id where myway_stop = :myway_stop";
+ debug($query, "database");
+ $query = $conn->prepare($query);
+ $query->bindParam(":myway_stop", $myway_stop, PDO::PARAM_STR, 25);
+ $query->bindParam(":stop_id", $stop_id, PDO::PARAM_STR, 32);
+ $query->execute();
+ die(print_r($conn->errorInfo(), true));
+ }
}
include_header("MyWay Data Reconcile", "mywayTimeRec");
// initialise
@@ -38,7 +55,7 @@
)");
echo "$count new stops.
";
if (!$count) {
- print_r($conn->errorInfo());
+ print_r($conn->errorInfo());
}
$count = $conn->exec("insert into myway_routes select distinct myway_route from myway_observations
WHERE myway_route NOT IN
@@ -48,85 +65,84 @@
)");
echo "$count new routes.
";
if (!$count) {
- print_r($conn->errorInfo());
+ print_r($conn->errorInfo());
}
echo "
" . $stopKey++ . " | " . $stopResult['stop_name'] . " | " . $stopResult['stop_code'] . " |