Location: PHPKode > projects > D4WStatsLittle - Web Stats System > d4wstatslittle-web-stats-system/Install Without Using Dreamweaver/d4wstatslittle/report/index.php
<?php
/*
+--------------------------------------------------------------------------
|   D4WStatsLittle v1.1.2 - Developers4Web Web Stats Software
|   ==========================================================
|   by Developers4Web.com
|	D4WStatsLittle is a Trade Mark of Developers4Web
|   Copyright Developers4Web 2005 - 2006. All rights reserved.
|   English:
|       http://stats-service.developers4web.com
|   Español:
|       http://www.developers4web.com
|   ========================================
|   optimized by Trio Solutions
|   Dreamweaver Extensions and Web Development Components 
|   English:
|       http://components.developers4web.com
|   Español:
|       http://componentes.developers4web.com
|   ========================================
|   Web: http://www.d4wstats.com
|   Date: Tuesday, February 20, 2006
|   Email: info (at) developers4web (dot) com
|	License Type: D4WSTATSLITTLE is NOT Open Source Software and Limitations Apply 
|   Licence Info: /d4wstatslittle/license.txt
+--------------------------------------------------------------------------
*/
?>
<?php

error_reporting(7);

// configuration values

if (!file_exists("./../d4wfiles/logs/logger-startdate.inc.php")) 
{
   echo "You need to install and start logging before checking reports. Please, remember set write permisions on folder '/d4wstatslittle/d4wfiles/logs/', it's required for the system works.";
   exit;
}

require "./../d4wfiles/logs/logger-startdate.inc.php";

define('START_TRACK_DATE',D4W_LOGGER_START);  // este parametro se debe actualizar cuando se inserten

require "./template/stats_en.all.inc.php";

// end of configuration values


