Newer
Older
Digital_Repository / Repositories / statistics / includes / inc.fns.show_detail_country.es.php
  1. <?php
  2. /* NJS 2005-12-15
  3. Usage by country, totals.
  4. */
  5.  
  6. include("geoip.inc");
  7. $gi = new GeoIP;
  8.  
  9. // Get detail given country
  10. $show_country = $_REQUEST["code"];
  11. $show_country_code = strtoupper($show_country);
  12. $show_country_name = '';
  13. /*
  14. Check whether the country code is one of our local network
  15. "country codes".
  16. */
  17. foreach ($GLOBALS["config_vars"]["local_networks"] as $ccode => $cname)
  18. {
  19. if ($show_country_code == $ccode) $show_country_name = $cname;
  20. }
  21. if ($show_country_name == '')
  22. {
  23. if (isset($gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$show_country_code]))
  24. {
  25. $show_country_num = $gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$show_country_code];
  26. $show_country_name = $gi->GEOIP_COUNTRY_NAMES[$show_country_num];
  27. }
  28. else
  29. {
  30. $show_country_name = 'Unknown';
  31. }
  32. }
  33.  
  34. // NJS 2006-06-14: Added archive name as argument.
  35. $GLOBALS["db_values"] = $sql->getArchiveCountCountry($GLOBALS["config_vars"]["archivename"],$_REQUEST["code"]);
  36. ?>