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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="../../FS_Inc/Func_page.asp" -->
  7. <%'Copyright (c) 2006 Foosun Inc. Code by 邓西
  8. response.buffer=true
  9. Response.CacheControl = "no-cache"
  10. Dim Conn,User_Conn
  11. MF_Default_Conn
  12. MF_Session_TF 
  13. if not MF_Check_Pop_TF("AS_site") then Err_Show
  14. if not MF_Check_Pop_TF("AS002") then Err_Show
  15. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_
  16. Dim Page,cPageNo
  17. int_RPP=5 '设置每页显示数目
  18. int_showNumberLink_=8 '数字导航显示数目
  19. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  20. str_nonLinkColor_="#999999" '非热链接颜色
  21. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  22. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  23. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  24. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  25. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  26. toL_="<font face=webdings title=""最后一页"">:</font>" '尾页
  27. Dim str_Action,int_ID,strShowErr,CheckAllID
  28. str_Action=Request.QueryString("Action")
  29. int_ID=Request.QueryString("ID")
  30. CheckAllID=Request.Form("Checkallbox")
  31. Select Case str_Action
  32. Case "DelOne"
  33. If int_ID="" Or IsNull(int_ID) Then
  34. strShowErr = "<li>参数错误!</li>"
  35. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  36. Response.end
  37. Else
  38. If Isnumeric(int_ID)=False Then
  39. strShowErr = "<li>参数错误!</li>"
  40. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  41. Response.end
  42. Else
  43. Conn.execute("Delete * From FS_AD_Source Where AdID="&Clng(int_ID)&"")
  44. strShowErr = "<li>清空统计信息成功!</li>"
  45. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_Count.asp?Page="&Request.QueryString("Page")&"")
  46. Response.end
  47. End If
  48. End If
  49. Case "P_Del"
  50. If CheckAllID="" or IsNull(CheckAllID) Then
  51. strShowErr = "<li>请选择要清空统计信息的广告!</li>"
  52. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  53. Response.end
  54. End If
  55. CheckAllID=split(CheckAllID,",")
  56. For i=0 to Ubound(CheckAllID)
  57. TempID=TempID&CheckAllID(i)&","
  58. Next
  59. Conn.execute("Delete * From FS_AD_Source Where AdID in ("&TempID&")")
  60. strShowErr = "<li>批量清空统计信息成功!</li>"
  61. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_Count.asp?Page="&Request.QueryString("Page")&"")
  62. Response.end
  63. Case "DelAll"
  64. Conn.execute("Delete From FS_AD_Source")
  65. strShowErr = "<li>清空统计信息成功!</li>"
  66. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_Count.asp")
  67. Response.end
  68. End Select
  69. %>
  70. <html>
  71. <head>
  72. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  73. <title>广告统计___Powered by foosun Inc.</title>
  74. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  75. </head>
  76. <body>
  77. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  78.   <tr class="hback"> 
  79.     <td class="xingmu">广告详细统计</td>
  80.   </tr>
  81. </table>
  82. <%
  83. Dim o_Count_Rs,str_Count_Sql
  84. str_Count_Sql= "Select AdID,AdName,AdClickNum,AdShowNum from FS_AD_Info order by AdID Desc"
  85. Set o_Count_Rs= CreateObject(G_FS_RS)
  86. o_Count_Rs.Open str_Count_Sql,Conn,1,1
  87. If Not o_Count_Rs.Eof Then
  88. %>
  89. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  90. <form name="AdsCount" method="post" action="">
  91.   <tr class="hback">
  92.     <td width="279" align="center" class="xingmu">广告名称</td>
  93.     <td width="90" align="center" class="xingmu">被点击次数</td>
  94.     <td width="82" align="center" class="xingmu">已显示次数</td>
  95.     <td width="101" align="center" class="xingmu">来源统计</td>
  96.     <td width="84" align="center" class="xingmu">时统计</td>
  97.     <td width="73" align="center" class="xingmu">日统计</td>
  98.     <td width="68" align="center" class="xingmu">月统计</td>
  99.     <td width="99" align="center" class="xingmu">清空统计信息</td>
  100.   </tr>
  101. <%
  102. o_Count_Rs.PageSize=int_RPP
  103. cPageNo=NoSqlHack(Request.QueryString("page"))
  104. If cPageNo="" Then cPageNo = 1
  105. If not isnumeric(cPageNo) Then cPageNo = 1
  106. cPageNo = Clng(cPageNo)
  107. If cPageNo<=0 Then cPageNo=1
  108. If cPageNo>o_Count_Rs.PageCount Then cPageNo=o_Count_Rs.PageCount 
  109. o_Count_Rs.AbsolutePage=cPageNo
  110. For int_Start=1 TO int_RPP  
  111. %>
  112.   <tr class="hback">
  113.     <td class="hback"><%=o_Count_Rs("AdName")%></td>
  114.     <td align="center" class="hback"><%=o_Count_Rs("AdClickNum")%></td>
  115.     <td align="center" class="hback"><%=o_Count_Rs("AdShowNum")%></td>
  116.     <td align="center" class="hback"><a href="javascript:ShowSource('<%=o_Count_Rs("AdID")%>','<%=o_Count_Rs("AdName")%>');">点击查看</a></td>
  117.     <td align="center" class="hback"><a href="javascript:ShowHour('<%=o_Count_Rs("AdID")%>','<%=o_Count_Rs("AdName")%>')">点击查看</a></td>
  118.     <td align="center" class="hback"><a href="javascript:ShowDay('<%=o_Count_Rs("AdID")%>','<%=o_Count_Rs("AdName")%>')">点击查看</a></td>
  119.     <td align="center" class="hback" width="68"><a href="javascript:ShowMonth('<%=o_Count_Rs("AdID")%>','<%=o_Count_Rs("AdName")%>')">点击查看</a></td>
  120.     <td align="center" class="hback" width="99"><a href="javascript:DelCount('<%=o_Count_Rs("AdID")%>');">清空 | <input type="checkbox" name="Checkallbox" value="<%=o_Count_Rs("AdID")%>"></a></td>
  121.   </tr>
  122. <%
  123. o_Count_Rs.MoveNext
  124. If o_Count_Rs.Eof or o_Count_Rs.Bof Then Exit For
  125. Next
  126. Response.Write "<tr><td class=""hback"" colspan=""8"" align=""left"">"&fPageCount(o_Count_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"&nbsp;&nbsp;全选<input type=""checkbox"" name=""Checkallbox"" onclick=""javascript:CheckAll('Checkallbox');""> <input type=""button"" name=""NamePDel"" onclick=""javascript:P_Del();"" value="" 批量清空 ""> <input type=""button"" name=""NameDelAll"" onclick=""javascript:DelAll();"" value="" 全部清空 ""></td></tr>"
  127. %>
  128. </form>
  129. </table>
  130. <%
  131. Else
  132. Response.write"<table width=""98%"" border=0 align=center cellpadding=2 cellspacing=1 class=table><tr class=""hback""><td>当前没有广告!</td></tr></table>"
  133. End If
  134. o_Count_Rs.Close
  135. Set o_Count_Rs=Nothing
  136. %>
  137. </body>
  138. </html>
  139. <script language="javascript">
  140. function ShowSource(ID,Name)
  141. {
  142. window.location='Ads_ShowCount.asp?AdName='+Name+'&ID='+ID;
  143. }
  144. function ShowDay(ID,Name)
  145. {
  146. window.location='Visit_DaysStatistic.asp?AdName='+Name+'&ID='+ID;
  147. }
  148. function ShowHour(ID,Name)
  149. {
  150. window.location='Visit_HoursStatistic.asp?AdName='+Name+'&ID='+ID;
  151. }
  152. function ShowMonth(ID,Name)
  153. {
  154. window.location='Visit_MonthsStatistic.asp?AdName='+Name+'&ID='+ID;
  155. }
  156. function DelCount(ID)
  157. {
  158. if (confirm('此操作将清空此广告所有的统计信息n你确定清空吗?'))
  159. {
  160. window.location='?Action=DelOne&ID='+ID;
  161. }
  162. }
  163. function P_Del()
  164. {
  165. if (confirm('此操作将清空所选广告所有的统计信息n你确定清空吗?'))
  166. {
  167. document.AdsCount.action='?Action=P_Del';
  168. document.AdsCount.submit();
  169. }
  170. }
  171. function DelAll()
  172. {
  173. if (confirm('此操作将清空所有广告统计信息n你确定清空吗?'))
  174. {
  175. window.location='?Action=DelAll';
  176. }
  177. }
  178. function CheckAll(CheckType)
  179. {
  180. var checkBoxArray=document.all(CheckType)
  181. if(checkBoxArray[checkBoxArray.length-1].checked)
  182. {
  183. for(var i=0;i<checkBoxArray.length-1;i++)
  184. {
  185. checkBoxArray[i].checked=true;
  186. }
  187. }else
  188. {
  189. for(var i=0;i<checkBoxArray.length-1;i++)
  190. {
  191. checkBoxArray[i].checked=false;
  192. }
  193. }
  194. }
  195. </script>
  196. <%
  197. Set Conn=nothing
  198. %><!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->