";
//$prefix="";
} else {
$prefix="";
}
$hprefix="";
$suffix="";
$ourmapstuff="";
$yourmapstuff="";
$formstuff="";
$timezone_abbreviations = DateTimeZone::listAbbreviations();
foreach ($timezone_abbreviations["est"] as $tzo) {
$okay=false;
//echo $tzn . ' ' . $tzo['timezone_id'];
//exit;
//echo (str_replace("%2B","+",$_GET['tzname']));
//exit;
//echo (3600 * str_replace("+","",$_GET['tzname'])) . " " . $tzo['offset'];
//exit;
if (strpos($tzo['timezone_id'], $tzn) !== false) {
$tz = new DateTimeZone($tzo['timezone_id']);
$okay=true;
} else if ((3600 * str_replace("+","",$_GET['tzname'])) == $tzo['offset']) {
$tz = new DateTimeZone($tzo['timezone_id']);
$okay=true;
}
if ($okay) {
$zoneName = $tzo['timezone_id'];
$loc = $tz->getLocation();
if ($loc[latitude] != 0 || $loc[longitude] != 0) {
if ($tzo['offset'] < 0) {
$coffset=($tzo['offset'] / 3600);
} else {
$coffset="+" . ($tzo['offset'] / 3600);
}
if ($ourmapstuff == "") {
$ourmapstuff=" | document.getElementById('smapif').click(); ";
$yourmapstuff=" | ";
//$formstuff=" function doc() { document.getElementById('smapif').click(); } setTimeout(doc, 2000); ";
$formstuff=" function doc() { document.getElementById('smapif').click(); } setTimeout(doc, 2000); ";
$formstuff=str_replace('" name="data"', ',[' . $loc[latitude] . ',' . $loc[longitude] . ',~' . str_replace("_"," ",explode("/",$zoneName)[1]) . '~]" name="data"', $formstuff);
} else {
$ourmapstuff=str_replace(">";
$suffix.="";
}
}
$selstuff.=$prefix . " " . $zoneName . " = " . $loc['comments'] . " ... " . $coffset . $suffix . " ";
$prefix="";
$suffix="";
}
}
}
$selstuff.=" | " . $yourmapstuff . "
";
$ididea="tzs";
//if (strpos($hprefix, "';
for ($xoff=-24.0; $xoff<=24.0; $xoff+=0.5) {
$selstuff=str_replace("", "", $selstuff);
}
$zones = timezone_identifiers_list();
foreach ($zones as $zone) {
$origzone=$zone;
//$ourtz=new DateTimeZone($zone);
$zone = explode('/', $zone); // 0 => Continent, 1 => City
// Only use "friendly" continent names
if ($zone[0] == 'Africa' || $zone[0] == 'America' || $zone[0] == 'Antarctica' || $zone[0] == 'Arctic' || $zone[0] == 'Asia' || $zone[0] == 'Atlantic' || $zone[0] == 'Australia' || $zone[0] == 'Europe' || $zone[0] == 'Indian' || $zone[0] == 'Pacific') {
if (isset($zone[1]) != '') {
//$locations[$zone[0]][$zone[0]. '/' . $zone[1]] = str_replace('_', ' ', $zone[1]); // Creates array(DateTimeZone => 'Friendly name')
//$ourtz=new DateTimeZone(str_replace('_', ' ', $zone[0]. '/' . $zone[1]));
//$selstuff=str_replace("", "", $selstuff);
//$selstuff=str_replace("", "", $selstuff);
$selstuff=str_replace("", "", $selstuff);
//$selstuff=str_replace("", "", $selstuff);
}
}
}
if (isset($_GET['tzname'])) {
if (strpos($selstuff, ("'" . urldecode($_GET['tzname']) . "'>")) !== false) {
$selstuff=str_replace(("'" . urldecode($_GET['tzname']) . "'>"),("'" . urldecode($_GET['tzname']) . "' selected>"),$selstuff);
}
}
return $selstuff;
}
echo "
TimeZone Places - RJM Programming - December, 2016 ... Thanks to http://php.net/manual/en/datetimezone.getlocation.php and http://stackoverflow.com/questions/17842003/php-intl-country-code-2-chars-to-country-name
var iam=" . $iam . ";
var iamleft=" . ((600 * ($iam - 1)) + 100) . ";
var arrmaplist=[], maplist='', lastmaplist='', mapdelim=';';
function great_circle_distance(talis, gnolis, latis, longis) {
var ourdist=0.0;
var rgnol=eval((gnolis) * Math.PI / 180.0);
var rtal=eval((talis) * Math.PI / 180.0);
var rlong=eval((longis) * Math.PI / 180.0);
var rlat=eval((latis) * Math.PI / 180.0);
var deltalong = Math.abs(eval(((gnolis)-(longis)) * Math.PI / 180.0));
var acof = eval(Math.sin(rtal) * Math.sin(rlat)) + (Math.cos(rtal) * Math.cos(rlat) * Math.cos(deltalong)); // via http://en.wikipedia.org/wiki/Great-circle_distance ... thanks
ourdist = eval(Math.round((Math.acos(acof) * 6371000.0) + 0.00001) * 100) / 100;
return ourdist;
}
function checkmailbox() {
var urlis='', ih='', jiarr=[], ijarr=[], ijcont='', ijplace='', jicont='', jiplace='';
//alert(99 + ' ' + maplist);
if (top.document.getElementById('mapphpmailbox').value != maplist) {
if (maplist.length > top.document.getElementById('mapphpmailbox').value.length) {
top.document.getElementById('mapphpmailbox').value=maplist;
} else {
maplist=top.document.getElementById('mapphpmailbox').value;
}
arrmaplist=maplist.split(mapdelim);
}
if (arrmaplist.length > 1) {
//alert(98);
if (document.getElementById('fromto') && lastmaplist != maplist) {
//alert(97);
lastmaplist=maplist;
ih=\"\";
//alert(ih);
for (var ij=0; ij' + ijplace.replace(/%20/g,' ') + ' to ' + jiplace.replace(/%20/g,' ') + ' ... ' + eval(great_circle_distance(ijarr[1], ijarr[2], jiarr[1], jiarr[2]) / 1000.0) + 'km ... ' + eval(eval(jiarr[3]) - eval(ijarr[3])) + ' hours difference';
}
}
}
document.getElementById('fromto').innerHTML=ih;
document.getElementById('fromto').style.display='inline';
}
}
setTimeout(checkmailbox, 3000);
}
function addtolist(nextarrmember) {
// alert(198);
if (top.document.getElementById('mapphpmailbox').value.indexOf(nextarrmember) == -1) {
// alert(197);
if (top.document.getElementById('mapphpmailbox').value != '') {
top.document.getElementById('mapphpmailbox').value+=mapdelim + nextarrmember;
} else {
top.document.getElementById('mapphpmailbox').value=nextarrmember;
}
maplist=top.document.getElementById('mapphpmailbox').value;
arrmaplist=maplist.split(mapdelim);
// alert(maplist);
}
}
function mapselchange(othis) {
if (othis.value.length > 0) {
window.open(othis.value,'_blank','top=10,left=10,width=1200,height=800');
}
}
function changetz(intz) { }
function changeiso(intz) { }
function newiframe(wht) {
document.getElementById('td' + wht).innerHTML='';
}
function fixforlocal() {
var dd=new Date();
var qw1=eval(eval((eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2]) - eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 100) + eval((0.0 + eval(dd.toTimeString().replace('-',' ').replace('+',' ').split(' ')[2] % 100)) / 60.0));
if (dd.toTimeString().indexOf('+') != -1) qw1=-qw1;
if (document.getElementById('stzs').innerHTML.indexOf(' value=\"\">') != -1) {
if (eval(0 - eval(qw1)) >= 0) {
document.getElementById('stzs').innerHTML=document.getElementById('stzs').innerHTML.replace(' value=\"\">Local', ' value=\"+' + eval(0 - eval(qw1)) + '\">Local');
document.getElementById('stzs').value='+' + eval(0 - eval(qw1));
} else {
document.getElementById('stzs').innerHTML=document.getElementById('stzs').innerHTML.replace(' value=\"\">Local', ' value=\"' + eval(0 - eval(qw1)) + '\">Local');
document.getElementById('stzs').value=eval(0 - eval(qw1));
}
}
var tds=document.getElementsByTagName('table');
for (var itds=0; itds') != -1) {
tds[itds].style.display='none';
}
}
}
" . $hprefix;
// TimeZone PlacesRJM ProgrammingDecember, 2016" . $hprefix;
$formstuff="";
if (isset($_GET['iso'])) {
$places="Places";
for ($ic=0; $ic', 'value="' . $_GET['iso'] . '">',str_replace('"' . $_GET['iso'] . '"', '"' . $_GET['iso'] . '" selected',$sellong));
$timeZones = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $_GET['iso']);
$prefix="";
$suffix="";
$ourmapstuff="";
$yourmapstuff="";
$formstuff="";
$ideais="tzs";
if ($_GET['iso'] == '' && isset($_GET['tzname'])) {
$ideais="szt";
} else {
foreach ( $timeZones as $key => $zoneName ) {
$otz = new DateTimeZone("Europe/London");
$tz = new DateTimeZone($zoneName);
$origin_dt = new DateTime("now", $otz);
$remote_dt = new DateTime("now", $tz);
$offset = ($tz->getOffset($remote_dt) - $otz->getOffset($origin_dt)) / 3600;
if ($offset < 0) {
$coffset=$offset;
} else {
$coffset="+" . $offset;
}
//
$loc = $tz->getLocation();
if ($ourmapstuff == "") {
$ourmapstuff=" | document.getElementById('smapif').click(); ";
$yourmapstuff=" | ";
//$formstuff=" function doc() { document.getElementById('smapif').click(); } setTimeout(doc, 2000); ";
$formstuff=" function doc() { document.getElementById('smapif').click(); } setTimeout(doc, 2000); ";
$formstuff=str_replace('" name="data"', ',[' . $loc[latitude] . ',' . $loc[longitude] . ',~' . str_replace("_"," ",explode("/",$zoneName)[1]) . '~]" name="data"', $formstuff);
} else {
$ourmapstuff=str_replace(">";
$suffix.="";
}
}
print($prefix . " " . $zoneName . " = " . $loc['comments'] . " ... " . $coffset . $suffix . " ");
$prefix="";
$suffix="";
}
}
//$yourmapstuff="";
print(" | " . $yourmapstuff . " ");
//print("" . " ");
}
if ($iam == "1") {
echo "";
}
echo "
" . $formstuff . $hsuffix . "
";
?>
|
|