procomm.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:9k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="inc/config.asp"-->
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. dim action
  8. action=request.QueryString("action")
  9. select case action
  10. case "del"
  11. if request("audit").count=0 then
  12. call MsgBox("您没有选择要删除的评论?","None","None")
  13. else
  14. if session("rank")>1 then
  15. call Msgbox("对不起,您的权限不够!","Back","None")
  16. response.End
  17. end if
  18. conn.execute ("delete from review where reviewid in ("&request("audit")&")")
  19. call MsgBox("批量删除成功!","None","None")
  20. end if
  21. case "audit"
  22. if request("audit").count=0 then
  23. call MsgBox("您没有选择要审核的评论?","None","None")
  24. else
  25. if session("rank")>1 then
  26. call Msgbox("对不起,您的权限不够!","Back","None")
  27. response.End
  28. end if
  29. conn.execute "update review set audit=1 where reviewid in ("&request("audit")&")"
  30. call MsgBox("批量审核成功!","None","None")
  31. end if
  32. case "delzhou"
  33. if session("rank")>1 then
  34. call Msgbox("对不起,您的权限不够!","Back","None")
  35. response.End
  36. end if
  37. dim theday
  38. theday=date-7
  39. conn.execute ("delete from review where reviewdtm<#"&theday&"# and audit=0")
  40. call MsgBox("一周前未审核评论删除成功!","None","None")
  41. case "delall"
  42. if session("rank")>1 then
  43. call Msgbox("对不起,您的权限不够!","Back","None")
  44. response.End
  45. end if
  46. conn.execute ("delete from review where audit=0")
  47. call MsgBox("所有未审核评论删除成功!","None","None")
  48. end select
  49. %>
  50. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  51. <html>
  52. <head>
  53. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  54. <title>406网络书店</title>
  55. <link href="../style.css" rel="stylesheet" type="text/css">
  56. </head>
  57. <body>
  58. <!--#include file="head.htm"-->
  59. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  60.   <tr>
  61.     <td width="219" align="left" valign="top"><br>
  62.       <!--#include file="menu.htm"-->
  63.         <br></td><td width="561" align="left" valign="top">
  64.       <br>      <table border="0" cellpadding="0" cellspacing="0">
  65.         <tr>
  66.           <td><img src="../images/w.gif" width="18" height="18"></td>
  67.           <td style="color:#415373">商品评论</td>
  68.         </tr>
  69.       </table>      <br>      <%dim dtype
  70. dtype=request.QueryString("dtype")
  71. if dtype="" then 
  72. dtype="no"
  73. end if
  74. %>      <form name="form1" method="post" action="">
  75.   
  76.       <table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
  77.           <tr>
  78.             <td bgcolor="#FFFFFF" align="center"><a href="procomm.asp?dtype=no">未审核的评论</a></td>
  79.             <td bgcolor="#FFFFFF" align="center"><a href="procomm.asp?dtype=yes">已审核的评论</a></td>
  80.           </tr>
  81.           <tr bgcolor="#FFFFFF">
  82.             <td colspan="2"><%
  83. Const MaxPerPage=20 
  84.     dim totalPut   
  85.     dim CurrentPage
  86.     dim TotalPages
  87.     dim j
  88.     dim sql
  89.      if Not isempty(request("page")) then
  90.        currentPage=Cint(request("page"))
  91.     else
  92.        currentPage=1
  93.     end if 
  94. set rs=server.CreateObject("adodb.recordset")
  95.   select case dtype
  96.   case "no"
  97.   rs.open "select product.name,product.id,review.reviewid,review.reviewcontent,review.reviewdtm from review,product where product.id=review.id and review.audit=0",conn,1,1
  98.   case "yes"
  99.      rs.open "select product.name,product.id,review.reviewid,review.reviewcontent,review.reviewdtm from review,product where product.id=review.id and review.audit=1",conn,1,1
  100.   end select
  101. if err.number<>0 then
  102. response.write "数据库中无数据"
  103. end if
  104. if rs.eof And rs.bof then
  105.         Response.Write "<p align='center' class='contents'> 目前还没有任何评论!</p>"
  106.     else
  107.    totalPut=rs.recordcount
  108.        if currentpage<1 then
  109.            currentpage=1
  110.        end if
  111.        if (currentpage-1)*MaxPerPage>totalput then
  112.     if (totalPut mod MaxPerPage)=0 then
  113.       currentpage= totalPut  MaxPerPage
  114.     else
  115.        currentpage= totalPut  MaxPerPage + 1
  116.     end if
  117.        end if
  118.         if currentPage=1 then
  119.              showContent
  120.              showpage totalput,MaxPerPage,"admincomment.asp"
  121.         else
  122.            if (currentPage-1)*MaxPerPage<totalPut then
  123.              rs.move  (currentPage-1)*MaxPerPage
  124.              dim bookmark
  125.              bookmark=rs.bookmark
  126.              showContent
  127.               showpage totalput,MaxPerPage,"admincomment.asp"
  128.          else
  129.          currentPage=1
  130.             showContent
  131.             showpage totalput,MaxPerPage,"admincomment.asp"
  132.        end if
  133.     end if
  134.         end if
  135.     sub showContent
  136.         dim i
  137.     i=0
  138. response.write "<table width=12 height=7 border=0 cellpadding=0 cellspacing=0><tr><td height=7></td></tr></table>"
  139. %>
  140.               <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
  141.                 <tr bgcolor="#FFFFFF">
  142.                   <td width="32%" align="center"><font color="#FF0000">评论商品名称</font></td>
  143.                   <td width="26%" align="center"><font color="#FF0000">评论正文</font></td>
  144.                   <td width="33%" align="center"><font color="#FF0000">评论时间</font></td>
  145.                   <td width="9%" align="center"><font color="#FF0000">操 作</font></td>
  146.                 </tr>
  147.                 <%  
  148.  
  149.   do while not rs.eof%>
  150.                 <tr bgcolor="#FFFFFF" align="center">
  151.                   <td>
  152.                     <%
  153. response.write "<a href=../vpro.asp?id="&rs("id")&" target=_blank title="&trim(rs("name"))&">"&strvalue(trim(rs("name")),18)&"...</a>"
  154. %>
  155.                   </td>
  156.                   <td>
  157.                     <%
  158. response.write "<a href=# title="&trim(rs("reviewcontent"))&">"&strvalue(trim(rs("reviewcontent")),20)&"...</a>"
  159. %>
  160.   
  161.                   </td>
  162.                   <td><%=rs("reviewdtm")%></td>
  163.                   <td>
  164.                     <input name="audit" type="checkbox" id="audit3" value="<%=rs("reviewid")%>">
  165.                   </td>
  166.                 </tr>
  167.                 <%i=i+1
  168.   if i>=MaxPerPage then Exit Do
  169.   rs.movenext
  170.   loop
  171.   rs.close
  172.   set rs=nothing
  173.   %>
  174.                 <tr bgcolor="#FFFFFF">
  175.                   <td height="30" colspan="4" align="center">
  176.                     <%if dtype="no" then%>
  177.                     <input type="submit" name="Submit" value="通过审核" onClick="this.form.action='procomm.asp?action=audit';this.form.submit()">
  178.                     <%end if%>
  179.       &nbsp;
  180.                     <input type="button" name="Submit2" value="删 除" onClick="this.form.action='procomm.asp?action=del';this.form.submit()">
  181. &nbsp;&nbsp;全选
  182.                 <input type="checkbox" name="checkbox" value="Check All" onClick="mm()">
  183.                   </td>
  184.                 </tr>
  185.               </table>
  186.               <%  
  187. End Sub   
  188.   
  189. Function showpage(totalnumber,maxperpage,filename)  
  190.    Dim n
  191.   
  192. If totalnumber Mod maxperpage=0 Then  
  193. n= totalnumber  maxperpage  
  194. Else
  195. n= totalnumber  maxperpage+1  
  196. End If
  197. Response.Write "<form method=Post action="&filename&"?action="&action&">"  
  198. Response.Write "<p align='center' class='contents'> "  
  199. If CurrentPage<2 Then  
  200. Response.Write "<font class='contents'>首页 上一页</font> "  
  201. Else  
  202. Response.Write "<a href="&filename&"?page=1&action="&action&" class='contents'>首页</a> "  
  203. Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&action="&action&" class='contents'>上一页</a> "  
  204. End If
  205. If n-currentpage<1 Then  
  206. Response.Write "<font class='contents'>下一页 尾页</font>"  
  207. Else  
  208. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&action="&action&" class='contents'>"  
  209. Response.Write "下一页</a> <a href="&filename&"?page="&n&"&action="&action&" class='contents'>尾页</a>"  
  210. End If  
  211. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  212. Response.Write "<font class='contents'> 共有"&totalnumber&"条记录 " 
  213. Response.Write "<font class='contents'>" 
  214. Response.Write "</form>"  
  215. End Function  
  216. %>            </td>
  217.             
  218.         </tr>
  219.         </table>
  220.       </form>      <table border="0" align="center" cellpadding="2" cellspacing="0">
  221.         <tr>
  222.           <td><input type="submit" name="Submit42" value="删除一周前未审核评论" onClick="if(confirm('您确定这样操作吗?')) location.href='procomm.asp?action=delzhou';else return;">
  223.             <input type="submit" name="Submit4" value="删除所有未审核评论" onClick="if(confirm('您确定这样操作吗?')) location.href='procomm.asp?action=delall';else return;"></td>
  224.         </tr>
  225.       </table>      <script language=javascript>
  226. function mm()
  227. {
  228.    var a = document.getElementsByTagName("input");
  229.    if(a[0].checked==true){
  230.    for (var i=0; i<a.length; i++)
  231.       if (a[i].type == "checkbox") a[i].checked = false;
  232.    }
  233.    else
  234.    {
  235.    for (var i=0; i<a.length; i++)
  236.       if (a[i].type == "checkbox") a[i].checked = true;
  237.    }
  238. }
  239.       </script>      <br>
  240.       </td>
  241.   </tr>
  242. </table>
  243. <!--#include file="foot.htm"-->
  244. </body>
  245. </html>