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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../../FS_Inc/Func_Page.asp" -->
  6. <%
  7. dim Conn,User_Conn,strShowErr
  8. MF_Default_Conn
  9. MF_User_Conn
  10. MF_Session_TF
  11. if not MF_Check_Pop_TF("ME_Review") then Err_Show 
  12. if not MF_Check_Pop_TF("ME038") then Err_Show 
  13. Function GetFriendName(f_strNumber)
  14. Dim RsGetFriendName
  15. Set RsGetFriendName = User_Conn.Execute("Select UserName From FS_ME_Users Where UserNumber = '"& f_strNumber &"'")
  16. If  Not RsGetFriendName.eof  Then 
  17. GetFriendName = RsGetFriendName("UserName")
  18. Else
  19. GetFriendName = 0
  20. End If 
  21. set RsGetFriendName = nothing
  22. End Function 
  23. if Request.Form("Action")="Del" then
  24. if trim(Request.Form("Id"))="" then
  25. strShowErr = "<li>请选择至少一项</li>"
  26. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  27. Response.end
  28. end if
  29. User_Conn.execute("Delete From FS_ME_Review where ReviewID in ("&Request.Form("Id")&")")
  30. strShowErr = "<li>删除成功</li>"
  31. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/Review.asp")
  32. Response.end
  33. end if
  34. if Request.Form("Action")="DelAll" then
  35. User_Conn.execute("Delete From FS_ME_Review")
  36. Call MF_Insert_oper_Log("删除评论","删除了所有评论",now,session("admin_name"),"ME")
  37. strShowErr = "<li>删除所有评论成功</li>"
  38. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/Review.asp")
  39. Response.end
  40. end if
  41. if Request.Form("Action")="UnLock" then
  42. if trim(Request.Form("Id"))="" then
  43. strShowErr = "<li>请选择至少一项</li>"
  44. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  45. Response.end
  46. end if
  47. User_Conn.execute("Update FS_ME_Review set AdminLock=0 where IsLock=0 and ReviewID in ("&Request.Form("Id")&")")
  48. strShowErr = "<li>批量审核成功</li>"
  49. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/Review.asp")
  50. Response.end
  51. end if
  52. if Request.Form("Action")="Lock" then
  53. if trim(Request.Form("Id"))="" then
  54. strShowErr = "<li>请选择至少一项</li>"
  55. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  56. Response.end
  57. end if
  58. User_Conn.execute("Update FS_ME_Review set AdminLock=1 where IsLock=0 and ReviewID in ("&Request.Form("Id")&")")
  59. strShowErr = "<li>批量锁定成功</li>"
  60. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/Review.asp")
  61. Response.end
  62. end if
  63. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo,strpage,i
  64. int_RPP=25 '设置每页显示数目
  65. int_showNumberLink_=8 '数字导航显示数目
  66. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  67. str_nonLinkColor_="#999999" '非热链接颜色
  68. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  69. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  70. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  71. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  72. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  73. toL_="<font face=webdings title=""最后一页"">:</font>"
  74. strpage=request("page")
  75. if len(strpage)=0 Or strpage<1 or trim(strpage)=""Then:strpage="1":end if
  76. %>
  77. <html xmlns="http://www.w3.org/1999/xhtml">
  78. <HEAD>
  79. <TITLE>FoosunCMS</TITLE>
  80. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  81. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  82. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes>
  83. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  84.   <tr class="hback"> 
  85.     <td width="100%" class="xingmu">评论管理</td>
  86.   </tr class="hback">
  87.   <tr class="hback">
  88.     <td class="hback"><a href="Review.asp">全部</a>┆<a href="Review.asp?isLock=1">未审核</a>┆<a href="Review.asp?isLock=0">已审核</a>┆<a href="Review.asp?type=0">新闻评论</a>┆<a href="Review.asp?type=1">下载评论</a>┆<a href="Review.asp?type=2">商品评论</a>┆<a href="Review.asp?type=3">房产评论</a>┆<a href="Review.asp?type=4">供求评论</a>┆<a href="Review.asp?type=5">日记评论</a>┆<a href="Review.asp?type=6">相册评论</a></td>
  89.   </tr class="hback">
  90. </table>
  91. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  92.   <form action="Review.asp"  method="post" name="form1" id="form1">
  93.     <tr class="hback"> 
  94.       <td width="32%" class="xingmu"><div align="left"><strong> 标题</strong></div></td>
  95.       <td width="14%" class="xingmu"><div align="center"><strong>IP</strong></div></td>
  96.       <td width="13%" class="xingmu"><div align="center"><strong>发表人</strong></div></td>
  97.       <td width="16%" class="xingmu"><div align="center"><strong>日期</strong></div></td>
  98.       <td width="7%" class="xingmu"><div align="center"><strong>类型</strong></div></td>
  99.       <td width="14%" class="xingmu"><div align="center"><strong>状态</strong></div></td>
  100.       <td width="4%" class="xingmu">&nbsp;</td>
  101.     </tr>
  102.     <%
  103. dim rs_reviewsql,rs_review,str_type,str_isLock
  104. strpage=request("page")
  105. if len(strpage)=0 Or strpage<1 or trim(strpage)=""  Then strpage="1"
  106. if NoSqlHack(Request.QueryString("type"))<>"" then:str_type=" and ReviewTypes="&NoSqlHack(Request.QueryString("type"))&"":else:str_type="":end if
  107. if NoSqlHack(Request.QueryString("isLock"))<>"" then:str_isLock=" and AdminLock="&NoSqlHack(Request.QueryString("isLock"))&"":else:str_isLock="":end if
  108. Set rs_review = Server.CreateObject(G_FS_RS)
  109. rs_reviewsql = "Select * From FS_ME_Review  where 1=1 "& str_type & str_isLock &"  order by  Addtime desc, ReviewID desc"
  110. rs_review.Open rs_reviewsql,User_Conn,1,1
  111. if rs_review.eof then
  112.    rs_review.close
  113.    set rs_review=nothing
  114.    Response.Write"<tr  class=""hback""><td colspan=""7""  class=""hback"" height=""40"">没有记录。</td></tr>"
  115. else
  116. rs_review.PageSize=int_RPP
  117. cPageNo=NoSqlHack(Request.QueryString("Page"))
  118. If cPageNo="" Then cPageNo = 1
  119. If not isnumeric(cPageNo) Then cPageNo = 1
  120. cPageNo = Clng(cPageNo)
  121. If cPageNo>rs_review.PageCount Then cPageNo=rs_review.PageCount 
  122. If cPageNo<=0 Then cPageNo=1
  123. rs_review.AbsolutePage=cPageNo
  124. for i=1 to int_RPP
  125. if rs_review.eof Then exit For 
  126. %>
  127.     <tr class="hback"> 
  128.       <td class="hback"><div align="left" id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(rid<%=rs_review("ReviewID")%>);" language=javascript> 
  129.           <a href="#"> 
  130.           <% = rs_review("title")%>
  131.           </a></div></td>
  132.       <td class="hback"><div align="center"><% = rs_review("ReviewIP")%></div></td>
  133.       <td class="hback"><div align="center"><a href="../../<%=G_USER_DIR%>/ShowUser.asp?UserNumber=<% = rs_review("UserNumber")%>" target="_blank"> 
  134.           <% = GetFriendName(rs_review("UserNumber"))%>
  135.           </a> </div></td>
  136.       <td class="hback"><div align="center"> 
  137.           <% = rs_review("addtime")%>
  138.         </div></td>
  139.       <td class="hback"><div align="center"> 
  140.           <%'0为新闻评论,1为下载评论,2为商品,3为房产评论,4为供求评论,5日记,6相册
  141. select case rs_review("ReviewTypes")
  142. case 0
  143. response.Write"<a href=Review.asp?type=0>新闻</a>"
  144. case 1
  145. response.Write"<a href=Review.asp?type=1>下载</a>"
  146. case 2
  147. response.Write"<a href=Review.asp?type=2>商品</a>"
  148. case 3
  149. response.Write"<a href=Review.asp?type=3>房产</a>"
  150. case 4
  151. response.Write"<a href=Review.asp?type=4>供求</a>"
  152. case 5
  153. response.Write"<a href=Review.asp?type=5>日志</a>"
  154. case 6
  155. response.Write"<a href=Review.asp?type=6>相册</a>"
  156. case else
  157. response.Write"<a href=Review.asp>-</a>"
  158. end select
  159. %>
  160.         </div></td>
  161.       <td class="hback"><div align="center"> 
  162.           <%
  163. if rs_review("IsLock")="1" then
  164. response.Write("用户锁定┆")
  165. else
  166. response.Write("用户开放┆")
  167. end if
  168. if rs_review("AdminLock")="1" then
  169. response.Write("<span class=tx>未审核</span>")
  170. else
  171. response.Write("已审核")
  172. end if
  173.   %>
  174.         </div></td>
  175.       <td class="hback"><div align="center"> 
  176.           <input name="ID" type="checkbox" id="ID" value="<% = rs_review("ReviewID")%>">
  177.         </div></td>
  178.     </tr>
  179.     <tr class="hback" id="rid<%=rs_review("ReviewID")%>" style="display:none"> 
  180.       <td height="31" colspan="7" class="hback"> <strong>评论内容:</strong> 
  181.         <% = rs_review("Content")%>
  182.       </td>
  183.     </tr>
  184.     <%
  185.   rs_review.MoveNext
  186.   Next
  187.   %>
  188.     <tr class="hback"> 
  189.       <td width="80%" colspan="7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  190.   <tr>
  191.     <td align="left"><%
  192. response.Write "<p>"&  fPageCount(rs_review,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
  193. %></td>
  194.     <td><input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)"><input name="Action" type="hidden" id="Action" value="">
  195.               <input type="button" name="Submit2" value="删除"  onClick="document.form1.Action.value='Del';{if(confirm('确定清除您所选择的记录吗?')){this.document.form1.submit();return true;}return false;}">
  196.               <input type="button" name="Submit22" value="批量审核"  onClick="document.form1.Action.value='UnLock';{if(confirm('您确定要批量审核通过吗?')){this.document.form1.submit();return true;}return false;}">
  197.               <input type="button" name="Submit23" value="批量锁定"  onClick="document.form1.Action.value='Lock';{if(confirm('您确定要锁定?')){this.document.form1.submit();return true;}return false;}">
  198.               <input type="button" name="Submit232" value="删除所有"  onClick="document.form1.Action.value='DelAll';{if(confirm('您确定要删除所有评论吗?n删除后将不能恢复!!!')){this.document.form1.submit();return true;}return false;}"></td>
  199.   </tr>
  200. </table>
  201.  </td>
  202.     </tr>
  203.   </FORM>
  204. </table>
  205.   </body>
  206. </html>
  207. <%
  208. set conn=nothing
  209. set User_Conn=nothing
  210. end if
  211. %>
  212. <script language="JavaScript" type="text/JavaScript">
  213. function CheckAll(form)  
  214.   {  
  215.   for (var i=0;i<form1.elements.length;i++)  
  216.     {  
  217.     var e = form1.elements[i];  
  218.     if (e.name != 'chkall')  
  219.        e.checked = form1.chkall.checked;  
  220.     }  
  221.   }
  222. function opencat(cat)
  223. {
  224.   if(cat.style.display=="none"){
  225.      cat.style.display="";
  226.   } else {
  227.      cat.style.display="none"; 
  228.   }
  229. }
  230. </script>