MessageList.asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:10k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <HTML xmlns="http://www.w3.org/1999/xhtml">
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
  4. <TITLE>留言列表</TITLE>
  5. <link rel="stylesheet" href="Images/Admin.css">
  6. <script language="javascript" src="../Script/Admin.js"></script>
  7. </HEAD>
  8. <!--#include file="../Include/Const.asp" -->
  9. <!--#include file="../Include/ConnSiteData.asp" -->
  10. <!--#include file="CheckAdmin.asp"-->
  11. <BODY>
  12. <%
  13. if Instr(session("AdminPurview"),"|22,")=0 then
  14.   response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
  15.   response.end
  16. end if
  17. %>
  18. <%
  19. dim Result,Keyword
  20. Result=request.QueryString("Result")
  21. Keyword=request.QueryString("Keyword")
  22. function PlaceFlag()
  23.   if Result="Search" then
  24. If Keyword<>"" Then
  25. Response.Write "留言:列表 -> 检索 -> 关键字:<font color='red'>"&Keyword&"</font>"
  26. Else
  27. Response.Write "留言:列表 -> 检索 -> 关键字为空(显示全部留言)"
  28. End If
  29.   else
  30.     if SortPath<>"" then
  31.       Response.Write "留言:列表 -> <a href='MessageList.asp'>全部</a>"
  32.   TextPath(SortID)
  33. else
  34.       Response.Write "留言:列表 -> 全部"
  35. end if
  36.   end if
  37. end function
  38. %>
  39. <br>
  40. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  41. <form name="formSearch" method="post" action="Search.asp?Result=Message">
  42.   <tr>
  43.     <th height="22" colspan="2">【留言检索及分类查看】</th>
  44.   </tr>
  45.   <tr>
  46.     <td class="forumRow">关键字:<input name="Keyword" type="text" value="<%=Keyword%>" size="20"> <input name="submitSearch" type="submit" value="搜索留言"></td>
  47.     <td align="right" class="forumRow">查看:<font color="#0000FF">&nbsp;</font><a href="SetSite.asp#Message" target="mainFrame" onclick='changeAdminFlag(&quot;网站信息设置&quot;)'>设置自动审核</a></td>
  48.   </tr>
  49.   <tr>
  50.     <td colspan="2" class="forumRow"><%PlaceFlag()%></td>
  51.   </tr>
  52.   </form>
  53. </table>
  54. <br>
  55. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  56. <form action="DelContent.asp?Result=Message" method="post" name="formDel">
  57.   <tr>
  58.     <td class="title" width="20">ID</td>
  59. <td class="title" width="20">中</td>
  60. <td class="title" width="20">英</td>
  61. <td class="title" width="80">留言人</td>
  62. <td class="title">标题</td>
  63. <td class="title" width="40">状态</td>
  64. <td class="title" width="120">留言时间</td>
  65. <td class="title" width="120">回复时间</td>
  66. <td class="title" width="80">操作</td>
  67. <td width="80" align="center" class="title"><input onClick="CheckAll(this.form)" name="buttonAllSelect" type="button" id="submitAllSearch" value="全选"> <input onClick="CheckOthers(this.form)" name="buttonOtherSelect" type="button" id="submitOtherSelect" value="反选"></td>  </tr>
  68.   <% MessageList() %>
  69.   </form>
  70. </table>
  71. </BODY>
  72. </HTML>
  73. <%
  74. function MessageList()
  75.   dim idCount
  76.   dim pages
  77.       pages=20
  78.   dim pagec
  79.   dim page
  80.       page=clng(request("Page"))
  81.   dim pagenc
  82.       pagenc=2
  83.   dim pagenmax
  84.   dim pagenmin
  85.   dim datafrom
  86.       datafrom="Wygkcnflash_Message"
  87.   dim datawhere
  88.       if Result="Search" then
  89.      datawhere="where MesName like '%" & Keyword &_
  90.            "%' "
  91.   else
  92.     if SortPath<>"" then
  93.   datawhere="where Instr(SortPath,'"&SortPath&"')>0 "
  94.         else
  95.   datawhere=""
  96. end if
  97.   end if
  98.   dim sqlid
  99.   dim Myself,PATH_INFO,QUERY_STRING
  100.       PATH_INFO = request.servervariables("PATH_INFO")
  101.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  102.       if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  103.     Myself = PATH_INFO & "?"
  104.   else
  105.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  106.   end if
  107.   dim taxis
  108.       taxis="order by id desc"
  109.   dim i
  110.   dim rs,sql
  111.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  112.   set rs=server.createobject("adodb.recordset")
  113.   rs.open sql,conn,0,1
  114.   idCount=rs("idCount")
  115.   if(idcount>0) then
  116.     if(idcount mod pages=0)then
  117.   pagec=int(idcount/pages)
  118.     else
  119.       pagec=int(idcount/pages)+1
  120.     end if
  121.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  122.     set rs=server.createobject("adodb.recordset")
  123.     rs.open sql,conn,1,1
  124.     rs.pagesize = pages
  125.     if page < 1 then page = 1
  126.     if page > pagec then page = pagec
  127.     if pagec > 0 then rs.absolutepage = page  
  128.     for i=1 to rs.pagesize
  129.   if rs.eof then exit for  
  130.   if(i=1)then
  131.     sqlid=rs("id")
  132.   else
  133.     sqlid=sqlid &","&rs("id")
  134.   end if
  135.   rs.movenext
  136.     next
  137.   end if
  138.   if(idcount>0 and sqlid<>"") then
  139.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  140.     set rs=server.createobject("adodb.recordset")
  141.     rs.open sql,conn,0,1
  142.     while(not rs.eof)
  143.   Response.Write "<tr>" & vbCrLf
  144.       Response.Write "<td nowrap class=""forumRow"">"&rs("ID")&"</td>" & vbCrLf
  145.       if rs("ViewFlagCH") then
  146.         Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downCH"" title=""点击更改显示状态""><font color='green'>√</font></a></td>" & vbCrLf
  147.       else
  148.         Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upCH"" title=""点击更改显示状态""><font color='red'>×</font></a></td>" & vbCrLf
  149.   end If
  150.         if rs("ViewFlagEN") then
  151.         Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downEN"" title=""点击更改显示状态""><font color='green'>√</font></a></td>" & vbCrLf
  152.       else
  153.         Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upEN"" title=""点击更改显示状态""><font color='red'>×</font></a></td>" & vbCrLf
  154.   end If
  155.   Response.Write "<td nowrap class=""forumRow"">"&Guest(rs("MemID"),rs("Linkman"))&"</td>" & vbCrLf
  156.   if StrLen((rs("MesName")))>41 then
  157.         Response.Write "<td title="&rs("MesName")&" nowrap class=""forumRow"">"&StrLeft(rs("MesName"),39)&"</td>" & vbCrLf
  158.       else
  159.         Response.Write "<td title="&rs("MesName")&" nowrap class=""forumRow"">"&rs("MesName")&"</td>" & vbCrLf
  160.       end if 
  161.       if rs("SecretFlag") then
  162.         Response.Write "<td nowrap class=""forumRow""><font color='red'>悄悄话</font></td>" & vbCrLf
  163.       else
  164.         Response.Write "<td nowrap class=""forumRow"">普通</td>" & vbCrLf
  165.   end if   
  166.       Response.Write "<td nowrap class=""forumRow"">"&rs("AddTime")&"</td>" & vbCrLf
  167.       If rs("ReplyTime") <> "" Then
  168.       ReplyTime = rs("ReplyTime")
  169.   Else
  170.   ReplyTime = "<font color=""#CC0000"">暂无回复</font>"
  171.   End If
  172.       Response.Write "<td nowrap class=""forumRow"">"&ReplyTime&"</td>" & vbCrLf
  173.       Response.Write "<td nowrap align=""center"" class=""forumRow""><a href='MessageEdit.asp?Result=Modify&ID="&rs("ID")&"'>审核、回复</a></td>" & vbCrLf
  174.     Response.Write "<td nowrap align='center' class=""forumRow""><input name='selectID' type='checkbox' value='"&rs("ID")&"'></td>" & vbCrLf
  175.       Response.Write "</tr>" & vbCrLf
  176.   rs.movenext
  177.     wend
  178.     Response.Write "<tr>" & vbCrLf
  179.     Response.Write "<td colspan='10' nowrap align=""right"" class=""forumRow""><input type=""submit"" name=""batch"" value=""批量显示"" onClick=""return test();""> <input type=""submit"" name=""batch"" value=""批量不显示"" onClick=""return test();"">  <input name='batch' type='submit' value='删除所选' onClick=""return test();""></td>" & vbCrLf
  180.     Response.Write "</tr>" & vbCrLf
  181.   else
  182.     response.write "<tr><td nowrap align='center' colspan='10' class=""forumRow"">暂无留言信息</td></tr>"
  183.   end if
  184.   Response.Write "<tr>" & vbCrLf
  185.   Response.Write "<td colspan='10' nowrap class=""forumRow"">" & vbCrLf
  186.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  187.   Response.Write "<tr>" & vbCrLf
  188.   Response.Write "<td class=""forumRow"">共计:<font color='red'>"&idcount&"</font>条记录 页次:<font color='red'>"&page&"</font></strong>/"&pagec&" 每页:<font color='red'>"&pages&"</font>条</td>" & vbCrLf
  189.   Response.Write "<td align='right'>" & vbCrLf
  190.   pagenmin=page-pagenc
  191.   pagenmax=page+pagenc
  192.   if(pagenmin<1) then pagenmin=1
  193.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='font-size: 14px; font-family: Webdings'>9</font></a> ")
  194.   if(pagenmin>1) then response.write ("<a href='"& myself &"Page="& page-(pagenc*2+1) &"'><font style='font-size: 14px; font-family: Webdings'>7</font></a> ")
  195.   if(pagenmax>pagec) then pagenmax=pagec
  196.   for i = pagenmin to pagenmax
  197. if(i=page) then
  198.   response.write (" <font color='red'>"& i &"</font> ")
  199. else
  200.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  201. end if
  202.   next
  203.   if(pagenmax<pagec) then response.write (" <a href='"& myself &"Page="& page+(pagenc*2+1) &"'><font style='font-size: 14px; font-family: Webdings'>8</font></a> ")
  204.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='font-size: 14px; font-family: Webdings'>:</font></a> ")
  205.   Response.Write "第<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/D/.test(this.value)){alert('请输入需要跳转到的页数并且必须为整数!');this.value='"&Page&"';}"" style='width: 28px;' type='text' value='"&Page&"'>页" & vbCrLf
  206.   Response.Write "<input name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
  207.   Response.Write "</td>" & vbCrLf
  208.   Response.Write "</tr>" & vbCrLf
  209.   Response.Write "</table>" & vbCrLf
  210.   rs.close
  211.   set rs=nothing
  212.   Response.Write "</td>" & vbCrLf
  213.   Response.Write "</tr>" & vbCrLf
  214. end Function
  215. function Guest(ID,Linkman)
  216.   Dim rs,sql
  217.   Set rs=server.CreateObject("adodb.recordset")
  218.   sql="Select * From Wygkcnflash_Members where ID="&ID
  219.   rs.open sql,conn,1,1
  220.   if rs.bof and rs.eof then
  221.     Guest=Linkman
  222.   else
  223.     Guest="<font color='green'>会员:</font><a href='MemEdit.asp?Result=Modify&ID="&ID&"'>"&Linkman&"</a>"
  224.   end if
  225.   rs.close
  226.   set rs=nothing
  227. end function
  228. %>