0.0) {
if ($minval == 0.0 || $minval > $outs) $minval=$outs;
if ($maxval == 0.0 || $maxval < $outs) $maxval=$outs;
}
if ($xrange == "") {
if (isset($_GET['min']) && isset($_GET['max'])) {
$xrange=" (" . $_GET['min'] . " <= " . $reportmode . " <= " . $_GET['max'] . ")";
} else if (isset($_GET['min'])) {
$xrange=" (" . $_GET['min'] . " <= " . $reportmode . ")";
} else if (isset($_GET['max'])) {
$xrange=" (" . $reportmode . " <= " . $_GET['max'] . ")";
}
}
if (isset($_GET['min']) && isset($_GET['max'])) {
if ($thisyear != $oneyear) { //$firstyear <= 0) {
if (str_replace("," . $thisc . ",","","," . $okvaluelist . ",") != "," . $okvaluelist . ",") {
return $outs;
} else {
$othercnt+=$outs;
return "0";
}
}
if ($outs < $_GET['min'] || $outs > $_GET['max']) {
$othercnt+=$outs;
return "0";
} else if ($thisyear == $oneyear && $valuelist != "") {
$vls=explode(",",$valuelist);
if (str_replace("," . $vls[0] . ",","","," . $okvaluelist . ",") == "," . $okvaluelist . ",") {
if ($okvaluelist == "") {
$okvaluelist=$vls[0];
} else {
$prevok=$okvaluelist;
$okvaluelist=$vls[0] . "," . $prevok;
}
}
}
} else if (isset($_GET['min'])) {
if ($thisyear != $oneyear) { //$firstyear <= 0) {
if (str_replace("," . $thisc . ",","","," . $okvaluelist . ",") != "," . $okvaluelist . ",") {
return $outs;
} else {
$othercnt+=$outs;
return "0";
}
}
if ($outs < $_GET['min']) {
$othercnt+=$outs;
return "0";
} else if ($thisyear == $oneyear && $valuelist != "") {
$vls=explode(",",$valuelist);
if (str_replace("," . $vls[0] . ",","","," . $okvaluelist . ",") == "," . $okvaluelist . ",") {
if ($okvaluelist == "") {
$okvaluelist=$vls[0];
} else {
$prevok=$okvaluelist;
$okvaluelist=$vls[0] . "," . $prevok;
}
}
}
} else if (isset($_GET['max'])) {
if ($thisyear != $oneyear) { //$firstyear <= 0) {
if (str_replace("," . $thisc . ",","","," . $okvaluelist . ",") != "," . $okvaluelist . ",") {
return $outs;
} else {
$othercnt+=$outs;
// if ($thisc != "China") {
// echo "
";
// exit;
// }
return "0";
}
}
if ($outs > $_GET['max']) {
$othercnt+=$outs;
return "0";
} else if ($thisyear == $oneyear && $valuelist != "") {
$vls=explode(",",$valuelist);
if (str_replace("," . $vls[0] . ",","","," . $okvaluelist . ",") == "," . $okvaluelist . ",") {
if ($okvaluelist == "") {
$okvaluelist=$vls[0];
} else {
$prevok=$okvaluelist;
$okvaluelist=$vls[0] . "," . $prevok;
}
}
}
}
return $outs;
}
function rangeget($basis) {
global $reportmode, $diffctrylst, $fyearis;
$cookie_name = "Worldbank_" . str_replace(" ","_",str_replace("(","_",str_replace(")","_",str_replace("%","_",str_replace(",","_",$reportmode))))) . "_" . $basis;
if (isset($_COOKIE[$cookie_name])) {
return $_COOKIE[$cookie_name];
}
return 0.0;
}
function rangeset($basis, $val) {
global $reportmode, $startswith, $diffctrylst, $fyearis;
if ($startswith == "") {
$cookie_name = "Worldbank_" . str_replace(" ","_",str_replace("(","_",str_replace(")","_",str_replace("%","_",str_replace(",","_",$reportmode))))) . "_" . $basis;
$cookie_value = $val;
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/PHP/"); // 86400 = 1 day
return $val;
}
return rangeget($basis);
}
function noe($inn) {
$zeroes="";
$neg="";
$zinn=$inn;
if (substr($inn,0,1) == '-') {
$neg="-";
$zinn=substr($inn,1);
}
$ninn=explode("E",$zinn);
if (sizeof($ninn) == 2) {
$qd=explode(".",$ninn[0]);
$hm=str_replace("+","",$ninn[1]);
if (sizeof($qd) == 1) {
for ($ii=1; $ii<=abs($hm); $ii++) {
$zeroes.="0";
}
if ($hm >= 0) {
return $neg . $qd[0] . $zeroes;
} else {
return $neg . "0." . $zeroes . $qd[0];
}
} else {
if ($hm >= 0) {
for ($ii=1; $ii<=(abs($hm) - strlen($qd[1])); $ii++) {
$zeroes.="0";
}
return $neg . $qd[0] . $qd[1] . $zeroes;
} else {
for ($ii=1; $ii<=(abs($hm) - strlen($qd[0])); $ii++) {
$zeroes.="0";
}
return $neg . "0." . $zeroes . $qd[0] . $qd[1];
}
}
}
return $inn;
}
function thesmallest($y1, $y2) {
if (strpos($y2, "-") !== false) {
return min($y1, -$y2);
} else if ($y2 != "") {
return $y1; //min($y1, $y2);
}
return $y1;
}
function thebiggest($y1, $y2) {
if (strpos($y2, "-") !== false) {
return max($y1, -$y2);
} else if ($y2 != "") {
return $y1; //max($y1, $y2);
}
return $y1;
}
function andto($y1, $y2, $otheridea) {
global $xrange, $diffctrylst, $fyearis;
if (thebiggest($y1, $y2) != thesmallest($y1, $y2)) {
if (strpos($y2, "-") !== false) {
return thesmallest($y1, $y2) . " to " . thebiggest($y1, $y2) . $xrange;
} else {
return $y2 . " and " . $y1 . $xrange;
}
}
return str_replace("%2d","",str_replace("%2D","",str_replace("-","",str_replace($y1 . " and " . $y2,$y2 . " and " . $y1,str_replace($y1 . "%20and%20" . $y2,$y2 . "%20and%20" . $y1,$otheridea)))));
}
$minval=0.0;
$maxval=0.0;
$thisc="";
$xrange="";
$lookforis="Population, tot";
$reportmode="Population";
$reportmode2="Population";
$indicator="SP.POP.TOTL";
$cn="Pie Chart";
$idata2="";
$udiff="";
$ddiff="";
$page=1;
$valuelist="";
$okvaluelist="";
$firstyear=-1;
$oneyear=0;
$thisyear=0;
$valuedelim="";
$othercnt=0;
$pagecontent="";
$poplist="";
$popdelim=",%20";
$idelim="Afghanistan<';
//$lookingfor='"AF"';
$zero=0;
$one=1;
$eight=8;
$cdelim="<";
$prevc="";
$ddelim='';
$wf="600px";
$recit=false;
$regexpok=1;
if (isset($_GET['regex']) || isset($_POST['regex'])) {
$right="right"; //"RIGHT";
} else {
$right="right";
}
if (isset($_GET['indicator'])) {
$indicator=str_replace('+',' ', urldecode($_GET['indicator']));
if ($indicator != "") {
$reportmode=str_replace("IC.REG.DURS","Time required to start a business (days)",str_replace("EN.POP.DNST","Population density (people per sq. km of land area)",str_replace("SL.TLF.TOTL.IN","Labor Force, Total",str_replace("IS.RRS.TOTL.KM","Rail Lines (total route-km)",str_replace("SH.MED.BEDS.ZS","Hospital Beds (per 1,000 people)",str_replace("SP.DYN.TFRT.IN","Fertility rate, total (births per woman)",str_replace("AG.LND.AGRI.K2","Agricultural Land (sq km)",str_replace("AG.LND.FRST.K2","Forest Area (sq km)",str_replace("EG.ELC.ACCS.ZS","Access to electricity (% of population)",str_replace("NY.GDP.MKTP.CD","Gross Domestic Product",$indicator))))))))));
$reportmode2=str_replace("IC.REG.DURS","Time required to start a business (days)",str_replace("EN.POP.DNST","Population density (people per sq. km of land area)",str_replace("SL.TLF.TOTL.IN","Labor Force, Total",str_replace("IS.RRS.TOTL.KM","Rail Lines (total route-km)",str_replace("SH.MED.BEDS.ZS","Hospital Beds (per 1,000 people)",str_replace("SP.DYN.TFRT.IN","Fertility rate, total (births per woman)",str_replace("AG.LND.AGRI.K2","Agricultural Land (sq km)",str_replace("AG.LND.FRST.K2","Forest Area (sq km)",str_replace("EG.ELC.ACCS.ZS","Access to electricity (% of population)",str_replace("NY.GDP.MKTP.CD","Gross Domestic Product (US$)",$indicator))))))))));
$lookforis=str_replace("IC.REG.DURS","Time required",str_replace("EN.POP.DNST","Population density",str_replace("SL.TLF.TOTL.IN","Labor force",str_replace("IS.RRS.TOTL.KM","Rail line",str_replace("SH.MED.BEDS.ZS","Hospital beds",str_replace("SP.DYN.TFRT.IN","Fertility rate",str_replace("AG.LND.AGRI.K2","Agricultural land (",str_replace("AG.LND.FRST.K2","Forest area (s",str_replace("EG.ELC.ACCS.ZS","Access to electricity (",str_replace("NY.GDP.MKTP.CD","GDP (current US",$indicator))))))))));
if (isset($_GET['inddesc'])) {
$reportmode=str_replace('+',' ', urldecode($_GET['inddesc']));
$reportmode2=$reportmode;
$lookforis=trim(explode(',', explode(' (', $reportmode)[0])[0]);
}
if ($indicator == strtoupper($reportmode)) {
$huhpg=file_get_contents('http://data.worldbank.org/indicator/');
$hggs=explode('/' . $indicator . '?view=chart', $huhpg);
if (sizeof($hggs) > 1) {
$preifis=" fromto('" . explode('>', explode('<', $hggs[1])[0])[1] . "'); ";
$reportmode=explode('>', explode('<', $hggs[1])[0])[1];
$reportmode2=$reportmode;
$lookforis=trim(explode(',', explode(' (', $reportmode)[0])[0]);
}
}
if (strpos($reportmode,"Forest area (s") !== false) { $recit=true; }
}
}
if (isset($_POST['indicator'])) {
$indicator=str_replace('+',' ', urldecode($_POST['indicator']));
if ($indicator != "") {
$reportmode=str_replace("IC.REG.DURS","Time required to start a business (days)",str_replace("EN.POP.DNST","Population density (people per sq. km of land area)",str_replace("SL.TLF.TOTL.IN","Labor Force, Total",str_replace("IS.RRS.TOTL.KM","Rail Lines (total route-km)",str_replace("SH.MED.BEDS.ZS","Hospital Beds (per 1,000 people)",str_replace("SP.DYN.TFRT.IN","Fertility rate, total (births per woman)",str_replace("AG.LND.AGRI.K2","Agricultural Land (sq km)",str_replace("AG.LND.FRST.K2","Forest Area (sq km)",str_replace("EG.ELC.ACCS.ZS","Access to electricity (% of population)",str_replace("NY.GDP.MKTP.CD","Gross Domestic Product",$indicator))))))))));
$reportmode2=str_replace("IC.REG.DURS","Time required to start a business (days)",str_replace("EN.POP.DNST","Population density (people per sq. km of land area)",str_replace("SL.TLF.TOTL.IN","Labor Force, Total",str_replace("IS.RRS.TOTL.KM","Rail Lines (total route-km)",str_replace("SH.MED.BEDS.ZS","Hospital Beds (per 1,000 people)",str_replace("SP.DYN.TFRT.IN","Fertility rate, total (births per woman)",str_replace("AG.LND.AGRI.K2","Agricultural Land (sq km)",str_replace("AG.LND.FRST.K2","Forest Area (sq km)",str_replace("EG.ELC.ACCS.ZS","Access to electricity (% of population)",str_replace("NY.GDP.MKTP.CD","Gross Domestic Product (US$)",$indicator))))))))));
$lookforis=str_replace("IC.REG.DURS","Time required",str_replace("EN.POP.DNST","Population density",str_replace("SL.TLF.TOTL.IN","Labor force",str_replace("IS.RRS.TOTL.KM","Rail line",str_replace("SH.MED.BEDS.ZS","Hospital beds",str_replace("SP.DYN.TFRT.IN","Fertility rate",str_replace("AG.LND.AGRI.K2","Agricultural land (s",str_replace("AG.LND.FRST.K2","Forest area (s",str_replace("EG.ELC.ACCS.ZS","Access to electricity (",str_replace("NY.GDP.MKTP.CD","GDP (current US",$indicator))))))))));
if (isset($_POST['inddesc'])) {
$reportmode=str_replace('+',' ', urldecode($_POST['inddesc']));
$reportmode2=$reportmode;
$lookforis=trim(explode(',', explode(' (', $reportmode)[0])[0]);
}
if ($indicator == strtoupper($reportmode)) {
$huhpg=file_get_contents('http://data.worldbank.org/indicator/');
$hggs=explode('/' . $indicator . '?view=chart', $huhpg);
if (sizeof($hggs) > 1) {
$preifis=" fromto('" . explode('>', explode('<', $hggs[1])[0])[1] . "'); ";
$reportmode=explode('>', explode('<', $hggs[1])[0])[1];
$reportmode2=$reportmode;
$lookforis=trim(explode(',', explode(' (', $reportmode)[0])[0]);
}
}
if (strpos($reportmode,"Forest area (s") !== false) { $recit=true; }
}
}
if (isset($_GET['year'])) $year=$_GET['year'];
if (isset($_POST['year'])) $year=$_POST['year'];
if (isset($_GET['yearvs'])) $yearvs=str_replace("%2d","-",str_replace("%2D","-",$_GET['yearvs']));
if (isset($_POST['yearvs'])) $yearvs=str_replace("%2d","-",str_replace("%2D","-",$_POST['yearvs']));
if (isset($_GET['yearvs'])) $xyearvs=" and " . str_replace("%2d","",str_replace("%2D","",str_replace("-","",$_GET['yearvs'])));
if (isset($_POST['yearvs'])) $xyearvs=" and " . str_replace("%2d","",str_replace("%2D","",str_replace("-","",$_POST['yearvs'])));
$zrange=our_str_replace("decimal","0","decimal0");
$tbit=andto($year, $yearvs, $year . $xyearvs . $xrange);
$preudiff="//www.rjmprogramming.com.au/PHP/PieChart/pie_chart";
if (strpos($yearvs, "-") !== false) {
$mopt="";
$preudiff="//www.rjmprogramming.com.au/PHP/LineChart/line_chart";
$cn="Line Chart";
if (isset($_GET['chart'])) {
if (strpos(strtolower($_GET['chart']), "column") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/ColumnChart/column_chart";
$cn="Column Chart";
} else if (strpos(strtolower($_GET['chart']), "bar") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/BarChart/bar_chart";
$cn="Bar Chart";
} else if (strpos(strtolower($_GET['chart']), "area") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/AreaChart/area_chart";
$cn="Area Chart";
}
}
if (isset($_POST['chart'])) {
if (strpos(strtolower($_POST['chart']), "column") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/ColumnChart/column_chart";
$cn="Column Chart";
} else if (strpos(strtolower($_POST['chart']), "bar") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/BarChart/bar_chart";
$cn="Bar Chart";
} else if (strpos(strtolower($_POST['chart']), "area") !== false) {
$preudiff="//www.rjmprogramming.com.au/PHP/AreaChart/area_chart";
$cn="Area Chart";
}
}
} else if ($yearvs != "") {
$onclick="";
$wf="900px";
$udiff="_diff";
if (strpos($preudiff, "pie_chart") !== false) {
$mopt.="&moreopt=" . urlencode(' width: ' . $widea . ', height: 1200, chartArea: { width: "86%", height: "70%" }, legend: { position: "' . $right . '" }, ');
}
$ddiff="&data0=";
$idata2="";
}
$startswith='';
if (isset($_GET['startswith'])) $startswith=urldecode($_GET['startswith']);
if (isset($_POST['startswith'])) $startswith=urldecode($_POST['startswith']);
$url=$preudiff . $udiff . ".php?title=" . str_replace("+","%20",urlencode($reportmode2)) . "%20by%20World%20Country%20" . $startswith . "%20for%20Year%20" . urldecode(andto($year, $yearvs, $year . $xyearvs . $xrange)) . $mopt . "&onclick=y&label=Year&value=&task=" . str_replace("+","%20",urlencode($reportmode)) . "&desc=" . str_replace("+","%20",urlencode($reportmode)) . "&data=";
$urlextra="";
$tso=thesmallest($year, $yearvs);
$tbo=thebiggest($year, $yearvs);
while (strpos($pagecontent, $origpc) !== false) {
//file_put_contents('x.x', "http://api.worldbank.org/countries/all/indicators/" . $indicator . "?format=json&date=" . $tso . ":" . $tbo . "&page=" . $page);
//if (!file_exists('xx.xx')) { file_put_contents('xx.xx', "http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $tso . ":" . $tbo . "&page=" . $page); }
if ($tso == $tbo) {
$pagecontent=@file_get_contents("http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $tso . ":" . $tbo . "&page=" . $page);
} else {
//if (!file_exists('xxxxx.xxxxx')) { file_put_contents('xxxxx.xxxxx', "http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $tso . ":" . $tbo . "&page=" . $page); }
$pagecontent=@file_get_contents("http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $tso . ":" . $tbo . "&page=" . $page);
}
$pagecontent=str_replace("People's", "People`s", str_replace("'Ivoire", "`Ivoire", $pagecontent));
//if ($recit) {
// if (!file_exists("aaxx3.txt")) { file_put_contents("aaxx3.txt", $pagecontent); }
//}
if (strpos($pagecontent, $idelim) === false) {
$idelim=$lookforis; //"Population, tot";
$jdelim=$lookforis; //"Population, tot";
$ddelim='"';
$lookingfor='"Afghanistan"';
$lookingfor='>Afghanistan<';
//$lookingfor='"AF"';
$cdelim=',"value":"';
$zero=10;
$one=14;
$eight=22;
if ($tso != $tbo) {
$ddelim='', '0.0',$entries[$i]);
if ($lookingfor != "") {
if (str_replace($lookingfor, '', $entries[$i]) != $entries[$i]) $lookingfor="";
}
if ($lookingfor == "" && strpos($entries[$i], $ddelim) !== false) {
$pentries=explode($ddelim, $entries[$i]);
//if (!file_exists('xxxx.xxxx')) {
// file_put_contents('xxxx.xxxx', $pagecontent . "\n\n\n" . $entries[$i] . "\n\n\nddelim=" . $ddelim . "\n\n" . " zero (country?) is " . $zero . " vs " . $pentries[$zero] . " one (decimal) is " . $one . " vs " . $pentries[$one] . " eight (year?) is " . $eight . " vs " . $pentries[$eight]);
//}
$regexpok=1;
if (isset($_GET['regex'])) {
$thisc=str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))));
$regexp="/" . urldecode($_GET['regex']) . "/i";
//echo $regexp . " " . $thisc . " " . preg_match($regexp,$thisc) . " " . preg_match($regexp,urldecode($thisc));
//$regexpok=1;
//if ($regexpok != 0) echo " xxxx";
//exit;
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
} else if (isset($_POST['regex'])) {
$thisc=str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))));
$regexp="/" . urldecode($_POST['regex']) . "/i";
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
}
if (substr($entries[$i],2,2) == '">') { $subi=4; }
$aswell=true;
if ($startswith != '') {
if (strpos($entries[$i], "<") !== false) {
$aswell=false;
if (strpos(explode('<', $entries[$i])[0], '>' . strtoupper($startswith)) !== false) { $aswell=true; }
}
}
if ($regexpok != 0 && $aswell && (strpos('*' . explode("<", str_replace('">', '', substr($entries[$i],$subi)))[0], '*' . $startswith) !== false || strpos('*' . $pentries[$zero], '*' . $startswith) !== false)) {
if ($idelim == $lookforis) {
if (strpos($yearvs, "-") !== false) {
$prevc="," . $valuelist . ",";
$thisc=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero])))));
if (strpos($prevc, "," . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))) . ",") === false) {
$prevc=$valuelist;
$valuelist=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))) . $valuedelim . $prevc;
$valuedelim=",";
//echo $valuelist;
} //else {
//echo str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero])))) . " vs " . $prevc;
//}
if (strpos($entries[$i], '') !== false) {
$thisyear=explode('', explode('', $entries[$i])[1])[0];
} else if ($pentries[$one] == "decimal") {
$thisyear=$pentries[6 + $one];
} else {
$thisyear=$pentries[$eight];
}
if ($firstyear < 0) {
$firstyear=$thisyear;
$oneyear=$thisyear;
} else if ($thisyear != $oneyear) {
$firstyear=0;
}
if ($poplist == "") {
for ($jy=$tso; $jy<=$tbo; $jy++) {
//if ($poplist != '') { $fyearis=false; }
$poplist.=$popdelim . "[~" . $jy . "~]";
}
}
if (strpos($poplist, "~" . $thisyear . "~") !== false) {
if ($regexpok != 0) {
if (strpos($entries[$i], '', '0.0',$entries[$i]);
}
if (strpos($entries[$i], '') === false) {
if ($fyearis && strpos("," . trim($diffctrylst) . ",", "," . explode('"', $entries[$i])[0] . ",") === false) {
if ($diffctrylst == '') { $diffctrylst=' ' . explode('"', $entries[$i])[0]; } else { $diffctrylst.=',' . explode('"', $entries[$i])[0]; }
}
$poplist=str_replace("[~" . $thisyear . "~", "[~" . $thisyear . "~," . explode('', explode('', $entries[$i])[1])[0], $poplist);
}
} else {
//if (!file_exists('xx5xx.xx5xx')) { file_put_contents('xx5xx.xx5xx', $entries[$i]); }
$poplist=str_replace("[~" . $thisyear . "~", "[~" . $thisyear . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]), $poplist);
}
}
} else {
$prevc=$poplist;
if ($regexpok != 0) {
if (strpos($entries[$i], '', '0.0',$entries[$i]);
}
if (strpos($entries[$i], '') === false) {
if ($fyearis && strpos("," . trim($diffctrylst) . ",", "," . explode('"', $entries[$i])[0] . ",") === false) {
if ($diffctrylst == '') { $diffctrylst=' ' . explode('"', $entries[$i])[0]; } else { $diffctrylst.=',' . explode('"', $entries[$i])[0]; }
}
$poplist=$popdelim . "[~" . $thisyear . "~," . explode('', explode('', $entries[$i])[1])[0] . "]" . $prevc;
}
} else {
//if (!file_exists('xx6xx.xx6xx')) { file_put_contents('xx6xx.xx6xx', $entries[$i]); }
$poplist=$popdelim . "[~" . $thisyear . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]) . "]" . $prevc;
}
}
}
} else {
if ($regexpok != 0) {
//echo "2 " . $regexpok . " ... " . $regexp . " " . $thisc . " " . str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))));
//exit;
if (strpos($entries[$i], '') === false) {
$enick=str_replace("'Ivoire", "`Ivoire", $entries[$i]);
$poplist.=$popdelim . "[~" . explode('>', explode('', $enick)[0])[-1 + sizeof(explode('>', explode('', $enick)[0]))] . '~,' . explode('', explode('', $entries[$i])[1])[0] . "]";
}
} else {
$poplist.=$popdelim . "[~" . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))) . "~," . our_str_replace("decimal","0",$pentries[$one]) . "]";
}
}
}
} else {
if (strpos($yearvs, "-") !== false) {
$prevc="," . $valuelist . ",";
$thisc=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0]))));
$regexpok=1;
if (isset($_GET['regex'])) {
$thisc=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))); //new
$regexp="/" . urldecode($_GET['regex']) . "/i";
//echo $regexp . " " . $thisc . " " . preg_match($regexp,$thisc) . " " . preg_match($regexp,urldecode($thisc));
//exit;
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
} else if (isset($_POST['regex'])) {
$thisc=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))); // new
$regexp="/" . urldecode($_POST['regex']) . "/i";
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
}
if (strpos($prevc, "," . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0])))) . ",") === false) {
$prevc=$valuelist;
$valuelist=retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0])))) . $valuedelim . $prevc;
$valuedelim=",";
//echo $valuelist;
} //else {
//echo str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0]))) . " vs " . $prevc;
//}
if (strpos($entries[$i], '') !== false) {
$thisyear=explode('', explode('', $entries[$i])[1])[0];
} else if ($pentries[$one] == "decimal") {
$thisyear=$pentries[6 + $one];
} else {
$thisyear=$pentries[$eight];
}
if ($firstyear < 0) {
$firstyear=$thisyear;
$oneyear=$thisyear;
} else if ($thisyear != $oneyear) {
$firstyear=0;
}
if ($poplist == "") {
for ($jy=$tso; $jy<=$tbo; $jy++) {
//if ($poplist != '') { $fyearis=false; }
$poplist.=$popdelim . "[~" . $jy . "~]";
}
}
if (strpos($poplist, "~" . $thisyear . "~") !== false) {
if ($regexpok != 0) {
if (strpos($entries[$i], '', '0.0',$entries[$i]);
}
if (strpos($entries[$i], '') === false) {
if ($fyearis && strpos("," . trim($diffctrylst) . ",", "," . explode('"', $entries[$i])[0] . ",") === false) {
if ($diffctrylst == '') { $diffctrylst=' ' . explode('"', $entries[$i])[0]; } else { $diffctrylst.=',' . explode('"', $entries[$i])[0]; }
}
$poplist=str_replace("[~" . $thisyear . "~", "[~" . $thisyear . "~," . explode('', explode('', $entries[$i])[1])[0], $poplist);
}
} else {
//if (!file_exists('xx7xx.xx7xx')) { file_put_contents('xx7xx.xx7xx', $entries[$i]); }
$poplist=str_replace("[~" . $thisyear . "~", "[~" . $thisyear . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]), $poplist);
}
}
} else {
$prevc=$poplist;
if ($regexpok != 0) {
if (strpos($entries[$i], '', '0.0',$entries[$i]);
}
if (strpos($entries[$i], '') === false) {
if ($fyearis && strpos("," . trim($diffctrylst) . ",", "," . explode('"', $entries[$i])[0] . ",") === false) {
if ($diffctrylst == '') { $diffctrylst=' ' . explode('"', $entries[$i])[0]; } else { $diffctrylst.=',' . explode('"', $entries[$i])[0]; }
}
$poplist=$popdelim . "[~" . $thisyear . "~," . explode('', explode('', $entries[$i])[1])[0] . "]" . $prevc;
}
} else {
//if (!file_exists('xx8xx.xx8xx')) { file_put_contents('xx8xx.xx8xx', $entries[$i]); }
$poplist=$popdelim . "[~" . $thisyear . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]) . "]" . $prevc;
}
}
}
} else {
if ($regexpok != 0) {
//echo "1 " . $thisc;
//exit;
//if (!file_exists('xx.xx')) {
//file_put_contents('xx.xx', ' ' . $poplist . ' ' . str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0])))); //'" . str_replace('&value=&','&value=' . str_replace('%2c','',str_replace('%2C','',str_replace("%09","%20",$valuelist))) . '&',explode("&data=",$url)[0]) . "&data=' + url + '" . $urlextra . "');
//}
if (strpos($entries[$i], '') === false) {
$enick=str_replace("'Ivoire", "`Ivoire", $entries[$i]);
$poplist.=$popdelim . "[~" . explode('>', explode('', $enick)[0])[-1 + sizeof(explode('>', explode('', $enick)[0]))] . '~,' . explode('', explode('', $entries[$i])[1])[0] . "]";
}
} else {
$poplist.=$popdelim . "[~" . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0])))) . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]) . "]";
}
}
}
}
$popdelim=",%20";
} else if (strpos($yearvs, "-") === false) {
if ($idelim == $lookforis) {
$othercnt+=str_replace("decimal","0",$pentries[$one]);
} else {
$othercnt+=str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]);
}
}
}
}
$pagecontent=$origpc; //" 0 && !isset($_GET['justletters']) && !isset($_POST['justletters'])) {
$url.=ourfilter($poplist) . $popdelim . "[~Non-" . $startswith . "~," . noe($othercnt) . "]";
} else {
$url.=ourfilter($poplist);
}
if (strpos($yearvs, "-") !== false) $yearvs="";
$page=1;
$pagecontent=$origpc; //"';
$poplist="";
$popdelim=",%20";
$idelim="Afghanistan<';
//$lookingfor='"AF"';
if ($yearvs != "") {
$urlextra="&data0=";
while (strpos($pagecontent, $origpc) !== false) {
//if (!file_exists('x.x')) { file_put_contents('x.x', "http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $yearvs . ":" . $yearvs . "&page=" . $page); }
$pagecontent=@file_get_contents("http://api.worldbank.org/v2/countries/all/indicators/" . $indicator . "?format=xml&date=" . $yearvs . ":" . $yearvs . "&page=" . $page);
$pagecontent=str_replace("People's", "People`s", str_replace("'Ivoire", "`Ivoire", $pagecontent));
//if ($recit) {
// if (!file_exists("aaxx3.txt")) { file_put_contents("aaxx3.txt", $pagecontent); }
//}
if (strpos($pagecontent, $idelim) === false) {
$idelim=$lookforis; //"Population, tot";
$jdelim=$lookforis; //"Population, tot";
$ddelim='"';
$lookingfor='"Afghanistan"';
$lookingfor='>Afghanistan<';
//$lookingfor='"AF"';
$cdelim=',"value":"';
$zero=10;
$one=14;
$eight=22;
$pagecontent=str_replace(':null',':"0"',$pagecontent);
}
if (strpos($pagecontent, $idelim) !== false) {
$entries=explode($jdelim, $pagecontent);
for ($i=1; $i', '0.0',$entries[$i]);
if ($lookingfor != "") {
if (str_replace($lookingfor, '', $entries[$i]) != $entries[$i]) $lookingfor="";
}
if ($lookingfor == "" && strpos($entries[$i], $ddelim) !== false) {
$pentries=explode($ddelim, $entries[$i]);
$regexpok=1;
if (isset($_GET['regex'])) {
$thisc=str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))));
$regexp="/" . urldecode($_GET['regex']) . "/i";
//echo $regexp . " " . $thisc . " " . preg_match($regexp,$thisc) . " " . preg_match($regexp,urldecode($thisc));
//$regexpok=1;
//if ($regexpok != 0) echo " xxxx";
//exit;
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
} else if (isset($_POST['regex'])) {
$thisc=str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))));
$regexp="/" . urldecode($_POST['regex']) . "/i";
$regexpok=preg_match($regexp,$thisc);
//if (preg_match($regexp,$thisc)) $regexpok=preg_match($regexp,$thisc);
}
if (substr($entries[$i],2,2) == '">') { $subi=4; }
$aswell=true;
if ($startswith != '') {
if (strpos($entries[$i], "<") !== false) {
$aswell=false;
if (strpos(explode('<', $entries[$i])[0], '>' . strtoupper($startswith)) !== false) { $aswell=true; }
}
}
if ($regexpok != 0 && $aswell && (strpos('*' . explode("<", str_replace('">', '', substr($entries[$i],$subi)))[0], '*' . $startswith) !== false || strpos('*' . $pentries[$zero], '*' . $startswith) !== false)) {
if ($idelim == $lookforis) {
if ($regexpok != 0) {
if (strpos($entries[$i], '') === false) {
$enick=str_replace("'Ivoire", "`Ivoire", $entries[$i]);
$poplist.=$popdelim . "[~" . explode('>', explode('', $enick)[0])[-1 + sizeof(explode('>', explode('', $enick)[0]))] . '~,' . explode('', explode('', $entries[$i])[1])[0] . "]";
}
} else {
$poplist.=$popdelim . "[~" . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",urlencode($pentries[$zero]))))) . "~," . our_str_replace("decimal","0",$pentries[$one]) . "]";
}
}
} else {
if ($regexpok != 0) {
if (strpos($entries[$i], '') === false) {
$enick=str_replace("'Ivoire", "`Ivoire", $entries[$i]);
$poplist.=$popdelim . "[~" . explode('>', explode('', $enick)[0])[-1 + sizeof(explode('>', explode('', $enick)[0]))] . '~,' . explode('', explode('', $entries[$i])[1])[0] . "]";
}
} else {
$poplist.=$popdelim . "[~" . retflagflag(str_replace("%27","",str_replace(".","",str_replace("+","%20",explode('"', explode($cdelim, str_replace('">', '', urlencode($entries[$i])))[$zero])[0])))) . "~," . our_str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]) . "]";
}
}
}
$popdelim=",%20";
} else {
if ($idelim == $lookforis) {
$othercnt+=str_replace("decimal","0",$pentries[$one]);
} else {
$othercnt+=str_replace("decimal","0",explode($cdelim, $pentries[$one])[0]);
}
}
}
}
$pagecontent=$origpc; //"";
// exit;
$valuelist=$okvaluelist;
$poplist=str_replace(",0","",$poplist);
$urlextra=str_replace(",0","",$urlextra);
$url=str_replace(",0","",$url);
}
if ($othercnt > 0 && !isset($_GET['justletters']) && !isset($_POST['justletters'])) {
$urlextra.=$poplist . $popdelim . "[~Non-" . $startswith . "~," . $othercnt . "]";
$idata2="";
} else if ($poplist != "") {
$urlextra.=$poplist;
$idata2="";
}
echo "World Bank API " . $reportmode . " Data Google Chart " . $cn . " - RJM Programming - February, 2016
var butis='mysubmit';
var repj=\"" . $reportmode . "\";
var repfrom=' action=\"//www.';
var diffcountrylist=\"" . $diffctrylst . "\";
diffcountrylist=lorflags(diffcountrylist);
var difffirsttcountrylist=(diffcountrylist.split(',')[0] + '~').trim().replace('~',' ');
var repto=' action=\"https://www.';
var url='" . explode("&data=",$url)[1] . "';
var urlextra=\"" . str_replace('"','" + String.fromCharCode(34) + "',$urlextra) . "\";
function lorflags(thiscclist) {
var isos=thiscclist.trim().split(',');
for (var jsa=0; jsa 750) {
document.getElementById('myiframe').style.display='block';
document.getElementById('data').value=decodeURIComponent(url);
document.getElementById('mysubmit').click();
} else if (url != '') {
document.getElementById('myiframe').style.display='block';
document.body.style.cursor='progress';
document.getElementById('myiframe').src='" . str_replace('&value=&','&value=' . str_replace('%2c','',str_replace('%2C','',str_replace("%09","%20",$valuelist))) . '&',explode("&data=",$url)[0]) . "&data=' + url + '" . $urlextra . "';
}
return true;
}
function shareviasms() {
var prefix=document.getElementById('aemail').href.split('body=');
if (('' + prefix[0] + 'body=' + encodeURIComponent(document.URL)).length <= 750) {
document.getElementById('aemail').href=prefix[0].replace('mailto:','sms:') + 'body=' + encodeURIComponent(document.URL);
document.getElementById('aemail').click();
} else {
var huhemail=prompt('Please enter email address to send email to', '');
if (huhemail == null) { huhemail=''; }
if (huhemail.indexOf('@') != -1) {
document.getElementById('tdto').value=huhemail;
document.getElementById('tdhuhta').value='' + document.body.innerHTML.replace(' onsubmit=', ' data-onsubmit=').replace(repfrom,repto) + '';
document.getElementById('fsubm').click();
}
}
}
function shareviaemail() {
var prefix=document.getElementById('aemail').href.split('body=');
if (('' + prefix[0] + 'body=' + encodeURIComponent(document.URL)).length <= 750) {
document.getElementById('aemail').href=prefix[0].replace('sms:','mailto:') + 'body=' + encodeURIComponent(document.URL);
document.getElementById('aemail').click();
} else {
var huhemail=prompt('Please enter email address to send email to', '');
if (huhemail == null) { huhemail=''; }
if (huhemail.indexOf('@') != -1) {
document.getElementById('tdto').value=huhemail;
document.getElementById('tdhuhta').value='' + document.body.innerHTML.replace(' onsubmit=', ' data-onsubmit=').replace(repfrom,repto) + '';
document.getElementById('fsubm').click();
}
}
}
World Bank API " . $reportmode . " Data Google Chart " . $cn . " 📧 📟
RJM Programming - February, 2016
Share via Email
";
?>