$countryname["x0"] = ST_MSG_UNKNOWN;
$countryname["x1"] = 'AFGHANISTAN';
$countryname["x2"] = 'ALBANIA';
$countryname["x3"] = 'ALGERIA';
$countryname["x4"] = 'AMERICAN SAMOA';
$countryname["x5"] = 'ANDORRA';
$countryname["x6"] = 'ANGOLA';
$countryname["x7"] = 'ANTIGUA AND BARBUDA';
$countryname["x8"] = 'ARGENTINA';
$countryname["x9"] = 'ARMENIA';
$countryname["x10"] = 'AUSTRALIA';
$countryname["x11"] = 'AUSTRIA';
$countryname["x12"] = 'AZERBAIJAN';
$countryname["x13"] = 'BAHAMAS';
$countryname["x14"] = 'BAHRAIN';
$countryname["x15"] = 'BANGLADESH';
$countryname["x16"] = 'BARBADOS';
$countryname["x17"] = 'BELARUS';
$countryname["x18"] = 'BELGIUM';
$countryname["x19"] = 'BELIZE';
$countryname["x20"] = 'BENIN';
$countryname["x21"] = 'BERMUDA';
$countryname["x22"] = 'BHUTAN';
$countryname["x23"] = 'BOLIVIA';
$countryname["x24"] = 'BOSNIA AND HERZEGOVINA';
$countryname["x25"] = 'BOTSWANA';
$countryname["x26"] = 'BRAZIL';
$countryname["x27"] = 'BRITISH INDIAN OCEAN TERRITORY';
$countryname["x28"] = 'BRUNEI DARUSSALAM';
$countryname["x29"] = 'BULGARIA';
$countryname["x30"] = 'BURKINA FASO';
$countryname["x31"] = 'BURUNDI';
$countryname["x32"] = 'CAMBODIA';
$countryname["x33"] = 'CAMEROON';
$countryname["x34"] = 'CANADA';
$countryname["x35"] = 'CAPE VERDE';
$countryname["x36"] = 'CAYMAN ISLANDS';
$countryname["x37"] = 'CENTRAL AFRICAN REPUBLIC';
$countryname["x38"] = 'CHAD';
$countryname["x39"] = 'CHILE';
$countryname["x40"] = 'CHINA';
$countryname["x41"] = 'COLOMBIA';
$countryname["x42"] = 'COMOROS';
$countryname["x43"] = 'CONGO';
$countryname["x44"] = 'COOK ISLANDS';
$countryname["x45"] = 'COSTA RICA';
$countryname["x46"] = 'COTE D\'IVOIRE';
$countryname["x47"] = 'CROATIA';
$countryname["x48"] = 'CUBA';
$countryname["x49"] = 'CYPRUS';
$countryname["x50"] = 'CZECH REPUBLIC';
$countryname["x51"] = 'DENMARK';
$countryname["x52"] = 'DJIBOUTI';
$countryname["x53"] = 'DOMINICAN REPUBLIC';
$countryname["x54"] = 'EAST TIMOR';
$countryname["x55"] = 'ECUADOR';
$countryname["x56"] = 'EGYPT';
$countryname["x57"] = 'EL SALVADOR';
$countryname["x58"] = 'EQUATORIAL GUINEA';
$countryname["x59"] = 'ERITREA';
$countryname["x60"] = 'ESTONIA';
$countryname["x61"] = 'ETHIOPIA';
$countryname["x62"] = 'FALKLAND ISLANDS (MALVINAS)';
$countryname["x63"] = 'FAROE ISLANDS';
$countryname["x64"] = 'FIJI';
$countryname["x65"] = 'FINLAND';
$countryname["x66"] = 'FRANCE';
$countryname["x67"] = 'FRENCH POLYNESIA';
$countryname["x68"] = 'GABON';
$countryname["x69"] = 'GAMBIA';
$countryname["x70"] = 'GEORGIA';
$countryname["x71"] = 'GERMANY';
$countryname["x72"] = 'GHANA';
$countryname["x73"] = 'GIBRALTAR';
$countryname["x74"] = 'GREECE';
$countryname["x75"] = 'GREENLAND';
$countryname["x76"] = 'GRENADA';
$countryname["x77"] = 'GUADELOUPE';
$countryname["x78"] = 'GUAM';
$countryname["x79"] = 'GUATEMALA';
$countryname["x80"] = 'GUINEA';
$countryname["x81"] = 'GUINEA-BISSAU';
$countryname["x82"] = 'HAITI';
$countryname["x83"] = 'HOLY SEE(VATICAN CITY STATE)';
$countryname["x84"] = 'HONDURAS';
$countryname["x85"] = 'HONG KONG';
$countryname["x86"] = 'HUNGARY';
$countryname["x87"] = 'ICELAND';
$countryname["x88"] = 'INDIA';
$countryname["x89"] = 'INDONESIA';
$countryname["x90"] = 'IRAQ';
$countryname["x91"] = 'IRELAND';
$countryname["x92"] = 'ISLAMIC REPUBLIC OF IRAN';
$countryname["x93"] = 'ISRAEL';
$countryname["x94"] = 'ITALY';
$countryname["x95"] = 'JAMAICA';
$countryname["x96"] = 'JAPAN';
$countryname["x97"] = 'JORDAN';
$countryname["x98"] = 'KAZAKHSTAN';
$countryname["x99"] = 'KENYA';
$countryname["x100"] = 'KIRIBATI';
$countryname["x101"] = 'KUWAIT';
$countryname["x102"] = 'KYRGYZSTAN';
$countryname["x103"] = 'LAO PEOPLE\'S DEMOCRATIC REPUBLIC';
$countryname["x104"] = 'LATVIA';
$countryname["x105"] = 'LEBANON';
$countryname["x106"] = 'LESOTHO';
$countryname["x107"] = 'LIBERIA';
$countryname["x108"] = 'LIBYAN ARAB JAMAHIRIYA';
$countryname["x109"] = 'LIECHTENSTEIN';
$countryname["x110"] = 'LITHUANIA';
$countryname["x111"] = 'LUXEMBOURG';
$countryname["x112"] = 'MACAO';
$countryname["x113"] = 'MADAGASCAR';
$countryname["x114"] = 'MALAWI';
$countryname["x115"] = 'MALAYSIA';
$countryname["x116"] = 'MALDIVES';
$countryname["x117"] = 'MALI';
$countryname["x118"] = 'MALTA';
$countryname["x119"] = 'MARTINIQUE';
$countryname["x120"] = 'MAURITANIA';
$countryname["x121"] = 'MAURITIUS';
$countryname["x122"] = 'MEXICO';
$countryname["x123"] = 'MONACO';
$countryname["x124"] = 'MONGOLIA';
$countryname["x125"] = 'MOROCCO';
$countryname["x126"] = 'MOZAMBIQUE';
$countryname["x127"] = 'MYANMAR';
$countryname["x128"] = 'NAMIBIA';
$countryname["x129"] = 'NAURU';
$countryname["x130"] = 'NEPAL';
$countryname["x131"] = 'NETHERLANDS';
$countryname["x132"] = 'NETHERLANDS ANTILLES';
$countryname["x133"] = 'NEW CALEDONIA';
$countryname["x134"] = 'NEW ZEALAND';
$countryname["x135"] = 'NICARAGUA';
$countryname["x136"] = 'NIGER';
$countryname["x137"] = 'NIGERIA';
$countryname["x138"] = 'NORTHERN MARIANA ISLANDS';
$countryname["x139"] = 'NORWAY';
$countryname["x140"] = 'OMAN';
$countryname["x141"] = 'PAKISTAN';
$countryname["x142"] = 'PALAU';
$countryname["x143"] = 'PALESTINIAN TERRITORY';
$countryname["x144"] = 'PANAMA';
$countryname["x145"] = 'PAPUA NEW GUINEA';
$countryname["x146"] = 'PARAGUAY';
$countryname["x147"] = 'PERU';
$countryname["x148"] = 'PHILIPPINES';
$countryname["x149"] = 'POLAND';
$countryname["x150"] = 'PORTUGAL';
$countryname["x151"] = 'PUERTO RICO';
$countryname["x152"] = 'QATAR';
$countryname["x153"] = 'REPUBLIC OF KOREA';
$countryname["x154"] = 'REPUBLIC OF MOLDOVA';
$countryname["x155"] = 'REUNION';
$countryname["x156"] = 'ROMANIA';
$countryname["x157"] = 'RUSSIAN FEDERATION';
$countryname["x158"] = 'RWANDA';
$countryname["x159"] = 'SAMOA';
$countryname["x160"] = 'SAN MARINO';
$countryname["x161"] = 'SAO TOME AND PRINCIPE';
$countryname["x162"] = 'SAUDI ARABIA';
$countryname["x163"] = 'SENEGAL';
$countryname["x165"] = 'SERBIA AND MONTENEGRO';
$countryname["x166"] = 'SEYCHELLES';
$countryname["x167"] = 'SIERRA LEONE';
$countryname["x168"] = 'SINGAPORE';
$countryname["x169"] = 'SLOVAKIA';
$countryname["x170"] = 'SLOVENIA';
$countryname["x171"] = 'SOLOMON ISLANDS';
$countryname["x172"] = 'SOMALIA';
$countryname["x173"] = 'SOUTH AFRICA';
$countryname["x174"] = 'SPAIN';
$countryname["x175"] = 'SRI LANKA';
$countryname["x176"] = 'SUDAN';
$countryname["x177"] = 'SURINAME';
$countryname["x178"] = 'SWAZILAND';
$countryname["x179"] = 'SWEDEN';
$countryname["x180"] = 'SWITZERLAND';
$countryname["x181"] = 'SYRIAN ARAB REPUBLIC';
$countryname["x182"] = 'TAIWAN';
$countryname["x183"] = 'TAJIKISTAN';
$countryname["x184"] = 'THAILAND';
$countryname["x185"] = 'THE DEMOCRATIC REPUBLIC OF THE CONGO';
$countryname["x186"] = 'THE FORMER YUGOSLAV REPUBLIC OF MACEDONIA';
$countryname["x187"] = 'TOGO';
$countryname["x188"] = 'TOKELAU';
$countryname["x189"] = 'TONGA';
$countryname["x190"] = 'TRINIDAD AND TOBAGO';
$countryname["x191"] = 'TUNISIA';
$countryname["x192"] = 'TURKEY';
$countryname["x193"] = 'TURKMENISTAN';
$countryname["x194"] = 'TUVALU';
$countryname["x195"] = 'UGANDA';
$countryname["x196"] = 'UKRAINE';
$countryname["x197"] = 'UNITED ARAB EMIRATES';
$countryname["x198"] = 'UNITED KINGDOM';
$countryname["x199"] = 'UNITED REPUBLIC OF TANZANIA';
$countryname["x200"] = 'UNITED STATES';
$countryname["x201"] = 'URUGUAY';
$countryname["x202"] = 'UZBEKISTAN';
$countryname["x203"] = 'VANUATU';
$countryname["x204"] = 'VENEZUELA';
$countryname["x205"] = 'VIET NAM';
$countryname["x206"] = 'VIRGIN ISLANDS';
$countryname["x207"] = 'WESTERN SAHARA';
$countryname["x208"] = 'YEMEN';
$countryname["x209"] = 'ZAMBIA';
$countryname["x210"] = 'ZIMBABWE';

