<?php /******************************************************************************** * HAndl;ing the GET ********************************************************************************/ if (isset($_GET['submit'])) { $log->LogDebug("---------------------------------------------------------------------------------------"); $log->LogDebug("Search Request: From=>" . $_GET['txtSourceAddress'] . ",To=>" . $_GET['txtDestinationAddress']); // First the stops are checked in the stops database // Then in the road address database // finally go to the internet // basically you get the stopname, lat, long, also the offset distance between what you typed and what you got // i think we need to implement a logic in calculating the stop name. The stop that has more buses should be given priorityu among the sorted stops so // silk board orr should be given a priority over the silk board hosur road list($startStop, $startLatitude, $startLongitude, $startDistance) = split(":", getStopForAddress($_GET['txtSourceAddress'], $map, $log)); list($endStop, $endLatitude, $endLongitude, $endDistance) = split(":", getStopForAddress($_GET['txtDestinationAddress'], $map, $log)); if (strcmp($startStop, "0") == 0) { echo $_GET['txtSourceAddress'] . " is not a valid address <br/>"; $log->LogDebug("StopFoundResult:" . $_GET['txtSourceAddress'] . " is not a valid address"); //return; } else { if (strcmp($endStop, "0") == 0) { echo $_GET['txtDestinationAddress'] . " is not a valid address <br/>"; $log->LogDebug("StopFoundResult:" . $_GET['txtDestinationAddress'] . " is not a valid address"); //return; } else { if (strcmp($startStop, "m") == 0) { echo $_GET['txtSourceAddress'] . " Need to define the starting address more precicely <br/>"; $log->LogDebug("StopFoundResult:" . $_GET['txtSourceAddress'] . " Need to define the starting address more precicely"); //return; } else {
//include("LIB_http.php"); #include parse library include "LIB_parse.php"; require_once 'HelperFunctionsAjax.php'; ?> <?php /******************************************************************************** * The script is used to find out the actual stops for the given addresses. * The media paramter will determine if the call came from iphone,android,website ********************************************************************************/ if (isset($_GET['source']) && isset($_GET['destination'])) { $mediaType = $_GET['media']; if ($mediaType == '') { $mediaType = "IPHONE"; } //this is to support Bhau's thing for now //echo "source".$_GET['source']; //echo "<Data>"; echo "<Addresses>"; echo getStopForAddress($_GET['source'], $log, $mediaType); echo getStopForAddress($_GET['destination'], $log, $mediaType); echo "</Addresses>"; //echo "</Data>"; } if (isset($_GET['sourceStopName']) && isset($_GET['destStopName'])) { echo "dkjasjdkljjalda"; } ?>
<?php header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; # Include http library //include("LIB_http.php"); #include parse library include "LIB_parse.php"; require_once 'HelperFunctionsAjax.php'; ?> <?php /******************************************************************************** * The script is used to find out the actual stops for the given addresses. ********************************************************************************/ if (isset($_GET['source']) && isset($_GET['destination'])) { echo '<Addresses>'; echo getStopForAddress($_GET['source'], $log); echo getStopForAddress($_GET['destination'], $log); echo "</Addresses>"; //echo "</Data>"; } if (isset($_GET['sourceStopName']) && isset($_GET['destStopName'])) { echo "dkjasjdkljjalda"; } ?>