$top_menu = "commu";
$grey_box = "Community > Site Stats > Service Analysis";
$green_box_img = "icon_community.gif";
$green_box = "Site Stats";
include "../include/header.php";
$query_month = "SELECT COUNT(*) FROM m_site_stats GROUP BY MONTH(wdate), YEAR(wdate)";
$res_month = mysqli_query($query_month,$connect);
$tot_month = mysqli_num_rows($res_month);
$visitor_sum = "";
for($vm=0;$vm<$tot_month;$vm++) {
$row_month = mysqli_fetch_array($res_month);
$visitor_sum = $visitor_sum + $row_month[0];
}
$visit_tot = $visitor_sum / $tot_month;
$visit_tot = round($visit_tot);
$query_day="select count(*) as cnt, DAYNAME(wdate) as dnr, TO_DAYS(wdate) as tdr from m_site_stats where wdate>= DATE_SUB(CURRENT_date,interval 6 day) group by dnr,tdr order by cnt desc, tdr desc limit 1";
$result_day=mysqli_query($query_day,$connect);
for($m=0;$rows_day=mysqli_fetch_array($result_day);$m++){
$busy_day = $rows_day[1];
}
$query_h="select count(tm) as tmr,tm from m_site_stats where wdate>= DATE_SUB(CURRENT_date,interval 24 HOUR) group by tm order by tmr desc;";
$result_h=mysqli_query($query_h,$connect);
$rows_h=mysqli_fetch_array($result_h); mysql_free_result($result_h);
if($rows_h[1]>12){
$busy_hour= "PM. "." ".(int)($rows_h[1]-12);
} else if($rows_h[1] == 12) { $busit_hour= "PM. 12";
}else{
$busy_hour= "AM. "." ".(int)$rows_h[1];
}
?>
include("head_href.php"); ?>
| |
|
|
| |
| |
| |
|
| |
| 1. Average visitor
per month |
|
| 2. The Busiest day of week |
|
| 3. The Busiest
Hours |
|
|
|
| |
|
|
|
|
 |
|
|
include "../include/footer.php";
?>