<?
/*
 
 本软件版权归作者所有,在投入使用之前注意获取许可
 作者：程威（wiwiboy）
 项目：PHPStat流量统计 1.0
 电话：13553166317
 邮箱：wiwiboy@126.com
 QQ号：158839753
 网址：http://www.phpstat.net
 phpstat.net保留全部权力，受相关法律和国际		  		
		公约保护，请勿非法修改、转载、散播，或用于其他赢利行为，		
		并请勿删除版权声明。
*/
/*	
	verson:v1.0 20060618
	author:wiwiboy
	last update:2007/01/01	$time 23:27
*/

	if( count( $WeekDatas ) > 0)
	{	
		unset($MaxMinCountArray);
		foreach( $WeekDatas as $Key => $Value )
		{
			$WeekDatas[$Key][splitday_count] = splitstr($WeekDatas[$Key][day_count]);
			$WeekDatas[$Key][day_count_ip]   = splitstr($WeekDatas[$Key][day_count_ip]);
			$MonthCount						 += $WeekDatas[$Key][day_count];
			$MonthCountIp					 += $WeekDatas[$Key][day_count_ip];
			$MaxMinCountArray[]				 = $WeekDatas[$Key][day_count];
		}
		$MonthCountAgv  = sprintf("%01.2f", ( $MonthCount/$MonthCountIp ) );
		$MonthDatas[]	= array('times'=>date("Y-m",$StartTime),'month_count'=>splitstr($MonthCount),'month_count_ip'=>splitstr($MonthCountIp),'month_count_agv'=>$MonthCountAgv);
		$Tpl->assign( 'MonthDatas', $MonthDatas );
		$MaxCount		= max( $MaxMinCountArray );
		$MinCount	    = min( $MaxMinCountArray );
		$Tpl->assign( 'MaxCount2', $MaxCount );
		$Tpl->assign( 'MinCount2', $MinCount );
		$Tpl->assign( 'WeekDatas', $WeekDatas );
		$Tpl->assign( 'Type',	   '2' );
	}
	
	
	$Tpl->assign( 'ReportTitle', date("Y-m",$StartTime)."月报表" );

?>