Europe/Amsterdamoption value=\"Pacific/Fiji\" data-geo=\"-18.13334,178.41666,+12,FJ,+13\">Pacific/Fiji";
$setrange='';
$redplace=-1;
$redname='';
if (isset($_GET['ccode']) || isset($_POST['ccode'])) {
$mlls=[false,false,false,false];
$nextdone=false;
$nexttwodone=false;
$nextthreedone=false;
$nextfourdone=false;
$minlat=-90.0;
$minlong=-180.0;
$maxlat=90.0;
$maxlong=180.0;
$ucc='';
if (isset($_GET['ccode'])) {
$ucc=trim(str_replace('+',' ',urldecode($_GET['ccode'])));
} else if (isset($_POST['ccode'])) {
$ucc=trim(str_replace('+',' ',urldecode($_POST['ccode'])));
}
$succ='';
if (isset($_GET['clang']) || isset($_POST['clang'])) {
if (isset($_GET['clang'])) {
$succ=strtolower(trim(str_replace('+',' ',urldecode($_GET['clang'])))) . '.';
} else if (isset($_POST['ccode'])) {
$succ=strtolower(trim(str_replace('+',' ',urldecode($_POST['clang'])))) . '.';
}
if (strlen($succ) != 3) {
$succ='';
}
}
if (strlen($ucc) == 2) {
if (strpos($ourtzlist, ',' . $ucc . ',') !== false) {
$preohbit=explode(',' . $ucc . ',', $ourtzlist)[0];
$ohbit=explode('<', $preohbit)[-1 + sizeof(explode('<', $preohbit))];
if (strpos($ohbit, ' title="') !== false) {
$tbitis=explode('"', explode(' title="', $ohbit)[1])[0];
if (sizeof(explode(',', $tbitis)) == 4) {
$setrange=$tbitis;
}
}
}
if (strtoupper($ucc) == 'RU' || strtoupper($ucc) == 'SI') { $b='r'; }
$beworried=true;
$nine=9;
$seven=7;
$isbig=1;
for ($jk=0; $jk 1) {
$kkk=0;
for ($kk=0; $kk $maxlong) { $maxlong=min(180.0,($nine + $thislong)); }
if ($thislat < $minlat) { $minlat=max(-90.0,(-$seven + $thislat)); }
if ($thislat > $maxlat) { $maxlat=min(90.0,($seven + $thislat)); }
// echo ' ... ' . $thislong . ' ' . $maxlong;
}
}
}
if ($beworried && $nine == 9 && $seven == 7) {
$minlong=max(-180.0,(-9 + $minlong));
$maxlong=min(180.0,(9 + $maxlong));
$minlat=max(-90.0,(-7 + $minlat));
$maxlat=min(90.0,(7 + $maxlat));
$ptwo=explode(' data-geo="', $ourtzlist);
for ($kkk=1; $kkk $maxlong || $complat < $minlat || $complat > $maxlat) {
//if (abs($complong - $minlong) < 7 || abs($complong - $maxlong) < 7 || abs($complat - $minlat) < 7 || abs($complat - $maxlat) < 7) {
if (abs($complat - $minlat) < 7 || abs($complat - $maxlat) < 7) {
if ($complong < $minlong) { $mlls[0]=true; }
if ($complong > $maxlong) { $mlls[1]=true; }
if ($complat < $minlat) { $mlls[2]=true; }
if ($complat > $maxlat) { $mlls[3]=true; }
if (!$nextdone) {
if ($complong < $minlong) { $minlong=max(-180.0,(-1 + $complong)); }
if ($complong > $maxlong) { $maxlong=min(180.0,(1 + $complong)); }
if ($complat < $minlat) { $minlat=max(-90.0,(-1 + $complat)); }
if ($complat > $maxlat) { $maxlat=min(90.0,(1 + $complat)); }
$nextdone=true;
} else if (!$nexttwodone) {
if ($complong < $minlong) { $minlong=max(-180.0,(-1 + $complong)); }
if ($complong > $maxlong) { $maxlong=min(180.0,(1 + $complong)); }
if ($complat < $minlat) { $minlat=max(-90.0,(-1 + $complat)); }
if ($complat > $maxlat) { $maxlat=min(90.0,(1 + $complat)); }
$nexttwodone=true;
} else if (!$nextthreedone) {
if ($complong < $minlong) { $minlong=max(-180.0,(-1 + $complong)); }
if ($complong > $maxlong) { $maxlong=min(180.0,(1 + $complong)); }
if ($complat < $minlat) { $minlat=max(-90.0,(-1 + $complat)); }
if ($complat > $maxlat) { $maxlat=min(90.0,(1 + $complat)); }
$nextthreedone=true;
} else if (!$nextfourdone) {
if ($complong < $minlong) { $minlong=max(-180.0,(-1 + $complong)); }
if ($complong > $maxlong) { $maxlong=min(180.0,(1 + $complong)); }
if ($complat < $minlat) { $minlat=max(-90.0,(-1 + $complat)); }
if ($complat > $maxlat) { $maxlat=min(90.0,(1 + $complat)); }
if ($mlls[0] && $mlls[1] && $mlls[2] && $mlls[3]) {
$nextfourdone=true;
}
}
}
}
}
}
}
}
}
if ($setrange != '' && !isset($_GET['world']) && !isset($_POST['world'])) {
$url='http://chart.googleapis.com/chart?cht=map:fixed=' . $setrange . '&chs=600x350&chld=&chco=&chdl=';
} else {
$url='http://chart.googleapis.com/chart?cht=map:fixed=' . $minlat . ',' . $minlong . ',' . $maxlat . ',' . $maxlong . '&chs=600x350&chld=&chco=&chdl=';
}
$zero=explode(strtoupper($ucc) . '-', $iccs)[0];
$subi=explode('', substr($iccs, (-3 + strlen($zero))))[0]; //$subi=explode('', explode('', $subi);
$ru=-1;
$rl=-1;
if (isset($_GET['redregionquiz']) || isset($_POST['redregionquiz']) || strpos(('' . $_SERVER['QUERY_STRING']), 'redregionquiz') !== false) {
for ($ir=0; $ir= 0 && $ru >= 1) {
$redplace=max(1,rand($rl, $ru));
}
}
$sr=-1;
for ($ir=0; $ir', $therest);
$thisstate='';
//echo $therest;
//exit;
for ($jr=0; $jr', $therestbits[$jr])[(-1 + sizeof(explode('>', $therestbits[$jr])))]));
//if ($thistext != '') {
//echo $thiscode . $therest . ' ThistexT=' . $thistext;
//exit;
//}
if ($thisstate == '' && $thistext != $thiscode && trim(str_replace(' ','',$thistext)) != '' && substr(substr(($thistext . ' '),2),0,1) != '-') {
//if ($thistext != '') {
//echo 'Thistext=' . $thistext;
//exit;
//}
$thisstate=str_replace(' ','',$thistext);
}
}
if ($thisstate != '') {
$sr++;
//echo $thisstate;
//exit;
if (strtolower($ucc) == 'pJUNKl' && sizeof($rowsd) < 20 && $beworried) {
$relurl=explode('"', explode(' href="', explode($thisstate . '', $iccs)[0])[-1 + sizeof(explode(' href="', explode($thisstate . '', $iccs)[0]))])[0];
$interimurl='http://' . $succ . 'wikipedia.org' . $relurl;
$geostuff=file_get_contents($interimurl);
//file_put_contents('x.x', $interimurl . "\n" . $geostuff);
if (strpos($geostuff, ' class="latitude">') !== false) {
$xxlat=explode('<', explode(' class="latitude">', $geostuff)[1])[0];
//echo " lat is " . $xxlat;
if (strpos($xxlat, 'S') !== false) {
$thislat=(-1.0 * explode("°", $xxlat)[0]);
} else {
$thislat=(1.0 * explode("°", $xxlat)[0]);
}
//echo " Lat is " . $thislat;
$xxlong=explode('<', explode(' class="longitude">', $geostuff)[1])[0];
//echo " long is " . $xxlong;
if (strpos($xxlong, 'E') !== false) {
$thislong=(-1.0 * explode("°", $xxlong)[0]);
} else {
$thislong=(1.0 * explode("°", $xxlong)[0]);
}
//echo " Long is " . $thislong;
//exit;
if ($thislong < $minlong) { $minlong=max(-180.0,(-1 + $thislong)); }
if ($thislong > $maxlong) { $maxlong=min(180.0,(1 + $thislong)); }
if ($thislat < $minlat) { $minlat=max(-90.0,(-1 + $thislat)); }
if ($thislat > $maxlat) { $maxlat=min(90.0,(1 + $thislat)); }
//echo " minLong is " . $minlong;
//echo " minLat is " . $minlat;
//echo " maxLong is " . $maxlong;
//echo " maxLat is " . $maxlat;
//echo substr(explode(' class="latitude">', $geostuff)[1],0,40);
//exit;
}
}
$sixrand=$sixrs[rand(0, (-1 + sizeof($sixrs)))];
for ($kr=1; $kr<6; $kr++) {
$sixrand.=$sixrs[rand(0, (-1 + sizeof($sixrs)))];
}
if ($statecount != 0 && ($ir >= (-1 + $redplace))) { // || $sr >= (-1 + $redplace)) && $statecount != 0) {
if ($redname == '') {
$redname=$thisstate;
$sixrand='ff0000';
} else if ($sixrand == 'ff0000' && $redplace >= 0) {
$sixrand='ff7712';
} else if (substr($sixrand,0,1) == 'f' && $redplace >= 0) {
$sixrand='e' . substr($sixrand,1);
}
} else if ($sixrand == 'ff0000' && $redplace >= 0) {
$sixrand='ff7712';
} else if (substr($sixrand,0,1) == 'f' && $redplace >= 0) {
$sixrand='e' . substr($sixrand,1);
} else {
//echo $sixrand;
//exit;
$sixrand=str_replace('00ff00','22ff22',str_replace('ff0000','ff2222',str_replace('0000ff','2222ff',$sixrand)));
while (strpos($url, $sixrand) !== false) {
$sixrand=$sixrs[rand(0, (-1 + sizeof($sixrs)))];
for ($kr=1; $kr<6; $kr++) {
$sixrand.=$sixrs[rand(0, (-1 + sizeof($sixrs)))];
}
$sixrand=str_replace('00ff00','22ff22',str_replace('ff0000','ff2222',str_replace('0000ff','2222ff',$sixrand)));
}
}
if ($statecount == 0) {
if ($maxlat > 70.0) { $maxlat=80.0; }
if ($setrange != '' && !isset($_GET['world']) && !isset($_POST['world'])) {
$url='http://chart.googleapis.com/chart?' . $tbit . 'cht=map:fixed=' . $setrange . '&chdlp=' . $b . '&chs=600x450&chld=' . $thiscode . '&chco=' . '00ff00' . '|' . $sixrand . '&chdls=' . '00ff00' . '|' . $sixrand . ',6&chdl=' . urlencode($thisstate);
} else {
$url='http://chart.googleapis.com/chart?' . $tbit . 'cht=map:fixed=' . $minlat . ',' . $minlong . ',' . $maxlat . ',' . $maxlong . '&chdlp=' . $b . '&chs=600x450&chld=' . $thiscode . '&chco=' . '00ff00' . '|' . $sixrand . '&chdls=' . '00ff00' . '|' . $sixrand . ',6&chdl=' . urlencode($thisstate);
}
//echo $url;
//exit;
} else {
$url.='|' . urlencode($thisstate);
$url=str_replace('&chco=', '|' . $thiscode . '&chco=', $url);
$url=str_replace('&chdls=', '|' . $sixrand . '&chdls=', $url);
$url=str_replace('&chdl=', '|' . $sixrand . ',6&chdl=', $url);
//echo $url;
//exit;
}
$statecount++;
} //else {
//echo "oops";
//exit;
//}
}
}
$url=str_replace('&chco=', '|' . explode('-', $thiscode)[0] . '&chco=', $url);
$url=str_replace('&chdls=', '|' . '0000ff' . '&chdls=', $url);
$url=str_replace('&chdl=', '|' . '0000ff' . ',6&chdl=', $url);
if (isset($_GET['redregionquiz']) || isset($_POST['redregionquiz']) || strpos(('' . $_SERVER['QUERY_STRING']), 'redregionquiz') !== false) {
//if ($redname != '' &&
// (isset($_GET['cellnumber']) || isset($_POST['cellnumber']) &&
// (isset($_GET['chosencell']) || isset($_POST['chosencell'])) {
if ($redname != '' && strpos($url, 'chco=') !== false && strpos($url, 'chdl=') !== false && strpos($url, 'ff0000') !== false) {
$cols=explode('|', explode('&', explode('chco=', $url)[1])[0]);
$regs=explode('|', explode('&', explode('chdl=', $url)[1])[0]);
// http://chart.googleapis.com/chart?chtt=States+and+territories+of+Australia
//&cht=map:fixed=-61.5,106.85,-5.46667,162.03333&chdlp=b&chs=600x450
//&chld=AU-NSW|AU-QLD|AU-SA|AU-TAS|AU-VIC|AU-WA|AU-ACT|AU-NT
//&chco=74e311|3076e2|ff0000|e73dff|00c34f|02e46b|533845|d62b4a
//&chdls=74e311,6|3076e2,6|ff0000,6|e73dff,6|00c34f,6|02e46b,6|533845,6|d62b4a,6
//&chdl=New+South+Wales|Queensland|South+Australia|Tasmania|Victoria|Western+Australia|Australian+Capital+Territory|Northern+Territory
for ($icols=0; $icols