--- a/include/db/trip-dao.inc.php +++ b/include/db/trip-dao.inc.php @@ -1,20 +1,15 @@ $row) { - if ($foundStop) { - if (!$timingPointsOnly || !startsWith($row[5], "Wj")) { - $viaPoints[] = Array( - "id" => $row[0], - "name" => $row[1], - "time" => $times[$key] - ); - } - } - else { - if ($row[0] == $stopid) $foundStop = true; - } - } - return $viaPoints; -} function viaPointNames($tripid, $stopid) { - $points = viaPoints($tripid, $stopid, true); - $pointNames = Array(); - foreach ($points as $point) { - $pointNames[] = $point['name']; + global $conn; + $query = "SELECT stop_name +FROM stop_times join stops on stops.stop_id = stop_times.stop_id +WHERE stop_times.trip_id = '$tripid' +AND stop_sequence > '$stop_sequence' +AND substr(stop_code,1,2) != 'Wj' ORDER BY stop_sequence"; + debug($query,"database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); } - return implode(", ", $pointNames); + $pointNames = pg_fetch_all($result); + return r_implode(", ", $pointNames); } ?>