Visit_DataStatistic.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:6k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <%
  7. Response.Buffer = True
  8. Response.Expires = -1
  9. Response.ExpiresAbsolute = Now() - 1
  10. Response.Expires = 0
  11. Response.CacheControl = "no-cache"
  12. Dim Conn,User_Conn,tmp_type,strShowErr
  13. MF_Default_Conn
  14. MF_User_Conn
  15. MF_Session_TF
  16. if not MF_Check_Pop_TF("SS_site") then Err_Show
  17. if not MF_Check_Pop_TF("SS001") then Err_Show
  18. Dim Days,Months,Years,TempObj,SunObj,SunNum,VisitTodayNum,VisitMonthNum,VisitAllNums,TempObjs,TeempTimestr
  19. Days = Day(Now())
  20. Months = Month(Now())
  21. Years = Year(Now())
  22. SunNum = 0
  23. Set TempObj = Conn.Execute("Select WebCountTime from FS_SS_SysPara")
  24. If TempObj.eof then
  25. TeempTimestr = Now()
  26. Else
  27. TeempTimestr = TempObj("WebCountTime")
  28. End If
  29. If G_IS_SQL_DB=0 then
  30. Set SunObj = Conn.Execute("Select LoginNum from FS_SS_Stat where VisitTime>#"&TeempTimestr&"#")
  31. Else
  32. Set SunObj = Conn.Execute("Select LoginNum from FS_SS_Stat where VisitTime>'"&TeempTimestr&"'")
  33. End If
  34. If Not SunObj.eof then
  35. Do while not SunObj.eof
  36. SunNum = SunNum + clng(SunObj("LoginNum"))
  37. SunObj.MoveNext
  38. Loop
  39. End If
  40. SunObj.Close
  41. Set SunObj = Nothing
  42. Set TempObjs = Conn.Execute("Select Count(ID) from FS_SS_Stat where day(VisitTime) = '"&Days&"' and month(VisitTime)='"&Months&"' and year(VisitTime)='"&Years&"'")
  43. VisitTodayNum = Clng(TempObjs(0))
  44. Set TempObjs = Conn.Execute("Select Count(ID) from FS_SS_Stat where month(VisitTime)='"&Months&"' and year(VisitTime)='"&Years&"'")
  45. VisitMonthNum = Clng(TempObjs(0))
  46. If G_IS_SQL_DB=0 then
  47. Set TempObjs = Conn.Execute("Select Count(ID) from FS_SS_Stat where VisitTime>#"&TeempTimestr&"#")
  48. Else
  49. Set TempObjs = Conn.Execute("Select Count(ID) from FS_SS_Stat where VisitTime>'"&TeempTimestr&"'")
  50. End If
  51. VisitAllNums = Clng(TempObjs(0))
  52. TempObjs.Close
  53. Set TempObjs = Nothing
  54. TempObj.Close
  55. Set TempObj = Nothing
  56. Conn.Execute("Update FS_SS_SysPara Set VisitToday="&VisitTodayNum&",VisitMonth="&VisitMonthNum&",VisitAllNum="&VisitAllNums&",RefreashNum = "&Clng(SunNum)&"")
  57. Dim Sql,RsWebObj,WebName,WebUrl,WebIntro,WebEmail,WebAdmin,WebCountTime,VisitAllNum,VisitToday,VisitMonth,RefreashNum
  58. Sql ="Select * from FS_SS_SysPara"
  59. Set RsWebObj = Server.CreateObject(G_FS_RS)
  60. RsWebObj.Open Sql,Conn,3,3
  61. if Not RsWebObj.Eof then
  62. WebName = RsWebObj("WebName")
  63. WebUrl = RsWebObj("WebUrl")
  64. WebIntro = RsWebObj("WebIntro")
  65. WebEmail = RsWebObj("WebEmail")
  66. WebAdmin = RsWebObj("WebAdmin")
  67. WebCountTime = RsWebObj("WebCountTime")
  68. VisitAllNum = CLng(RsWebObj("VisitAllNum"))
  69. VisitToday = Clng(RsWebObj("VisitToday"))
  70. VisitMonth = RsWebObj("VisitMonth")
  71. RefreashNum = RsWebObj("RefreashNum")
  72. else
  73. Response.Redirect"Visit_sysPara.asp"
  74. Response.end
  75. end if
  76. %>
  77. <%
  78. Dim ForseeVisitToday,I,NumofDays,AverageNum,Tnum,TNumStr
  79. NumofDays=DATEDIFF("d",WebCountTime,Date())
  80. If NumofDays = 0 then
  81. NumofDays = 1
  82. End If
  83. AverageNum=CLng(VisitAllNum/NumofDays*1000)/1000
  84. I= Now()-Date()
  85. ForseeVisitToday = Round(VisitToday/I*(1-I) + VisitToday)
  86. %>
  87. <html>
  88. <head>
  89. <title>网站简要信息统计</title>
  90. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  91. </head>
  92. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  93. <script src="../../FS_Inc/PublicJS.js" language="JavaScript"></script>
  94. <body class="hback" topmargin="2" leftmargin="2">
  95. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"  class="table">
  96.   <tr class="xingmu"> 
  97.     <td height="30" colspan="2" class="xingmu"><strong>网站简要信息统计</strong></td>
  98.   </tr>
  99.   <tr class="hback"> 
  100.     <td width="19%" height="30"> <div align="center">网站名称</div></td>
  101.     <td width="81%"> <% = WebName %></td>
  102.   </tr>
  103.   <tr class="hback"> 
  104.     <td height="30"> <div align="center">管 理 员</div></td>
  105.     <td height="30"> <% = WebAdmin %></td>
  106.   </tr>
  107.   <tr class="hback"> 
  108.     <td height="30"> <div align="center">网站地址</div></td>
  109.     <td height="30"> <% = WebUrl %></td>
  110.   </tr>
  111.   <tr class="hback"> 
  112.     <td height="30"> <div align="center">网站信箱</div></td>
  113.     <td height="30"> <% = WebEmail %></td>
  114.   </tr>
  115.   <tr class="hback"> 
  116.     <td height="30"> <div align="center">网站简介</div></td>
  117.     <td height="30"> <% = WebIntro %></td>
  118.   </tr>
  119. </table>
  120. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  121.   <tr class="hback"> 
  122.     <td width="20%"> 
  123.       <div align="center">总 访问人数</div></td>
  124.     <td width="30%"> 
  125.       <% = VisitAllNum %></td>
  126.     <td width="20%"> 
  127.       <div align="center">开始统计日期</div></td>
  128.     <td width="30%"> 
  129.       <% = WebCountTime %></td>
  130.   </tr>
  131.   <tr class="hback"> 
  132.     <td> 
  133.       <div align="center">今日 访问量</div></td>
  134.     <td> 
  135.       <% =VisitToday %></td>
  136.     <td> 
  137.       <div align="center">本月 访 问量</div></td>
  138.     <td> 
  139.       <% =VisitMonth %></td>
  140.   </tr>
  141.   <tr class="hback"> 
  142.     <td> 
  143.       <div align="center">统 计 天 数</div></td>
  144.     <td> 
  145.       <% =NumofDays %></td>
  146.     <td> 
  147.       <div align="center">平均日访问量</div></td>
  148.     <td> 
  149.       <% = AverageNum%></td>
  150.   </tr>
  151.   <tr class="hback"> 
  152.     <td> 
  153.       <div align="center">整站页面刷新</div></td>
  154.     <td> 
  155.       <% =RefreashNum %></td>
  156.     <td> 
  157.       <div align="center">预计本日访问</div></td>
  158.     <td> 
  159.       <% =ForseeVisitToday %></td>
  160.   </tr>
  161. </table>
  162. </body>
  163. </html>
  164. <%
  165. RsWebObj.Close
  166. Conn.Close
  167. Set RsWebObj=nothing
  168. Set Conn=nothing
  169. %>