data"; $suff = "countries"; $yesh1 = " "; $thing = "country"; $thw = ""; $thingtwo = "results"; $suffix = ""; $selname = ""; $ititle = " ... Worldbank Countries"; if (isset($_POST['noh1'])) $yesh1 = ""; if (isset($_GET['noh1'])) $yesh1 = ""; if (isset($_POST['selname'])) $selname = str_replace(" ","%20",$_POST['selname']); if (isset($_GET['selname'])) $selname = str_replace(" ","%20",$_GET['selname']); if (isset($_POST['mode'])) $suffix = str_replace(" ","%20",$_POST['mode'] . $altsuffix); if (isset($_GET['mode'])) $suffix = str_replace(" ","%20",$_GET['mode'] . $altsuffix); if ($suffix != "") $suff = $alttsuff; if ($suffix != "") $ititle = $alttitle; if ($suffix != "") $thing = $altthing; if ($suffix != "") $thingtwo = $altthingtwo; $bcolours = array("white", "pink", "aqua", "lime", "silver", "lightyellow", "cyan", "fuchsia", "orange", "lightblue", "lightgreen", "lightgray"); if ($selname != "") { date_default_timezone_set('London/England'); $date = date('d/m/Y h:i:s a', time()) . " GMT"; $pageContent = file_get_contents("https://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20worldbank." . $suff . "%20WHERE%20country_id%20%3D%20'" . $selname . "'%20" . $suffix . "&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback="); if ($ititle == $alttitle) { $thw = " style='height:1400px;overflow:scroll;' "; $postsuff = explode(',"content":"', $pageContent); if (sizeof($postsuff) > 1) { $ecountry = explode('"', $postsuff[sizeof($postsuff) - 1]); $ititle = "Worldbank Data ... Average Years of Primary Schooling in " . str_replace("+", " ", str_replace("+d%27", " d", urlencode($ecountry[0]))) . ", 35-39, Total"; $date = ""; } } //echo $pageContent; $json_output = json_decode($pageContent); // Confirm that results were returned before parsing // if (!is_null(eval("$" . "json_output->query->results->" . $thing))) { //echo "yessir"; foreach($json_output->query->results as $event) { if ($yesh1 != "") $yesh1 = "

" . $event->name . str_replace("Worldbank Data", "Worldbank Data", $ititle) . " ... " . $date . "


"; echo "" . $yesh1 . "
"; echo "" . $stuff . "'>"; echo " colspan=1 align='center'>" . str_replace("margin-top:-90px;","align:top;",$stuff . $pstuff) . "'>
"; } else { echo ">"; echo ""; echo ""; echo ""; } echo ""; } echo "
"; // } } ?>