define('ST_PATH_REPORT'        ,'resume');
define('ST_PATH_THIS_MONTH'    ,'month');
define('ST_PATH_TODAY'         ,'today');
define('ST_PATH_BROWSERS'      ,'browsers');
define('ST_PATH_POPULAR'       ,'popular');
define('ST_PATH_PROCEDENCE'    ,'procedence');
define('ST_PATH_REFERERS'      ,'referers');
define('ST_PATH_VISITORS'      ,'visitors');
define('ST_PATH_HOURS'         ,'hours');
define('ST_PATH_COOKIES'       ,'cookies');
define('ST_PATH_SCREEN'        ,'screen');
define('ST_PATH_DOMAINS'       ,'domains');
define('ST_PATH_SEARCH_ENG'    ,'searchengines');


if ($_GET["report"] == '')
    $_GET["report"] = ST_PATH_REPORT;



function frdate($x1 = "", $x2="")
{
  if ($x2 != "")
      return date($x1, $x2);
  else
      return date($x1);
   // NOTA TAMBIEN ESTA DECLARADA EN tool/multicolumn.php
}

require "./template/template_top.inc.php";

?>
<div>


<?php

 define ('INFLATED', 0);

 define('WEB_SOURCE','./../d4wfiles/');


 function readDatabaseII($dbname)
 {
     $filename = WEB_SOURCE . $dbname;
     require $filename;
     return unserialize($str);
 }

 function nInflate($number)
 {
      if (INFLATED)
          return round($number * INFLATED);
      else
          return $number;
 }

 if (true)
 {

     require "./reportes/tools/colors.inc.php";
     require "./reportes/tools/graficas.php";
     switch ($_GET["report"])
     {
        case ST_PATH_REPORT:
            require "./reportes/reporte-de-hoy.inc.php";
            break;
        case ST_PATH_THIS_MONTH:
            require "./reportes/este-mes.inc.php";
            break;
        case ST_PATH_TODAY:
            require "./reportes/resumen.inc.php";
            break;
        case ST_PATH_BROWSERS:
            require "./reportes/navegadores.inc.php";
            break;
        case ST_PATH_POPULAR:
            require "./reportes/paginas-mas-visitadas.inc.php";
            break;
        case ST_PATH_PROCEDENCE:
            require "./reportes/procedencia-paises.inc.php";
            break;
        case ST_PATH_REFERERS:
            require "./reportes/remitentes.inc.php";
            break;
        case ST_PATH_VISITORS:
            require "./reportes/visitantes-visitas-hits.inc.php";
            break;
        case ST_PATH_HOURS:
            require "./reportes/visitas-horas-semanas.inc.php";
            break;
        case ST_PATH_SCREEN:
            require "./reportes/resoluciones.inc.php";
            break;
        case ST_PATH_COOKIES:
            require "./reportes/soporte-de-cookies.inc.php";
            break;
        case ST_PATH_DOMAINS:
            require "./reportes/referers-por-dominio.inc.php";
            break;
        case ST_PATH_COMPARE_MONTH:
            require "./reportes/comparativo-meses.inc.php";
            break;
        case ST_PATH_SEARCH_ENG:
            require "./reportes/trafico-buscadores.inc.php";
            break;
        case ST_PATH_OPERATING_S:
            require "./reportes/sistemas-operativos.inc.php";
            break;
     }
 } else {
     echo ST_MSG_PRIVATE_STATS;
 }

