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

数据库编程

开发平台:

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. %>
  19. <html>
  20. <head>
  21. <title>按月信息统计</title>
  22. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  23. </head>
  24. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  25. <script src="../../FS_Inc/PublicJS.js" language="JavaScript"></script>
  26. <body topmargin="2" leftmargin="2">
  27. <table width="98%" height="56" border="0" align="center" cellpadding="5" cellspacing="0" class="table">
  28.   <tr> 
  29.     <td height="28" class="xingmu"><div align="left"><strong>按月信息统计</strong></div></td>
  30.   </tr>
  31.   <tr>
  32.     <td height="28" class="hback">
  33.       <%
  34. Dim RsMonthObj,Sql
  35. Set RsMonthObj = Server.CreateObject(G_FS_RS)
  36. Dim MaxVisitCount,VisitTime,VisitMonth,CurrentMonth
  37. CurrentMonth=Month(Now())
  38. If G_IS_SQL_DB=0 then
  39. Sql="Select VisitTime From FS_SS_Stat where DATEDIFF('m',VisitTime,Now()) < 12 And DATEDIFF('m',VisitTime,Now()) >=0"
  40. Else
  41. Sql="Select VisitTime From FS_SS_Stat where DATEDIFF(month,VisitTime,GetDate()) < 12 And DATEDIFF(month,VisitTime,GetDate()) >=0"
  42. End If
  43. RsMonthObj.Open Sql,Conn,3,3
  44. MaxVisitCount=0
  45. Dim VisitNum(12),I
  46. for I=1 To 12
  47. VisitNum(I)=0
  48. next
  49. Do While not RsMonthObj.Eof 
  50. VisitTime = RsMonthObj("VisitTime")
  51. VisitMonth = Month(VisitTime)
  52. for I=1 To 12
  53. if I=VisitMonth then
  54. VisitNum(I)=VisitNum(I)+1
  55. end if
  56. next
  57. RsMonthObj.MoveNext
  58. Loop
  59. for I=1 To 12
  60. if VisitNum(I)>=MaxVisitCount  then
  61. MaxVisitCount=VisitNum(I)
  62. end if
  63. next
  64. Dim VisitSize(12)
  65. For I=1 To 12
  66. if MaxVisitCount<>0 then
  67. VisitSize(I)=100*VisitNum(I)/MaxVisitCount
  68. else
  69. VisitSize(I)=0
  70. end if
  71. Next
  72. %>
  73.       <table border=0 align="center" cellpadding=2>
  74.         <tr> 
  75.           <td align=center>最近12个月统计图表</td>
  76.         </tr>
  77.         <tr> 
  78.           <td align=center><table border="0" cellspacing="0" cellpadding="0">
  79.               <tr> 
  80.                 <td><table border=0 align=center cellpadding=0 cellspacing=0>
  81.                     <tr> 
  82.                       <td height="25" valign=top align="right" nowrap> 
  83.                         <% Response.Write(MaxVisitCount&"次")%>
  84.                       </td>
  85.                     </tr>
  86.                     <tr> 
  87.                       <td  height="25" valign=top align="right"  nowrap> 
  88.                         <% if MaxVisitCount>3 then  
  89. Response.Write(Round(MaxVisitCount*0.75)&"次") 
  90. elseif MaxVisitCount>1  then 
  91. Response.Write((MaxVisitCount-1)&"次") 
  92. else Response.Write("&nbsp;") 
  93. end if
  94. %>
  95.                       </td>
  96.                     </tr>
  97.                     <tr> 
  98.                       <td  height="25" valign=top  align="right" nowrap> 
  99.                         <% if MaxVisitCount>3 then  
  100. Response.Write(Round(MaxVisitCount*0.5)&"次") 
  101. elseif MaxVisitCount>2  then 
  102. Response.Write((MaxVisitCount-2)&"次") 
  103. else Response.Write("&nbsp;") 
  104. end if
  105. %>
  106.                       </td>
  107.                     </tr>
  108.                     <tr> 
  109.                       <td  height="25" valign=top  align="right" nowrap> 
  110.                         <% if MaxVisitCount>3 then 
  111.  Response.Write(Round(MaxVisitCount*0.25)&"次") 
  112. else Response.Write("&nbsp;") 
  113. end if
  114. %>
  115.                       </td>
  116.                     </tr>
  117.                     <tr> 
  118.                       <td  height="31" valign=top  align="right" nowrap>0次</td>
  119.                     </tr>
  120.                   </table></td>
  121.                 <td valign="bottom"> <table align=center>
  122.                     <tr valign=bottom > 
  123.                       <% if CurrentMonth =12 then %>
  124.                       <% For I=1 To 12 %>
  125.                       <td width="15" align=center nowrap background=../../Images/Visit/tu_back.gif><img src=../Images/bar.gif width="15" height="<% =VisitSize(I) %>" id=htav><br> 
  126.                         <% = I%>
  127.                       </td>
  128.                       <% Next %>
  129.                       <% else %>
  130.                       <% For I=CurrentMonth+1 To 12 %>
  131.                       <td width="15" align=center nowrap background=../../Images/Visit/tu_back.gif><img src=../Images/bar.gif width="15" height="<% =VisitSize(I) %>" id=htav><br> 
  132.                         <% = I%>
  133.                       </td>
  134.                       <% Next %>
  135.                       <% For I=1 To CurrentMonth  %>
  136.                       <td width="15" align=center nowrap background=../../Images/Visit/tu_back.gif><img src=../Images/bar.gif width="15" height="<% =VisitSize(I) %>" id=htav><br> 
  137.                         <% = I%>
  138.                       </td>
  139.                       <% Next %>
  140.                       <% end if %>
  141.                       <td>单位(月)</td>
  142.                     </tr>
  143.                   </table></td>
  144.               </tr>
  145.             </table></td>
  146.         </tr>
  147.       </table>
  148.       <p>&nbsp;</p>
  149.       <%
  150. Dim RsMonthsObj
  151. Set RsMonthsObj = Server.CreateObject(G_FS_RS)
  152. Sql="Select VisitTime From FS_SS_Stat"
  153. RsMonthsObj.Open Sql,Conn,3,3
  154. MaxVisitCount=0
  155. for I=1 To 12
  156. VisitNum(I)=0
  157. next
  158. Do While not RsMonthsObj.Eof 
  159. VisitTime = RsMonthsObj("VisitTime")
  160. VisitMonth = Month(VisitTime)
  161. for I=1 To 12
  162. if I=VisitMonth then
  163. VisitNum(I)=VisitNum(I)+1
  164. end if
  165. next
  166. RsMonthsObj.MoveNext
  167. Loop
  168. for I=1 To 12
  169. if VisitNum(I)>=MaxVisitCount  then
  170. MaxVisitCount=VisitNum(I)
  171. end if
  172. next
  173. %>
  174.       <% 
  175. Dim VisitsSize(12),AllCount
  176. AllCount=0
  177. For I=1 To 12
  178. Allcount=AllCount+VisitNum(I)
  179. Next
  180. For I=0 To 12
  181. if VisitNum(I)<>0 then
  182. VisitsSize(I)=100*VisitNum(I)/AllCount
  183. else
  184. VisitsSize(I)=0
  185. end if
  186. Next
  187. %>
  188.       <table border=0 align="center" cellpadding=2>
  189.         <tr> 
  190.           <td align=center>访问量12个月分配图表</td>
  191.         </tr>
  192.         <tr> 
  193.           <td align=center><table border="0" cellspacing="0" cellpadding="0">
  194.               <tr> 
  195.                 <td><table border=0 align=center cellpadding=0 cellspacing=0>
  196.                     <tr> 
  197.                       <td height="25" valign=top align="right" nowrap>100%</td>
  198.                     </tr>
  199.                     <tr> 
  200.                       <td  height="25" valign=top align="right"  nowrap>75%</td>
  201.                     </tr>
  202.                     <tr> 
  203.                       <td  height="25" valign=top  align="right" nowrap>50%</td>
  204.                     </tr>
  205.                     <tr> 
  206.                       <td  height="25" valign=top  align="right" nowrap>25%</td>
  207.                     </tr>
  208.                     <tr> 
  209.                       <td  height="31" valign=top  align="right" nowrap>0</td>
  210.                     </tr>
  211.                   </table></td>
  212.                 <td valign="bottom"> <table align=center>
  213.                     <tr valign=bottom > 
  214.                       <td width="15" align=center nowrap background=../images/tu_back.gif><img src=../Images/bar.gif width="15" height="100" id=htav><br>
  215.                         总</td>
  216.                       <% For I=1 To 12 %>
  217.                       <td width="15" align=center nowrap background=../../Images/Visit/tu_back.gif><img src=../Images/bar.gif width="15" height="<% =VisitsSize(I) %>" id=htav><br> 
  218.                         <% = I%>
  219.                       </td>
  220.                       <% Next %>
  221.                       <td>单位(月)</td>
  222.                     </tr>
  223.                   </table></td>
  224.               </tr>
  225.             </table></td>
  226.         </tr>
  227.       </table></td>
  228.   </tr>
  229. </table>
  230. </body>
  231. </html>
  232. <%
  233. Conn.Close
  234. Set Conn=Nothing
  235. %>