<?php // set the type $type = $_GET['type']; if ($debug) { echo "type = " . $type . "<br/>"; } // this file does the search functions include $oop . '/search.php'; if (count($locations) == 1) { if ($locations[0]->name == null && $_GET['n'] != null) { $locations[0]->name = fixSearchString($_GET['n']); } } //$affiliateDiv = new Div(null, "noselect", "font-size:7pt;color:#CCCCCC;", "(not affiliated with Google)"); //$poweredByDiv->addDataElement($affiliateDiv); echo $linksDiv->toString(); ?> <table id="header"> <tr> <?php $logoDiv = new Div(null, "logo", new Link($link, new Image("logo", "images/{$logo}", "Go To {$link}", "55", "150"))); $headerLogoTD = new Cell("header_logo", null, null, $logoDiv); $sloganDiv = new Div("slogan", null, $slogan); $headerLogoTD->addData($sloganDiv); echo $headerLogoTD->toString(); ?> <td width="100%"> <div id="printheader"></div> <table class="form" width="100%"> <tr> <td class="menu">
$cities_table->addRow($header_row); $header_row->addCell(new Cell("header_cell", "<b>Show</b>")); $header_row->addCell(new Cell("header_cell", "<b>City</b>")); $header_row->addCell(new Cell("header_cell", "<b>Site Link</b>")); $highlight = false; for ($i = 0; $i < count($cities); $i++) { if ($highlight) { $class_name = "stationRowHighlight"; $highlight = false; } else { $class_name = "stationRow"; $highlight = true; } $cities_table->addRow(createCityTableRow($cities[$i], $location_marker, $class_name, $cities_link[$i])); } echo $cities_div->toString(); ?> </td> </tr> </table> <script type="text/javascript"> // Google Analytics var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-3853080-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> </body>
/** Displays the station choices for choosing alternate stations when using direction finding. @param $url<String> the URL for the form @param $start_location<Location> the starting point for the search @param $end_location<Location> the ending point for the search @param $path_array[]<Segment> the path found in the original search */ function displayStationChoices($url, $start_location, $end_location, $path_array) { global $website, $station_marker_img; $debug = false; if ($debug) { echo $start_location->desc . " to " . $end_location->desc . "<br/>"; } // list alternate start stations $start_table = new Table(null, "choicetable"); $div = new Div("alternate_choices", "<b>Start Station Choices</b><br/>\n"); $div->addDataElement($start_table); $div->addDataElement("<br/>\n"); $header_row = new Row(null, "header_row"); $header_row->addCell(new Cell("header_cell", "Show")); $header_row->addCell(new Cell("header_cell", "Station Name")); $header_row->addCell(new Cell("header_cell", "Subway Lines")); $header_row->addCell(new Cell("header_cell")); $start_table->addRow($header_row); $start_stations = findNearestStations2($start_location); $start_station_marker = $path_array[0]->m2; if ($debug) { echo "start_station_marker->id = " . $start_station_marker->id . "<br/>"; } $i = 0; foreach ($start_stations as $station) { $station_marker = $station->marker; $station_lng = $station_marker->getLng(); $station_lat = $station_marker->getLat(); if (isEven($i)) { $class_name = "rowHighlight"; } else { $class_name = "row"; } $station_row = new Row($station_marker->id, $class_name); // station marker link $station_row->addCell(new Cell("step_cell", new Link("javascript:focusOn(new GLatLng({$station_lat},{$station_lng}), map.getZoom());", new Image("images/{$station_marker_img}", "0")))); $station_row->addCell(new Cell("instruction", $station_marker->name)); // build lines cell $lines = $station_marker->getLines(); $lines_cell = new Cell("instruction"); foreach ($lines as $line) { $line_img = $line->img; $line_url = $website . $line->url; $lines_cell->addData(new Link("javascript:void(0);", new Image(null, "images/{$line_img}", $line->name, null, "20"), "window.open('{$line_url}');")); } $station_row->addCell($lines_cell); if ($start_station_marker->id == $station_marker->id) { $cell_data = "<input type=\"radio\" name=\"start\" value=\"{$station_marker->id}\" checked=\"true\"/>"; } else { $cell_data = "<input type=\"radio\" name=\"start\" value=\"{$station_marker->id}\" />"; } $station_row->addCell(new Cell("step_cell", $cell_data)); $start_table->addRow($station_row); $i++; } // list alternate end stations $div->addDataElement("<b>End Station Choices</b><br/>\n"); $end_table = new Table(null, "choicetable"); $div->addDataElement($end_table); $end_table->addRow($header_row); $end_stations = findNearestStations2($end_location); $end_station_marker = $path_array[count($path_array) - 1]->m1; if ($debug) { echo "end_station_marker->id = " . $end_station_marker->id . "<br/>"; } $i = 0; foreach ($end_stations as $station) { $station_marker = $station->marker; $station_lng = $station_marker->getLng(); $station_lat = $station_marker->getLat(); if (isEven($i)) { $class_name = "rowHighlight"; } else { $class_name = "row"; } $station_row = new Row($station_marker->id, $class_name); // station marker link $station_row->addCell(new Cell("step_cell", new Link("javascript:focusOn(new GLatLng({$station_lat},{$station_lng}), map.getZoom());", new Image("images/{$station_marker_img}", "0")))); $station_row->addCell(new Cell("instruction", $station_marker->name)); // build lines cell $lines = $station_marker->getLines(); $lines_cell = new Cell("instruction"); foreach ($lines as $line) { $line_img = $line->img; $line_url = $website . $line->url; $lines_cell->addData(new Link("javascript:void(0);", new Image(null, "images/{$line_img}", $line->name, null, "20"), "window.open('{$line_url}');")); } $station_row->addCell($lines_cell); if ($end_station_marker->id == $station_marker->id) { $cell_data = "<input type=\"radio\" name=\"end\" value=\"{$station_marker->id}\" checked=\"true\"/>"; } else { $cell_data = "<input type=\"radio\" name=\"end\" value=\"{$station_marker->id}\" />"; } $station_row->addCell(new Cell("step_cell", $cell_data)); $end_table->addRow($station_row); $i++; } echo "<form id=\"form_pick\" action=\"{$url}\" method=\"get\">\n"; echo $div->toString(); echo "<input type=\"hidden\" name=\"type\" value=\"dir_alt\" />\n"; echo "<input type=\"hidden\" name=\"sa\" value=\"" . $start_location->getAddressString() . "\" />\n"; echo "<input type=\"hidden\" name=\"da\" value=\"" . $end_location->getAddressString() . "\" />\n"; echo "<br/>\n"; #echo "<input type=\"image\" name=\"submit\" src=\"images/usebutton.png\">\n"; echo "<div id=\"usebutton\"><input class=\"btn\" type=\"submit\" id=\"submit\" value=\"Use\"></div>\n"; echo "</form>"; }
$type = $_GET['type']; if ($debug) { echo "type = " . $type . "<br/>"; } // this file does the search functions include $oop . '/search.php'; if (count($locations) == 1) { if ($locations[0]->name == null && $_GET['n'] != null) { $locations[0]->name = fixSearchString($_GET['n']); } } $poweredByDiv = new Div("about", "noselect", null, "uses "); $poweredByDiv->addDataElement(new Link("http://maps.google.com", "Google Maps")); $affiliateDiv = new Div(null, "noselect", "font-size:7pt;color:#CCCCCC;", "(not affiliated with Google)"); $poweredByDiv->addDataElement($affiliateDiv); echo $poweredByDiv->toString(); ?> <table id="header"><tr> <?php $logo_img = new Image("logo", null, "images/logo.png", "transitcompass", null, null); $logo_link = new Link($link, $logo_img); $logo_data = new Cell("logo", null, "color:#008000", $logo_link); echo $logo_data->toString(); ?> <!--<td>transit<b>compass</b> <i style="font-size:10px;position:relative;left:-110px;top:-20px;width:100px">NYC Edition</i></td>--> <td width="100%"> <table class="form" width="100%"> <tr> <td align="right" rowspan="2" valign="top" style="padding-right:5px;width:250px"> <!-- credits --> <?php
$stations_table->addRow($header_row); $header_row->addCell(new Cell("header_cell", "<b>Show</b>")); $header_row->addCell(new Cell("header_cell", "<b>Station Name</b>")); $header_row->addCell(new Cell("header_cell", "<b>Subway Lines</b>")); $highlight = false; foreach ($stations as $station) { if ($highlight) { $class_name = "stationRowHighlight"; $highlight = false; } else { $class_name = "stationRow"; $highlight = true; } $stations_table->addRow(createStationTableRow($station, $station_marker_img, $class_name)); } echo $stations_div->toString() . "<br/>\n"; if (isset($_GET['saddr'])) { $l = $_GET['saddr']; } else { if (isset($_GET['daddr'])) { $l = $_GET['daddr']; } else { $l = $_GET['l']; } } $directions_table = new Table(null, "info_table"); $header_row = new Row(null, "header_row"); $directions_table->addRow($header_row); $header_row->addCell(new Cell("header_cell", "<b>Directions</b>")); $header_row->addCell(new Cell("header_cell", "")); $choices_row = new Row(null, "stationRow");