<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0703") then Call ReturnError1()
Dim Days,Months,Years,TempObj,SunObj,SunNum,VisitTodayNum,VisitMonthNum,VisitAllNums,TempObjs,TeempTimestr
Days = Day(Now())
Months = Month(Now())
Years = Year(Now())
SunNum = 0
Set TempObj = Conn.Execute("Select WebCountTime from WebInfo")
If TempObj.eof then
	TeempTimestr = Now()
Else
	TeempTimestr = TempObj("WebCountTime")
End If
Set SunObj = Conn.Execute("Select LoginNum from FlowStatistic where VisitTime>#"&TeempTimestr&"#")
If Not SunObj.eof then
Do while not SunObj.eof
	SunNum = SunNum + clng(SunObj("LoginNum"))
	SunObj.MoveNext
Loop
End If
SunObj.Close
Set SunObj = Nothing
Set TempObjs = Conn.Execute("Select Count(ID) from FlowStatistic where day(VisitTime) = '"&Days&"' and month(VisitTime)='"&Months&"' and year(VisitTime)='"&Years&"'")
	VisitTodayNum = Clng(TempObjs(0))
Set TempObjs = Conn.Execute("Select Count(ID) from FlowStatistic where month(VisitTime)='"&Months&"' and year(VisitTime)='"&Years&"'")
	VisitMonthNum = Clng(TempObjs(0))
Set TempObjs = Conn.Execute("Select Count(ID) from FlowStatistic where VisitTime>#"&TeempTimestr&"#")
	VisitAllNums = Clng(TempObjs(0))
TempObjs.Close
Set TempObjs = Nothing
TempObj.Close
Set TempObj = Nothing
Conn.Execute("Update WebInfo Set VisitToday="&VisitTodayNum&",VisitMonth="&VisitMonthNum&",VisitAllNum="&VisitAllNums&",RefreashNum = "&Clng(SunNum)&"")
Dim Sql,RsWebObj,WebName,WebUrl,WebIntro,WebEmail,WebAdmin,WebCountTime,VisitAllNum,VisitToday,VisitMonth,RefreashNum
Sql ="Select * from WebInfo"
Set RsWebObj = Server.CreateObject("ADODB.RecordSet")
	RsWebObj.Open Sql,Conn,3,3
if Not RsWebObj.Eof then
	WebName = RsWebObj("WebName")
	WebUrl = RsWebObj("WebUrl")
	WebIntro = RsWebObj("WebIntro")
	WebEmail = RsWebObj("WebEmail")
	WebAdmin = RsWebObj("WebAdmin")
	WebCountTime = RsWebObj("WebCountTime")
	VisitAllNum = RsWebObj("VisitAllNum")
	VisitToday = RsWebObj("VisitToday")
	VisitMonth = RsWebObj("VisitMonth")
	RefreashNum = RsWebObj("RefreashNum")
else
	'转到网站维护页面
end if
%>
<%
	Dim ForseeVisitToday,I,NumofDays,AverageNum,Tnum,TNumStr
	NumofDays=DATEDIFF("d",WebCountTime,Date())
	If NumofDays = 0 then
		NumofDays = 1
	End If
	AverageNum=CLng(VisitAllNum/NumofDays*1000)/1000
	I= Now()-Date()
	ForseeVisitToday = Round(VisitToday/I*(1-I) + VisitToday)
%>
<html>
<head>
<title>网站简要信息统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<link href="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" class="ButtonList"><div align="center"><strong>网站简要信息统计</strong></div></td>
</tr>
<tr><td height="50">&nbsp;</td>
</tr>
</table>
<table width="85%" border="8" align="center" cellspacing="5" bordercolor="e6e6e6">
  <tr> 
    <td width="19%" height="30"><div align="center">网站名称</div></td>
    <td width="81%"><% = WebName %></td>
  </tr>
  <tr> 
    <td height="30"> <div align="center">管 理 员</div></td>
    <td height="30"><% = WebAdmin %></td>
  </tr>
  <tr> 
    <td height="30"><div align="center">网站地址</div></td>
    <td height="30"><% = WebUrl %></td>
  </tr>
  <tr> 
    <td height="30"><div align="center">网站信箱</div></td>
    <td height="30"><% = WebEmail %></td>
  </tr>
  <tr> 
    <td height="30"><div align="center">网站简介</div></td>
    <td height="30"><% = WebIntro %></td>
  </tr>
</table>
<p>
<table width="85%" border="8" align="center" cellspacing="5" bordercolor="e6e6e6">
  <tr> 
    <td width="20%"><div align="center">总 访问人数</div></td>
    <td width="30%"><% = VisitAllNum %></td>
    <td width="20%"><div align="center">开始统计日期</div></td>
    <td width="30%"><% = WebCountTime %></td>
  </tr>
  <tr> 
    <td><div align="center">今日 访问量</div></td>
    <td><% =VisitToday %></td>
    <td><div align="center">本月 访 问量</div></td>
    <td><% =VisitMonth %></td>
  </tr>
  <tr> 
    <td><div align="center">统 计 天 数</div></td>
    <td><% =NumofDays %></td>
    <td><div align="center">平均日访问量</div></td>
    <td><% = AverageNum%></td>
  </tr>
  <tr> 
    <td><div align="center">整站页面刷新</div></td>
    <td><% =RefreashNum %></td>
    <td><div align="center">预计本日访问</div></td>
    <td><% =ForseeVisitToday %></td>
  </tr>
</table>
</body>
</html>
<%
	RsWebObj.Close
	Conn.Close
	Set RsWebObj=nothing
	Set Conn=nothing
%>