$dir = 'e:/Inetpub/logs';
$dBF = 'Visitors';
$Db = odbc_connect($dBF,'','');
require 'c:/php/includes/Db.php';
require 'c:/php/includes/hist1.php';
$Sql = odbc_do($Db,"Select cValue as tDate2Last From tParam Where cName='tDate2Last'");
FetchRow($Sql);
?>
$Sql = odbc_do($Db,"Delete * From tIP Where dDate=#$tDate2Last# GROUP BY DateAdd('h',nHour,dDate) ORDER BY 1");
FetchRow($Sql);
odbc_do($Db,"Update tDate2 Set nFreq=$nFreq Where aDate=#$aDate#");
if ($aDate):
while (FetchRow($Sql)):
@odbc_do($Db,"Insert Into tDate2 (aDate, nFreq) Values (#$aDate#, $nFreq)");
endwhile;
odbc_do($Db,"Update tParam Set cValue='$aDate' Where cName='tDate2Last'");
endif;
?>
require 'e:/Inetpub/wwwroot/ism2005/_private/header.asp'; ?>
require 'e:/Inetpub/wwwroot/ism2003/_private/Col0.asp'; ?>
|
Visitors' Histogram
Number of Visitors by Month
$Sql = odbc_do($Db,"Select Format(cDate(cValue),'d mmm yyyy') as aDate, Format(Now,'d mmm yyyy, h:mm AMPM') as bDate " .
"From tParam Where cName='dStartHist'");
FetchRow($Sql);
echo "$bDate ";
?>
This month | Day | Visitors |
$sq = "SELECT Format(bDate,'mmm d') as eDate, nFreqs, mid(Format(bDate,'dddd'),1,3) as cDay " .
"From vHitsDate Where bDate>=DateSerial(Year(Now),Month(Now),1) Order By bDate";
$Sql = odbc_do($Db,$sq);
while (FetchRow($Sql)){
if (ereg('11',$eDate) or ereg('21',$eDate)){
echo " " .
' | ' .
'This month | Day | Visitors | ';
}
echo "| $eDate | " .
" $cDay | " . NBSP(number_format($nFreqs)) . " | ";
}
$Sql = odbc_do($Db,"Select Max(nfreqs) as aMax,Sum(nfreqs) as aSum From vHitsMonth");
FetchRow($Sql);
$Sql = odbc_do($Db,"Select cMonth, nfreqs From vHitsMonth Order By 1 DESC");
FetchRow($Sql);
echo "| Total | " .
"" . NBSP(number_format($nfreqs)) . " | ";
?>
|
| Month | Histogram | Visitors |
|  
echo substr($cMonth,-9) . " | ";
echo "    | ";
echo "" . number_format($nfreqs) . "  | ";
while (FetchRow($Sql)) {
echo "|  " . substr($cMonth,-9) . " | ";
echo "     | ";
echo "" . number_format($nfreqs) . "  | ";
}
echo "| Total | " .
"" . number_format($aSum) . "  | ";
?>
|