<?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
require "_dbconn.inc.php";
require "common.inc.php";
////$rs_cookies = mysql_query("select count(distinct(ip_converted)) as ct,cookie from ".$tablename." group by cookie order by cookie ASC", $link);
// init
$rs_cookies[0] = 0; // no cookies
$rs_cookies[1] = 0; // si cookies
$ip_converted = array();
if (file_exists(DATABASE_PATH.$tablename))
{
$fp = fopen (DATABASE_PATH.$tablename,"r");
while ($data = fgetcsv ($fp, 1000, ","))
{
if (!$ip_converted[$data[3]])
{
$ip_converted[$data[3]] = 1;
if ($data[1]) $rs_cookies[1]++; else $rs_cookies[0]++; // cookies
}
}
fclose ($fp);
}
$row[0] = $rs_cookies[0];
$row[1] = $rs_cookies[1];
$total = array();
$month = array();
$day = array();
$tot_h = 0;
$tot_vr = 0;
// update
if ($row) {
$total["with_cookies"] += $row[1];
$total["without_cookies"] += $row[0];
$month["with_cookies"] += $row[1];
$month["without_cookies"] += $row[0];
$day["with_cookies"] += $row[1];
$day["without_cookies"] += $row[0];
}
$arr["total"] = $total;
$arr["month"] = $month;
$arr["today"] = $day;
$str = serialize($arr);
?>