So where is? ... ";
$wiprefix="";
$promptclobber="";
$wisc="world";
if (strpos($_SERVER['HTTP_REFERER'], "welcometonation.htm") !== false) {
$wprefix=" or
So where is?";
$wisc="welcometonation";
}
$isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
if ($isiPad === false) {
$isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone');
}
if ($isiPad === false) {
$isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'Android');
}
if ($isiPad) {
$wprefix="";
$wiprefix="Where? style=width:50px";
$anticprefix=" Clickaround";
$promptclobber="";
}
$gprefix="http://www.rjmprogramming.com.au/HTMLCSS/" . $wisc . ".html?lat=0000.0&long=0000.0&name=%20&lat2=0000.0&long2=0000.0&name2=%20&lat3=0000.0&long3=0000.0&name3=%20&lat4=0000.0&long4=0000.0&name4=%20&lat5=0000.0&long5=0000.0&name5=%20&lat6=0000.0&long6=0000.0&name6=%20&lat7=0000.0&long7=0000.0&name7=%20&lat8=0000.0&long8=0000.0&name8=%20&lat9=0000.0&long9=0000.0&name9=%20&lat10=0000.0&long10=0000.0&name10=¬hing=";
$alat = 0.0;
$along = 0.0;
$proposed = "
";
$prefix = "%20Airport";
if (isset($_GET['port'])) {
$prefix = "%20Port";
}
$num = 3;
if (isset($_GET['num'])) $num = $_GET['num'];
function lastlook($pis) {
global $cprefix, $anticprefix, $csuffix;
if (strlen($_SERVER['QUERY_STRING']) == 0 || 2 == 2) {
return str_replace($anticprefix, "", str_replace("", "\n var iss=' " . $cprefix . $wprefix . "Please select last value below ...'; parent.document.getElementById('siswi').value=''; if (1 == 2) { parent.document.getElementById('siswi').value=this.value; } } else if (this.value.indexOf(';') != -1) { parent.document.getElementById('siswi').innerHTML+=''; parent.document.getElementById('siswi').value=this.value; } else if (this.value != '') { parent.document.getElementById('mypiframe').src='intair.php?sofar=' + encodeURIComponent(this.value.replace(.replace('Where?','')); } \" + '\" type=text onclick=this.value=\"\" id=iswi value=" . $wiprefix . "> " . $csuffix . "'; if (parent.document.getElementById('mya')) { if (!parent.document.getElementById('diswi')) { parent.document.getElementById('mya').innerHTML=''; var hones=parent.document.getElementsByTagName('h1'); if (hones.length != 0) { if (hones[0].innerHTML.indexOf('" . $cprefix . $csuffix . "') != -1) { hones[0].innerHTML=hones[0].innerHTML.replace('" . $cprefix . $csuffix . "',iss.replace('xq',encodeURIComponent(this.value))); } } } } \n ", $pis));
}
return $pis;
}
function pre_great_circle_nodistance($ptalis, $pgnolis, $one, $two, $three, $four, $five, $six, $seven, $eight, $sanity) {
global $alat;
global $along;
$alat = ($one + ($two / 60.00) + ($three / 3600.0));
$along = ($five + ($six / 60.00) + ($seven / 3600.0));
if ($one == 0 && $two == 0 && $three == 0 && $five == 0 && $six == 0 && $seven == 0) {
return 0.0;
} else {
//echo "*" . $sanity . "+++" . $four . "---" . $eight . "*";
if ($four == "S" && $eight == "U") $alat = -($one + ($two / 60.00) + ($three / 3600.0));
if ($four == "S" && $eight == "U") $along = -($five + ($six / 60.00) + ($seven / 3600.0));
if ($four != "S" && $eight == "U") $alat = ($one + ($two / 60.00) + ($three / 3600.0));
if ($four != "S" && $eight == "U") $along = -($five + ($six / 60.00) + ($seven / 3600.0));
if ($four == "S" && $eight != "U") $alat = -($one + ($two / 60.00) + ($three / 3600.0));
if ($four == "S" && $eight != "U") $along = ($five + ($six / 60.00) + ($seven / 3600.0));
return 0.0;
}
}
function pre_great_circle_distance($ptalis, $pgnolis, $one, $two, $three, $four, $five, $six, $seven, $eight, $sanity) {
global $alat;
global $along;
$alat = ($one + ($two / 60.00) + ($three / 3600.0));
$along = ($five + ($six / 60.00) + ($seven / 3600.0));
if ($one == 0 && $two == 0 && $three == 0 && $five == 0 && $six == 0 && $seven == 0) {
return -9.0;
} else {
//echo "*" . $sanity . "+++" . $four . "---" . $eight . "*";
if ($four == "S" && $eight == "U") $alat = -($one + ($two / 60.00) + ($three / 3600.0));
if ($four == "S" && $eight == "U") $along = -($five + ($six / 60.00) + ($seven / 3600.0));
if ($four != "S" && $eight == "U") $alat = ($one + ($two / 60.00) + ($three / 3600.0));
if ($four != "S" && $eight == "U") $along = -($five + ($six / 60.00) + ($seven / 3600.0));
if ($four == "S" && $eight != "U") $alat = -($one + ($two / 60.00) + ($three / 3600.0));
if ($four == "S" && $eight != "U") $along = ($five + ($six / 60.00) + ($seven / 3600.0));
return great_circle_distance($ptalis, $pgnolis, $alat, $along);
}
}
function great_circle_distance($talis, $gnolis, $latis, $longis) {
$ourdist=0.0;
$rgnol=(($gnolis) * pi() / 180.0);
$rtal=(($talis) * pi() / 180.0);
$rlong=(($longis) * pi() / 180.0);
$rlat=(($latis) * pi() / 180.0);
$deltalong = abs(((($gnolis)-($longis)) * pi() / 180.0));
$acof = (sin($rtal) * sin($rlat)) + (cos($rtal) * cos($rlat) * cos($deltalong)); // via http://en.wikipedia.org/wiki/Great-circle_distance ... thanks
$ourdist = (round((acos($acof) * 6371000.0) + 0.00001) * 100) / 100;
return $ourdist;
}
$postproposed='';
$postrecs='';
$nsf = -9.0;
$name = "";
$glat = 0.0;
$glong = 0.0;
$mindist = -9.0;
if (isset($_GET['lat']) && isset($_GET['long'])) {
//{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"scalerank":8,"name":"Sint Nicolaas","website":"www.rocargo.com/SanNicolas.html","natlscale":5,"featureclass":"Port"}
//,"geometry":{"type":"Point","coordinates":[-69.92355713,12.4375]}},
//{"type":"Feature","properties":{"scalerank":8,"name":"Campana","website":"www.consejoportuario.com.ar","natlscale":5,"featureclass":"Port"},"geometry":{"type":"Point","coordinates":[-58.95141343,-34.15333333]}},
// {"type":"Feature","properties":{"scalerank":8,"name":"Zarate","website":"www.consejoportuario.com.ar","natlscale":5,"featureclass":"Port"},"geometry":{"type":"Point","coordinates":[-59.004947,-34.09888889]}},
// {"type":"Feature","properties":{"scalerank":8,"name":"Puerto Belgrano/Bahia Blanca","website":null,"natlscale":5,"featureclass":"Port"},"geometry":{"type":"Point","coordinates":[-62.10088339,-38.89444444]}},
// {"type":"Feature","properties":{"scalerank":8,"name":"Puerto Galvan/Bahia Blanca","website":null,"natlscale":5,"featureclass":"Port"},"geometry":{"type":"Point","coordinates":[-62.30053004,-38.78305556]}},
// {"type":"Feature","properties":{"scalerank":8,"name":"Ingeniero White/Bahia Blanca","website":null,"natlscale":5,"featureclass":"Port"},"geometry":{"type":"Point","coordinates":[-62.25989399,-38.79194444]}},
if (isset($_GET['port'])) {
if ($_GET['port'] == "air") {
$postproposed=@file_get_contents(explode("intair.php", str_replace("::",":","http://" . $_SERVER['SERVER_NAME'] . ":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "" . $_SERVER['REQUEST_URI'])[0] . "intair.php?num=" . $num . "&lat=" . $_GET['lat'] . "&long=" . $_GET['long']);
$recs=explode("parent.document.getElementById('myiframe').src=parent.document.getElementById('myiframe').src", $postproposed);
for ($ir=1; $ir= 0.0 && $distis > $mindist && ($nsf < 0.0 || $distis < $nsf)) {
$nsf = $distis;
$name = explode('"', explode(',"name":"', $cols[$i])[1])[0]; //$cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = explode(']', explode(',', explode(':[', $cols[$i])[1])[1])[0];
$glong = explode(',', explode(':[', $cols[$i])[1])[0];
//echo $name . " " , $glat . " " . $glong . " " . $nsf . "\n";
}
}
if ($glat != 0.0 || $glong != 0.0) {
if (isset($_GET['spawn'])) {
if ($murl == "") $murl=$_GET['spawn'];
$murl.=",[" . round($glat, 4) . "," . round($glong, 4) . ",~Nearest" . $prefix . "%20on%20geojson.xyz%20ports%20" . round($nsf / 1000.0) . "km%20to%20" . str_replace("'","`",$name) . "~]";
}
$proposed = str_replace("", $postrecs . "\n parent.document.getElementById('myiframe').src=twobits(parent.document.getElementById('myiframe').src , ',[" . round($glat, 4) . "," . round($glong, 4) . ",~Nearest" . $prefix . "%20on%20geojson.xyz%20ports%20" . round($nsf / 1000.0) . "km%20to%20" . urlencode(str_replace("'","`",$name)) . "~]'); parent.document.getElementById('myiframe').style.display='block'; \n" . "", $proposed);
$prefix = (str_replace("%20Airport", "", $prefix) . "-");
$mindist = $nsf;
$nsf = -9.0;
$name = "";
$glat = 0.0;
$glong = 0.0;
$distis = 0.0;
}
}
} else {
$adb = @file_get_contents("GlobalAirportDatabase/GlobalAirportDatabase.txt");
$cols = explode(":", "0000 " . $adb);
for ($j=0; $j<$num; $j++) {
for ($i=0; $i= 12) {
$distis = pre_great_circle_distance($_GET['lat'], $_GET['long'], $cols[$i + 5], $cols[$i + 6], $cols[$i + 7], $cols[$i + 8], $cols[$i + 9], $cols[$i + 10], $cols[$i + 11], $cols[$i + 12], $cols[$i + 0]);
if ($distis >= 0.0 && $distis > $mindist && ($nsf < 0.0 || $distis < $nsf)) {
$nsf = $distis;
$name = $cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = $alat;
$glong = $along;
//echo $name . " " , $glat . " " . $glong . " " . $nsf . "\n";
}
}
}
if ($glat != 0.0 || $glong != 0.0) {
if (isset($_GET['spawn'])) {
if ($murl == "") $murl=$_GET['spawn'];
$murl.=",[" . round($glat, 4) . "," . round($glong, 4) . ",~Nearest" . $prefix . "%20on%20GlobalAirportDatabase%20" . round($nsf / 1000.0) . "km%20to%20" . str_replace("'","`",$name) . "~]";
}
$proposed = str_replace("", "\n parent.document.getElementById('myiframe').src=twobits(parent.document.getElementById('myiframe').src , ',[" . round($glat, 4) . "," . round($glong, 4) . ",~Nearest" . $prefix . "%20on%20GlobalAirportDatabase%20" . round($nsf / 1000.0) . "km%20to%20" . str_replace("'","`",$name) . "~]'); parent.document.getElementById('myiframe').style.display='block'; \n" . "", $proposed);
$prefix = (str_replace("%20Airport", "", $prefix) . "-");
$mindist = $nsf;
$nsf = -9.0;
$name = "";
$glat = 0.0;
$glong = 0.0;
$distis = 0.0;
}
}
}
if ($murl != "") {
header("Location: " . $murl);
} else {
echo lastlook($proposed);
}
} else if (isset($_GET['plot']) && 1 == 2) {
if (isset($_GET['port'])) {
$adb = @file_get_contents("GlobalAirportDatabase/ports.geojson");
$cols = explode("]}}", $adb);
for ($j=0; $j<$num; $j++) {
for ($i=0; $i<(-1 + sizeof($cols)); $i++) {
$distis = great_circle_distance($_GET['lat'], $_GET['long'], explode(']', explode(',', explode(':[', $cols[$i])[1])[1])[0], explode(',', explode(':[', $cols[$i])[1])[0]);
if ($distis >= 0.0 && $distis > $mindist && ($nsf < 0.0 || $distis < $nsf)) {
$nsf = $distis;
$name = explode('"', explode(',"name":"', $cols[$i])[1])[0]; //$cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = explode(']', explode(',', explode(':[', $cols[$i])[1])[1])[0];
$glong = explode(',', explode(':[', $cols[$i])[1])[0];
$proposed = str_replace("", "\n parent.document.getElementById('mya').title='" . $glat . "," . $glong . "'; parent.document.getElementById('mya').click(); \n" . "", $proposed);
}
echo lastlook($proposed);
}
}
} else {
$adb = @file_get_contents("GlobalAirportDatabase/GlobalAirportDatabase.txt");
$cols = explode(":", "0000 " . $adb);
for ($i=0; $i= 12) {
$distis = pre_great_circle_distance($_GET['lat'], $_GET['long'], $cols[$i + 5], $cols[$i + 6], $cols[$i + 7], $cols[$i + 8], $cols[$i + 9], $cols[$i + 10], $cols[$i + 11], $cols[$i + 12], $cols[$i + 0]);
if ($distis >= 0.0 && ($nsf < 0.0 || $distis < $nsf)) {
//$nsf = $distis;
$name = $cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = $alat;
$glong = $along;
$proposed = str_replace("", "\n parent.document.getElementById('mya').title='" . $glat . "," . $glong . "'; parent.document.getElementById('mya').click(); \n" . "", $proposed);
}
echo lastlook($proposed);
}
}
}
} else if (isset($_GET['sofar']) && 1 == 1) {
$sih="";
$fnum=0;
if (isset($_GET['port'])) {
$adb = @file_get_contents("GlobalAirportDatabase/ports.geojson");
$cols = explode("]}}", $adb);
//for ($j=0; $j<$num; $j++) {
for ($i=0; $i<(-1 + sizeof($cols)); $i++) {
//if (sizeof($cols) >= 12) {
$distis = great_circle_distance($_GET['lat'], $_GET['long'], explode(']', explode(',', explode(':[', $cols[$i])[1])[1])[0], explode(',', explode(':[', $cols[$i])[1])[0]);
if (1 == 1 || ($distis >= 0.0 && $distis > $mindist && ($nsf < 0.0 || $distis < $nsf))) {
$nsf = $distis;
$name = explode('"', explode(',"name":"', $cols[$i])[1])[0]; //$cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = explode(']', explode(',', explode(':[', $cols[$i])[1])[1])[0];
$glong = explode(',', explode(':[', $cols[$i])[1])[0];
//echo $name . " " , $glat . " " . $glong . " " . $nsf . "\n";
if ($alat != 0.0 || $along != 0.0) {
$fnum++;
if ($fnum == 2) $sih=str_replace("Found this ...", "Found these ...", $sih);
if ($sih == "") $sih="";
$sih .= '';
}
}
//}
}
} else {
$adb = @file_get_contents("GlobalAirportDatabase/GlobalAirportDatabase.txt");
$cols = explode(":", "0000 " . $adb);
//for ($j=0; $j<$num; $j++) {
for ($i=0; $i= 12) {
$distis = pre_great_circle_nodistance(0.0, 0.0, $cols[$i + 5], $cols[$i + 6], $cols[$i + 7], $cols[$i + 8], $cols[$i + 9], $cols[$i + 10], $cols[$i + 11], $cols[$i + 12], $cols[$i + 0]);
if (1 == 1 || ($distis >= 0.0 && $distis > $mindist && ($nsf < 0.0 || $distis < $nsf))) {
$nsf = $distis;
$name = $cols[$i + 1] . "/" . $cols[$i + 2] . "/" . $cols[$i + 3] . "/" . $cols[$i + 4];
$glat = $alat;
$glong = $along;
//echo $name . " " , $glat . " " . $glong . " " . $nsf . "\n";
if ($alat != 0.0 || $along != 0.0) {
if (strpos(("/" . strtoupper($name)), "/" . strtoupper(urldecode($_GET['sofar']))) !== false) {
$fnum++;
if ($fnum == 2) $sih=str_replace("Found this ...", "Found these ...", $sih);
if ($sih == "") $sih="";
$sih .= '';
} else if (strpos(("" . strtoupper($name)), strtoupper(urldecode($_GET['sofar']))) !== false && strlen(urldecode($_GET['sofar'])) >= 4) {
$fnum++;
if ($fnum == 2) $sih=str_replace("Found this ...", "Found these ...", $sih);
if ($sih == "") $sih="";
$sih .= '';
}
}
}
}
}
}
//}
echo "";
} else if (5 == 5) {
echo "";
}
?>