$link =false;
set_error_handler("customError");
function customError($errno, $errstr, $error_file,$error_line,$error_context)
{
global $file;
$aFile=$_GET["file"];
$theAnekiReferrer=$_SERVER['HTTP_REFERER'];
//mail ("info@aneki.com", "countries2 Error","Error: [$errno] $errstr on line $error_line in file $aFile -- $error_file -- $error_context -- referrer - $theAnekiReferrer" );
}
$t="Worst Earthquakes in History";
$table="";
$places="";
$decimals="";
$unit="";
$orderby="";
$order="";
$order_opposite="";
if($order==="asc"){$order_opposite="desc";}
if($order==="desc"){$order_opposite="asc";}
$dependency="independent";
$number="10";
$cntdn="n";
$r="seeRelated";
$measures="";
$units="";
$file="worst_earthquakes_history";
$c="";
$map="";
$mapData="";
$mapCode="";
$seeRelated="";
//if(isset($_GET["t"])){$t=$_GET["t"];}
//if(isset($_GET["table"])){$table=$_GET["table"];}
//if(isset($_GET["places"])){$places=$_GET["places"];}
//if(isset($_GET["decimals"])){$decimals=$_GET["decimals"];}
//if(isset($_GET["unit"])){$unit=$_GET["unit"];}
if(isset($_GET["orderby"])){$orderby=$_GET["orderby"];}
if(isset($_GET["order"])){$order=$_GET["order"]; if($order==="asc"){$order_opposite="desc";}if($order==="desc"){$order_opposite="asc";}}
if(isset($_GET["dependency"])){$dependency=$_GET["dependency"];}
if(isset($_GET["number"])){$number=$_GET["number"];}
if(isset($_GET["cntdn"])){$cntdn=$_GET["cntdn"];}
if(isset($_GET["r"])){$r=$_GET["r"];}
if(isset($_GET["measures"])){$measures=$_GET["measures"];}
if(isset($_GET["units"])){$units=$_GET["units"];}
//if(isset($_GET["file"])){$file=$_GET["file"];}
if(isset($_GET["c"])){$c=$_GET["c"];}
if(isset($_GET["map"])){$map=$_GET["map"];}
if($table!="")
{
include("lr_324/wa2.php");
mysql_set_charset('utf8', $link);
}
if($number=="all")
{
$theNumber="";
}
else
{
$theNumber=$number;
}
$theLocation=" in the World";
if($c=="europe")
{
$theLocation=" in Europe";
}
if($c=="africa")
{
$theLocation=" in Africa";
}
if($c=="asia")
{
$theLocation=" in Asia";
}
if($c=="middle east")
{
$theLocation=" in the Middle East";
}
if($c=="oceania")
{
$theLocation=" in Oceania";
}
if($c=="caribbean")
{
$theLocation=" in the Caribbean";
}
if($c=="south america")
{
$theLocation=" in South America";
}
if($c=="central america")
{
$theLocation=" in Central America";
}
if($c=="north america")
{
$theLocation=" in North America";
}
$theTitle=str_replace("_"," ",$t);
if($order=="desc")
{
if($theNumber==""){$theTitle="List of ".$theTitle;}
else{
$containsTop = strrpos($theTitle,"Top");
if($containsTop===false){$theTitle="Top $theNumber ".$theTitle;}
else{$theTitle="$theNumber ".$theTitle;}
}
$theDescription="List ranking the ".$theTitle." compiled by Aneki.com";
$theKeywords="top, countries, list, rank, order, world".str_replace("_",", ",$t).",".$dependency.".".$c;
}
else
{
$theTitle="List of ".str_replace("_"," ",$t);
$theDescription="List ranking the ".str_replace("_"," ",$t)." compiled by Aneki.com";
$theKeywords="countries, list, rank, order, world, ".str_replace("_",", ",$t);
}
$arrayOfMeasures=explode("--",$measures);
$units=str_replace("*","",$units);
$arrayOfUnits=explode("--",$units);
$decimals=str_replace("*","",$decimals);
$arrayOfDecimals=explode("--",$decimals);
$dependencyCondition="";
if($dependency=="none")
{
$dependencyCondition=" ";
}
else
{
$dependencyCondition=" AND (fb0.value=\"$dependency\")";
}
$locationCondition="";
if($c=="europe")
{
$locationCondition=" AND (fb2.value LIKE \"%Europe,%\" OR fb2.name=\"Russia\" OR fb2.name=\"Turkey\") ";
}
if($c=="asia")
{
$locationCondition=" AND (fb2.value LIKE \"%Asia,%\" AND fb2.name!=\"Russia\" AND fb2.name!=\"Turkey\") ";
}
if($c=="africa")
{
$locationCondition=" AND (fb2.value LIKE \"%Africa,%\") ";
}
if($c=="oceania")
{
$locationCondition=" AND (fb2.value LIKE \"%Oceania,%\") ";
}
if($c=="south america")
{
$locationCondition=" AND (fb2.value LIKE \"%South America,%\") ";
}
if($c=="central america")
{
$locationCondition=" AND (fb2.value LIKE \"%Central America,%\") ";
}
if($c=="north america")
{
$locationCondition=" AND (fb2.value LIKE \"%North America,%\" OR fb2.name=\"Mexico\") ";
}
if($c=="middle east")
{
$locationCondition=" AND (fb2.value LIKE \"%Middle East,%\") ";
}
if($c=="caribbean")
{
$locationCondition=" AND (fb2.value LIKE \"%Caribbean,%\") ";
}
if($c=="americas")
{
$locationCondition=" AND (fb2.value LIKE \"%America,%\") ";
}
if($c=="asiapacific")
{
$locationCondition=" AND (fb2.value LIKE \"%Asia,%\" or fb2.value LIKE \"%Oceania,%\") ";
}
//if(strlen($orderby)<1)
//{
//$orderby=$table.".value";
//$query_schema="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = '$table' AND ORDINAL_POSITION =1";
//$result_schema=mysql_query($query_schema);
//if($result_schema)
//{
//while ($line = mysql_fetch_array($result_schema))
//{
//$orderby=$line[0];
//}
//}
//}
if($map=="on")
{
$query_for_map = "SELECT $table.name, $table.value, fb0.value, fbURLs.value, tblDataCodes.iso FROM $table, fb0, fbURLs, tblDataCodes, fb2 WHERE (fb0.name=$table.name AND ($table.value > 0)AND fb0.name = fbURLs.name AND fb0.name = tblDataCodes.name AND fb2.name=fb0.name". $dependencyCondition . $locationCondition .") order by $orderby $order";
//$query_for_map = "SELECT $table.name, $table.value, fb0.value, fbURLs.value, tblDataCodes.fips FROM $table, fb0, fbURLs, tblDataCodes, fb2 WHERE (($table.value > 0)AND fb0.name = fbURLs.name AND fb0.name = tblDataCodes.name AND fb2.name=fb0.name". $dependencyCondition . $locationCondition .") order by $orderby $order";
$result_for_map = mysql_query($query_for_map);// or mail("info@aneki.com", "countries2 error", "Sql error of ".$_SERVER["SCRIPT_NAME"].". Call to `$table` in ".__FILE__." ".$_GET["file"]." on line: ".__LINE__."
".mysql_error()."
SQL:
$query_for_map
");
if(!$result_for_map)
{
$query_for_map = "SELECT $table.country, $table.value, fb0.value, fbURLs.value, tblDataCodes.iso FROM $table, fb0, fbURLs, tblDataCodes, fb2 WHERE (fb0.name=$table.country AND ($table.value > 0)AND fb0.name = fbURLs.name AND fb0.name = tblDataCodes.name AND fb2.name=fb0.name". $dependencyCondition . $locationCondition .") order by $orderby $order";
$result_for_map = mysql_query($query_for_map);// or mail("info@aneki.com", "countries2 error", "Sql error of ".$_SERVER["SCRIPT_NAME"].". Call to `$table` in ".__FILE__." ".$_GET["file"]." on line: ".__LINE__."
".mysql_error()."
SQL:
$query_for_map
");
}
if($result_for_map && count($arrayOfMeasures)>1)
{
$num_rows = mysql_num_rows($result_for_map);
$countryCount=0;
while ($line = mysql_fetch_array($result_for_map))
{
$theName=$line[4];
$theValue=$line[1];
if($theName=="Congo, Democratic Republic of the"){$theName="Congo, the Democratic Republic of the";}
if($theName=="Cote d'Ivoire"){$theName="Côte d'Ivoire";}
if(!strpos($theName,"'"))
{
$mapData=$mapData."data.setValue($countryCount, 0, '$theName');";
$mapData=$mapData."data.setValue($countryCount, 1, $theValue);";
}
else
{
$mapData=$mapData."data.setValue($countryCount, 0, '".str_replace("'",""",$theName)."');";
$mapData=$mapData."data.setValue($countryCount, 1, $theValue);";
}
$countryCount=$countryCount+1;
}
//}
//$mapColors="0xD0E3F8, 0x0066ff, 0x0000ff";
$mapColors="0xD0E3F8, 0xbbbbbb, 0x0000ff";
if($order=="asc")
{
//$mapColors="0x0000ff, 0xD0E3F8, 0x0066ff";
$mapColors="0x0000ff, 0xD0E3F8, 0xbbbbbb";
}
$mapCode="
| Location | Date | Estimated No. Killed | |||||
| 1. |
| May 20, 1202 | 1,100,000 | ||||
| 2. |
| Feb 2, 1556 | 820,000 | ||||
| 3. |
| October 11, 1737 | 300,000 | ||||
| 4. |
| May 20, AD 526 | 250,000 | ||||
| 5. |
| July 28, 1976 | 242,419 | ||||
| 6. |
| May 22, 1927 | 200,000 | ||||
| 7. |
| December 30, 1703 | 190,000 | ||||
| 8. |
| Deceber 16, 1920 | 180,000 | ||||
| 9. |
| December 28, 1908 | 160,000 | ||||
| 10. |
| January 12, 2010 | 150,000 + | ||||
| 11. |
| September 1, 1923 | 142,807 | ||||
| 12. |
| May 12, 2008 | 70,000 |