<?php
/* NJS 2005-12-15
Usage by country, totals.
*/
include("geoip.inc");
$gi = new GeoIP;
// Get detail given country
$show_country = $_REQUEST["code"];
$show_country_code = strtoupper($show_country);
$show_country_name = '';
/*
Check whether the country code is one of our local network
"country codes".
*/
foreach ($GLOBALS["config_vars"]["local_networks"] as $ccode => $cname)
{
if ($show_country_code == $ccode) $show_country_name = $cname;
}
if ($show_country_name == '')
{
if (isset($gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$show_country_code]))
{
$show_country_num = $gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$show_country_code];
$show_country_name = $gi->GEOIP_COUNTRY_NAMES[$show_country_num];
}
else
{
$show_country_name = 'Unknown';
}
}
$GLOBALS["db_values"] = $sql->getArchiveCountCountry($_REQUEST["code"]);
?>