Free statistics - Daily Hits "; $strError1="Error Number: ".mysql_errno().$BR; $strError2="Error Description: ".mysql_error.$BR; $strError5="Query: ".$strsql.$BR.$BR."strWhere: ".$strWhere.$BR; $strError0=$BR.$strError0.$strError1.$strError2.$strError5; echo $strError0; break; } $intTotalRecs=mysql_num_rows($result); if (($intTotalRecs==0)) { ?>

No days recorded in database.

$ndays) $limit=$ndays; $start_date = date_x_days_ago($today,$limit-1); if (($start_date < $first_day)) $start_date = $first_day; $strsql="SELECT * FROM stats_day WHERE date >= '$start_date' ORDER BY date DESC LIMIT 0, $limit"; if (!($result = mysql_query($strsql))) { $strError0="Open Stats Database Failed
"; $strError1="Error Number: ".mysql_errno().$BR; $strError2="Error Description: ".mysql_error.$BR; $strError5="Query: ".$strsql.$BR.$BR."strWhere: ".$strWhere.$BR; $strError0=$BR.$strError0.$strError1.$strError2.$strError5; echo $strError0; break; } $intTotalRecs=mysql_num_rows($result); if (($intTotalRecs==0)) { ?>

No non-zero days recorded in database within specified range.

Hits are recorded since ( days)

$high_hits) { $high_hits=$row[1]; $high_day=$row[0];} if (!isset($low_hits)) { $low_hits=$row[1]; $low_day=$row[0]; } if($row[1]<$low_hits) { $low_hits=$row[1]; $low_day=$row[0];} $x++; } $number_days=$x; # fill in array with days that had 0 hits and therefore not recorded $date[$x]="0000-00-00"; # create next array values to prevent error below $hits[$x]=0; if($number_days==$limit) {$date2=$date; $hits2=$hits;} else { $currentday=$today; $currentindex=0; for ($x=0; $x<$limit; $x++) { $date2[$x]=$currentday; if ($date[$currentindex]==$currentday) { $hits2[$x]=$hits[$currentindex]; $currentindex++; } else { $hits2[$x]=0; } if (!isset($low_hits)) { $low_hits=$hits2[0]; $low_day=$date2[0]; } if($hits2[$x]<=$low_hits) { $low_hits=$hits2[$x]; $low_day=$date2[$x];} $currentday = date_x_days_ago($currentday,1); } } $date=$date2; $hits=$hits2; $number_days=$limit; $today = date("Y") . "-" . date("m") . "-" . date("d"); $proj_hits = 0; $proj_hitsf = 0; if($newest_date==$today) { $mins = date("i") + date("G")*60.0; # minutes used today $proj_hits = $newest_hits * (1440.0/$mins); if(isset($newest2_hits)) $proj_hits = $newest_hits + ( (1440.0-$mins)*($newest2_hits/($mins+1440.0)) ); $proj_hits = round($proj_hits); $proj_hitsf = number_format($proj_hits); } $average_hits = ($total_hits + $proj_hits - $hits2[0]) / $number_days; $average_hits = round($average_hits,2); $total_hitsf = number_format($total_hits); $high_hitsf = number_format($high_hits); $low_hitsf = number_format($low_hits); $average_hitsf = number_format($average_hits); if($high_hits==0) $high2=1; else { $high2=$high_hits; if ($proj_hits>$high2) $high2=$proj_hits; } ?>
General Statistics
Projected hits for today
Server date
Server time ()
Hits are recorded since ( days)
Hits For Last Days
Total
Average
Most
Least
Hits graph for last $limit days

"; for ($x=0; $x<$number_days; $x++) # display graph { $width=$bar_width * ($hits[$x] / $high2); $width=round($width); $hitsf = number_format($hits[$x]); $projbar=""; if ($proj_hits>0 && $x==0) { $width2 = $bar_width * (($proj_hits-$hits[$x])/ $high2); $width2 = round($width2); if ($width2>0) $projbar = "\"Projected:"; } echo "\n"; } echo "\n
DateHitsGraph
$date[$x] $hitsf $projbar
\n\n
\n\n"; } while(0); mysql_close(); ?>

Show stats for last days.

 

Free Statistics - Version 1.1.0
Copyright © 2003 Free Webspace - http://www.Free-Webhosts.com