?>
</div>
<?php


   require "./template/template_bottom.inc.php";

   //pendiente de analizar si se quitan

     function fillArray($rs)
     {
         $arr = array();
         $top = 0;
         while ($row = $rs->db_fetch_array())
         {
            foreach ($row as $item => $value)
                $arr[$top][$item] = $value;
            $top ++;
         }
         return $arr;
     }


     function mergeArray($ar1, $ar2, $count, $compare, $key)
     {
         $ar3 = $ar1;
         $scount = count($ar1);
         if ($scount < $count)
             $virtualTop = $scount;
         else
             $virtualTop = $count;
         for ($i=0; $i < count($ar2); $i++)
         {
            $top = 0;
            while ($top < $count-1 && $top < $scount-1 && $ar1[$top][$key] != $ar2[$i][$key])
                $top++;
            if ($ar1[$top][$key] != $ar2[$i][$key])
            {
                if ($i <= $count)
                {
                    $ar3[$virtualTop++] = $ar2[$i];
                    while ($top < count($ar1) && $ar1[$top][$key] != $ar2[$i][$key])
                        $top++;
                    if ($ar1[$top][$key] == $ar2[$i][$key])
                        $ar3[$virtualTop-1][$compare] += $ar1[$top][$compare];
                }
            }
            else
                $ar3[$top][$compare] += $ar2[$i][$compare];
         }
         //echo"<pre>";print_r($ar3);
         for ($i=0; ($i < $virtualTop-1); $i++)
             for ($j=$i+1; $j < $virtualTop; $j++)
                 if ($ar3[$i][$compare] < $ar3[$j][$compare])
                 {
                    $tmp = $ar3[$i];
                    $ar3[$i]= $ar3[$j];
                    $ar3[$j] = $tmp;
                 }
         return $ar3;
     }

  // Delete GET Params from URL  
  function truncStr($str, $size)
  {
      if (strlen($str) > $size)
          return substr($str,0,$size)."...";  
      else
          return $str;    
  }
  function myiconv2($str) 
  {
      $str = str_replace("Ú","&Uacute;",$str);
      $str = str_replace("é","&eacute;",$str);
      $str = str_replace("í","&iacute;",$str);
      $str = str_replace("ú","&uacute;",$str);
      $str = str_replace("á","&aacute;",$str);
      $str = str_replace("ó","&oacute;",$str);
      $str = str_replace("¿","&iquest;",$str);
      $str = str_replace("º","&ordm;",$str);
      $str = str_replace("ñ","&ntilde;",$str);
      
            
      return $str;
  }  
?>
Return current item: D4WStatsLittle - Web Stats System