include("logic.php");
#Get Google API Key:
#http://www.google.com/apis/maps/signup.html
#Get Yahoo Geo API Key:
#http://developer.yahoo.com/maps/rest/V1/geocode.html
#$query = mysql_query("SELECT message FROM sharemytaxi order by timestamp DESC");
$query1 = "SELECT * FROM incoming ORDER BY id DESC";
$result1 = mysql_query($query1);
$row = mysql_fetch_assoc($result1);
$sender = $row["xfrom"];
$content = $row["message"];
$data = explode("/", $content);
/*
// get everything after last newline
$text = "/";
$last = substr(strrchr($text, 10), 1 );
*/
$address = $data[0];
$addressB = $data[1];
#echo "This is result: $result";
#echo "This is the: $address";
#both these API keys are for "itp.nyu.edu"
$google_key = "ABQIAAAANSYwoh30VznwQS0wEo2gRhR3NgNGCV2Kxkmgi2P_hZMg8zjTRxSrrmerGCGYhzs0AKaU2LCrOsQJSQ";
#$yahoo_key = ".ESD1OXV34Gb4T8pV4xEl5fcMRUZZtW4YMsNP0uHHyQjkTlV9qYIpljYxVcn";
geocodeMe($address, "g");
echo "
"."
"."YOUR START ADDRESS IS: "."
" . $address . "
";
$Alat = $lat;
echo "Alat: " . $lat . "
";
$Along = $long;
echo "Along: " . $long . "
";
$pointA = "$Alat".","."$Along";
/*
echo "url: " . $url . "
";
echo "lat: " . $lat . "
";
echo "long: " . $long . "
";
echo "
" . $resultsSQLA[$i]["xfrom"] . " | "; echo "" . $resultsSQLA[$i]["id"] . " | "; echo "" . $resultsSQLA[$i]["Alat"] . " | "; echo "" . $resultsSQLA[$i]["Along"] . " | "; echo "" . $resultsSQLA[$i]["distance"] . " | "; echo "" . round($resultsSQLA[$i]["distance"], 1) . " miles | "; } */ ###BBBBBBBBBBBBBBBBBB # now, use this distance range to define our latitude and longitude range # (note that this conversion uses decimal degrees and NOT radians) $Blatitude_range = (180 * $range) / ($pi * $radius_of_earth); $Blongitude_range = (180 * $range) / ($pi * $radius_of_earth * sin((90 - $Blat) * $pi / 180)); #echo "Blat_range: " . $Blatitude_range . "
" . $resultsSQLA[$i]["xfrom"] . " | "; echo "" . $resultsSQLA[$i]["id"] . " | "; echo "" . $resultsSQLA[$i]["Alat"] . " | "; echo "" . $resultsSQLA[$i]["Along"] . " | "; echo "" . $resultsSQLA[$i]["distance"] . " | "; echo "" . round($resultsSQLA[$i]["distance"], 1) . " miles | "; echo "" . $resultsSQLB[$i]["Blat"] . " | "; echo "" . $resultsSQLB[$i]["Blong"] . " | "; echo "" . $resultsSQLB[$i]["distance"] . " | "; echo "" . round($resultsSQLB[$i]["distance"], 1) . " miles | "; echo"