viewreturn.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:10k
源码类别:

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

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%
  3. dim cls
  4. if session("admin")="" then
  5. Response.Redirect("admin.asp")
  6. else
  7. if session("flag")<>"0" then
  8. cls = Instr(session("flag"), "liuyanfig")
  9. if cls <= 0 then
  10. %>
  11. <script language="javascript">
  12. if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
  13.   location.href="login.asp";
  14. else
  15.   location.href="index.asp";
  16. </script>
  17. <%
  18. end if
  19. end if
  20. end if
  21. %>
  22. <html>
  23. <head>
  24. <title>Untitled Document</title>
  25. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  26. <link href="images/style.css" rel="stylesheet" type="text/css">
  27. </head>
  28. <body>
  29. <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
  30.   <tr> 
  31.     <td class="forumRowHighlight" height="22" bgcolor="f1f1f1"> 
  32.       <div align="center"><font color="#000000">查看信息反馈</font></div>
  33.     </td>
  34.   </tr>
  35.   <tr> 
  36.     <td class="forumRowHighlight" height="169" align="center" valign="top" bgcolor="#FFFFFF"> 
  37.       <%
  38. Function unHtml(content)
  39. ON ERROR RESUME NEXT
  40. unHtml=content
  41. IF content <> "" Then
  42. unHtml=Server.HTMLEncode(unHtml)
  43. unHtml=Replace(unHtml,vbcrlf,"<br>")
  44. unHtml=Replace(unHtml,chr(9),"&nbsp;&nbsp;&nbsp;&nbsp;")
  45. unHtml=Replace(unHtml," ","&nbsp;")
  46. End IF
  47. IF Err.Number <>0 Then
  48. unHtml= "HTML转换中出错请联系管理员<br>"
  49. Err.Clear
  50. End IF
  51. End Function
  52. %>
  53.       <%
  54. set rs=server.createobject("adodb.recordset")
  55. rs.open "select * from guestbook order by id desc",conn,3,2
  56. 'dim page
  57. 'dim e_page
  58. 'e_page=5 '每页显示留言数
  59. 'rs.pagesize=e_page
  60. 'if request.querystring("page")="" or request.querystring("page")=0 then
  61. 'page=1
  62. 'else
  63. 'page=request.querystring("page")
  64. 'rs.absolutepage=trim(request.querystring("page"))
  65. 'end if
  66. %>
  67.       <SCRIPT language=JavaScript>
  68. function is_number(str)
  69. {
  70. exp=/[^0-9()-]/g;
  71. if(str.search(exp) != -1)
  72. {
  73. return false;
  74. }
  75. return true;
  76. }
  77. function CheckInput(){
  78. if(form.name.value==''){
  79. alert("您没有填写昵称!");
  80. form.name.focus();
  81. return false;
  82. }
  83. if(form.name.value.length>20){
  84. alert("昵称不能超过20个字符!");
  85. form.name.focus();
  86. return false;
  87. }
  88. if(!is_number(document.form.qq.value)){
  89. alert("QQ号必须是数字!");
  90. form.qq.focus();
  91. return false;
  92. }
  93. if(form.content.value==''){
  94. alert("您没有填写留言内容!");
  95. form.content.focus();
  96. return false;
  97. }
  98. if(form.content.value.length>255){
  99. alert("留言内容不能超过255个字符!");
  100. form.content.focus();
  101. return false;
  102. }
  103. return true;
  104. }
  105. </SCRIPT>
  106.       <br> 
  107.       <%
  108. if rs.eof and rs.bof then
  109. %>
  110.       <table width="380" border="0" align="center" cellpadding="4" >
  111.         <tr> 
  112.           <td class="forumRowHighlight" height="40" align="center"> <p>还没有任何留言!</p></td>
  113.         </tr>
  114.       </table>
  115.       <%else%>
  116.       <%
  117.    rs.PageSize =5 '每页记录条数
  118. iCount=rs.RecordCount '记录总数
  119. iPageSize=rs.PageSize
  120.      maxpage=rs.PageCount 
  121.      page=request("page")
  122.      per_page=rs.PageSize
  123.     
  124.     if Not IsNumeric(page) or page="" then
  125.         page=1
  126.     else
  127.         page=cint(page)
  128.     end if
  129.     
  130.     if page<1 then
  131.         page=1
  132.     elseif  page>maxpage then
  133.         page=maxpage
  134.     end if
  135.     
  136.     rs.AbsolutePage=Page
  137. if page=maxpage then
  138. x=iCount-(maxpage-1)*iPageSize
  139. else
  140. x=iPageSize
  141. end if
  142. %>
  143.       <table width="100%" border="0">
  144.         <tr> 
  145.           <td class="forumRowHighlight" colspan="12" height="25" align="center" bgcolor="#FFFFFF" > 
  146.             <%
  147. call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
  148.   %>
  149.           </td>
  150.         </tr>
  151.       </table>
  152.       <%
  153. For i=1 To x
  154. 'do while not rs.eof and e_page>0
  155. %>
  156.       <TABLE width=98% border=0 align="center" cellPadding=0 cellSpacing=1 bgcolor="#CCCCCC">
  157.         <TBODY>
  158.           <TR> 
  159.             <td class="forumRowHighlight" bgcolor="f1f1f1"><TABLE width="100%" border=0 cellpadding="0" cellspacing="0">
  160.                 <TBODY>
  161.                   <TR bgcolor="f1f1f1"> 
  162.                     <td class="forumRowHighlight" width="67" height="23" align="center" bgcolor="f1f1f1"><font color="#FF0000">留言ID:<%=rs("id")%></font></TD>
  163.                     <td class="forumRowHighlight" width="464" align="right"> 
  164.                       <%if rs("qq")<>"" then%>
  165.                       <a title=QQ:<%=rs("qq")%>><img src="../images/qq.gif" width="16" height="16" border="0"> 
  166.                       <%=rs("qq")%></a> 
  167.                       <%end if%>
  168.                       &nbsp; 
  169.                       <%if rs("email")<>"" then%>
  170.                       <a href="mailto:<%=rs("email")%>" target="_blank" title=Email:<%=rs("email")%>><img src="../images/email.gif" width="14" height="15" border="0"></a> 
  171.                       <a href="mailto:<%=rs("email")%>" target="_blank" title=Email:<%=rs("email")%>><%=rs("email")%></a> 
  172.                       <%end if%>
  173.                       <%if rs("url")<>"" then%>
  174.                       <a href="<%=rs("url")%>" target="_blank" title=主页:<%=rs("url")%>><img src="../images/url.gif" width="16" height="16" border="0"></a> 
  175.                       <a href="<%=rs("url")%>" target="_blank" title=主页:<%=rs("url")%>><%=rs("url")%></a> 
  176.                       <%end if%>
  177.                       &nbsp;</TD>
  178.                   </TR>
  179.                 </TBODY>
  180.               </TABLE></TD>
  181.           </TR>
  182.           <TR> 
  183.             <td class="forumRowHighlight" ><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  184.                 <TBODY>
  185.                   <TR> 
  186.                     <td class="forumRowHighlight" bgcolor="#FFFFFF"> <TABLE width="100%" border=0 style="table-layout:fixed;word-break:break-all">
  187.                         <TBODY>
  188.                           <TR> 
  189.                             <td class="forumRowHighlight" width="109"><img src="../images/<%=rs("sex")%>.gif"></TD>
  190.                             <td class="forumRowHighlight" colspan="2"> <strong><font color="<%=flzhbt%>">姓名:</font></strong><font color="<%=flzhzt%>"><%=rs("name")%></font><br> 
  191.                               <strong><font color="<%=flzhbt%>">内容:</font></strong><font color="<%=flzhzt%>"><%=unHtml(rs("content"))%></font></TD>
  192.                           </TR>
  193.                           <TR> 
  194.                             <td class="forumRowHighlight" colspan="2">&nbsp; [<a href="reply.asp?id=<%=rs("id")%>">回复</a>] 
  195.                               &nbsp; [<a href="fkdel.asp?id=<%=rs("id")%>">删除</a>] 
  196.                             </TD>
  197.                             <td class="forumRowHighlight" width="250" align="right"><%=rs("time")%></TD>
  198.                           </TR>
  199.                         </TBODY>
  200.                       </TABLE></TD>
  201.                   </TR>
  202.                 </TBODY>
  203.               </TABLE></TD>
  204.           </TR>
  205.           <%if rs("reply")<>"" then%>
  206.           <TR> 
  207.             <td class="forumRowHighlight" bgColor=#f2f2f2> <table width="100%" border="0" style="table-layout:fixed;word-break:break-all">
  208.                 <tr> 
  209.                   <td class="forumRowHighlight" width="10">&nbsp;</td>
  210.                   <td class="forumRowHighlight" width="567"><font color="#FF0000">管理员回复:</font><br> <%=unHtml(rs("reply"))%></td>
  211.                 </tr>
  212.               </table></TD>
  213.           </TR>
  214.           <%end if%>
  215.         </TBODY>
  216.       </TABLE>
  217.       <br> 
  218.       <%
  219. 'e_page=e_page-1
  220. 'rs.movenext
  221. 'loop
  222. RS.MoveNext
  223. next
  224. %>
  225.       <table width="100%" border="0">
  226.         <tr> 
  227.           <td class="forumRowHighlight" > 
  228.             <%
  229. call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
  230.   %>
  231.           </td>
  232.         </tr>
  233.       </table>
  234.       <%
  235. rs.close
  236. set rs=nothing
  237. end if
  238. %>
  239.     </td>
  240.   </tr>
  241. </table>
  242. <!--#include file="foot.asp"-->
  243. </body>
  244. </html><%
  245. Sub PageControl(iCount,pagecount,page,table_style,font_style,per_page)
  246. '生成上一页下一页链接
  247.     Dim query, a, x, temp
  248.     action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
  249.     temp=""
  250.     Response.Write("<table " & Table_style & ">" & vbCrLf )        
  251.     Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
  252.     Response.Write("<td  align=right>" & vbCrLf )
  253.     Response.Write(font_style & vbCrLf )    
  254.         
  255.     if page<=1 then
  256.         Response.Write ("首页 " & vbCrLf)        
  257.         Response.Write ("上页 " & vbCrLf)
  258.     else        
  259.         Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
  260.         Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
  261.     end if
  262.     if page>=pagecount then
  263.         Response.Write ("下页 " & vbCrLf)
  264.         Response.Write ("尾页 " & vbCrLf)            
  265.     else
  266.         Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
  267.         Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
  268.     end if
  269.     Response.Write(" 页次:" & page & "/" & pageCount & "页" &  vbCrLf)
  270.     Response.Write(" 共有" & iCount & "条/每页"&per_page&"条" &  vbCrLf)
  271.     Response.Write(" 转到" & "<INPUT TYEP=TEXT NAME=page SIZE=4 Maxlength=8 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
  272.     Response.Write("</TD>" & vbCrLf )                
  273.     Response.Write("</TR></form>" & vbCrLf )        
  274.     Response.Write("</table>" & vbCrLf )        
  275. End Sub
  276. %>