Book.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="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <!--#include file="../FS_Inc/Func_Page.asp" -->
  8. <%
  9. Response.Buffer = True
  10. Response.Expires = -1
  11. Response.ExpiresAbsolute = Now() - 1
  12. Response.Expires = 0
  13. Response.CacheControl = "no-cache"
  14. dim ShowChar,strAction,ShowChar_1,str_m_type
  15. str_m_type = NoSqlHack(Request.QueryString("M_type"))
  16. if isnull(str_m_type) or not isnumeric(str_m_type) or trim(str_m_type)="" then
  17. strShowErr = "<li>错误参数</li>"
  18. Response.Redirect("lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  19. Response.end
  20. end if
  21. ShowChar = "我的留言"
  22. ShowChar_1 = "留言人"
  23. strAction = ""
  24. If Request.Form("Action") = "Del" then
  25. Dim DelID,Str_Tmp,Str_Tmp1
  26. DelID = NoSqlHack(request.Form("BookID"))
  27. if DelID = "" then 
  28. strShowErr = "<li>你必须选择一项再删除</li>"
  29. Call ReturnError(strShowErr,"")
  30. End if
  31. User_Conn.execute("Delete From FS_ME_Book where BookId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'")
  32. strShowErr = "<li>删除留言成功</li>"
  33. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  34. Response.end
  35. End if
  36. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo,strpage,i
  37. Dim tmp_re,tmp_er
  38. int_RPP=20 '设置每页显示数目
  39. int_showNumberLink_=8 '数字导航显示数目
  40. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  41. str_nonLinkColor_="#999999" '非热链接颜色
  42. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  43. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  44. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  45. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  46. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  47. toL_="<font face=webdings title=""最后一页"">:</font>"
  48. strpage=NoSqlHack(request("page"))
  49. if len(strpage)=0 Or strpage<1 or trim(strpage)=""Then:strpage="1":end if
  50. %>
  51. <html xmlns="http://www.w3.org/1999/xhtml">
  52. <title>留言---<% = ShowChar%>---网站内容管理系统</title>
  53. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  54. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  55. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  56. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  57. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  58. <head>
  59. <body>
  60. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  61.   <tr>
  62.     <td>
  63.       <!--#include file="top.asp" -->
  64.     </td>
  65.   </tr>
  66. </table>
  67. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  68.   
  69.     <tr class="back"> 
  70.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  71.     </tr>
  72.     <tr class="back"> 
  73.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  74.           <!--#include file="menu.asp" -->
  75.         </div></td>
  76.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  77.           <tr class="hback"> 
  78.             
  79.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  80.             <a href="main.asp">会员首页</a> &gt;&gt; 留言-<% = ShowChar %>
  81.             &lt;&lt; 
  82.             <%
  83. select case Request.QueryString("M_type")
  84. case "0"
  85. Response.Write("会员留言")
  86. case "1"
  87. Response.Write("新闻留言")
  88. case "2"
  89. Response.Write("供求留言")
  90. case "3"
  91. Response.Write("求职招聘留言")
  92. case "4"
  93. Response.Write("房产留言")
  94. case "5"
  95. Response.Write("其他留言")
  96. end select
  97. %>
  98.             &gt;&gt; </td>
  99.           </tr>
  100.         </table>
  101.         
  102.       <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  103.         <form name="form1" method="post" action="">
  104.           <tr class="hback"> 
  105.             <td colspan="12" class="hback"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  106.                 <tr class="hback"> 
  107.                   <td width="27%" class="hback"> <%
  108. Dim RsBookObj,RsBookSQL
  109. Dim strSQLs
  110. strpage=request("page")
  111. if len(strpage)=0 Or strpage<1 or trim(strpage)=""  Then strpage="1"
  112. Set RsBookObj = Server.CreateObject(G_FS_RS)
  113. RsBookSQL = "Select BookID,M_Title,M_FromUserNumber,M_type,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,LenContent From FS_ME_Book  where M_ReadUserNumber='"&Fs_User.UserNumber&"' and M_Type="& str_m_type &" Order by BookID desc"
  114. RsBookObj.Open RsBookSQL,User_Conn,1,3
  115. %>
  116.                     空间占用: 
  117.                     <%
  118.      Dim UnTotle,FS_Book_1
  119.  Set FS_Book_1 = new Cls_Message
  120. UnTotle=FS_Book_1.LenbContent(Fs_User.UserNumber)/(1024*200)*100
  121. Set FS_Book_1 = Nothing 
  122. If IsNull(UnTotle) then UnTotle=0
  123. Response.Write Formatnumber(UnTotle,2,-1)&"%"
  124. %>
  125.                     (共200K)</div></td>
  126.                   <td width="73%" class="hback"> <table width="100%" height="17" border="0" cellpadding="0" cellspacing="1" class="table">
  127.                       <tr> 
  128.                         <td class="hback_1"><img src="images/space_pic_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.gif" width="<% = Formatnumber((UnTotle),2,-1)%>%" height="17"></td>
  129.                       </tr>
  130.                     </table></td>
  131.                 </tr>
  132.               </table></td>
  133.           </tr class="hback">
  134.           <tr class="hback"> 
  135.             <td width="5%" height="22" class="xingmu"><div align="left"><strong>已读</strong></div></td>
  136.             <td width="15%" class="xingmu"><strong> 
  137.               <% = ShowChar_1 %>
  138.               </strong></td>
  139.             <td width="36%" height="22" class="xingmu"><div align="left"><strong>标题</strong></div></td>
  140.             <td width="20%" height="22" class="xingmu"><div align="left"><strong>日期</strong></div></td>
  141.             <td width="11%" height="22" class="xingmu"><strong>长度</strong></td>
  142.             <td width="7%" height="22" class="xingmu"><div align="center">查看</div></td>
  143.             <td width="6%" height="22" class="xingmu"><div align="center"><strong>操作</strong></div></td>
  144.           </tr>
  145.           <%
  146. if RsBookObj.eof then
  147.    RsBookObj.close
  148.    set RsBookObj=nothing
  149.    Response.Write"<tr  class=""hback""><td colspan=""7""  class=""hback"" height=""40"">没有留言。</td></tr>"
  150. else
  151. RsBookObj.PageSize=int_RPP
  152. cPageNo=NoSqlHack(Request.QueryString("Page"))
  153. If cPageNo="" Then cPageNo = 1
  154. If not isnumeric(cPageNo) Then cPageNo = 1
  155. cPageNo = Clng(cPageNo)
  156. If cPageNo<=0 Then cPageNo=1
  157. If cPageNo>RsBookObj.PageCount Then cPageNo=RsBookObj.PageCount 
  158. RsBookObj.AbsolutePage=cPageNo
  159. for i=1 to RsBookObj.pagesize
  160.   if RsBookObj.eof Then exit For 
  161. Dim Returvaluestr_R,Returvaluestr_F,strbstat,strben,strcss,strReadTF
  162. if RsBookObj("M_ReadTF") =0 then 
  163. strbstat = "<b>"
  164. strben = "</b>"
  165. strcss = "hback"
  166. strReadTF = "<font color=red><b>×</b></font>"
  167. Else
  168. strbstat = ""
  169. strben = ""
  170. strcss = "hback"
  171. strReadTF = "<font color=#999999><b>√</b></font>"
  172. End if
  173. Returvaluestr_R = Fs_User.GetFriendName(RsBookObj("M_ReadUserNumber"))
  174. if Trim(RsBookObj("M_FromUserNumber")) <> "0" then
  175. Returvaluestr_F = "<a href=ShowUser.asp?UserNumber="& RsBookObj("M_FromUserNumber") &" target=""_blank"">"&Fs_User.GetFriendName(RsBookObj("M_FromUserNumber"))&"</a>"
  176. Else
  177. Returvaluestr_F = "用户不存在"
  178. End if
  179. %>
  180.           <tr class="hback"> 
  181.             <td height="31" class="<% = strcss %>"> 
  182.               <div align="center">
  183.                 <% = strReadTF%>
  184.               </div></td>
  185.             <td class="<% = strcss %>"> <% =   Returvaluestr_F %> </td>
  186.             <td class="<% = strcss %>"><a href="Book_Read.asp?BookId=<%=RsBookObj("BookId")%>&M_type=<%=RsBookObj("M_type")%>"><% = strbstat & RsBookObj("M_title") & strben %></a></td>
  187.             <td class="<% = strcss %>"><% =  RsBookObj("M_FromDate")  %></td>
  188.             <td class="<% = strcss %>"><% =  RsBookObj("LenContent")  %>
  189.               Byte</td>
  190.             <td class="<% = strcss %>"> <div align="center"> 
  191.                 <%
  192. Response.Write "<a href=""Book_Read.asp?BookID="& RsBookObj("BookID") &"&M_Type="&RsBookObj("M_type")&""">回复 </a>"
  193. %>
  194.               </div></td>
  195.             <td class="<% = strcss %>"><input name="BookID" type="checkbox" id="BookID" value="<% = RsBookObj("BookID")%>"></td>
  196.           </tr>
  197.           <%
  198.   RsBookObj.MoveNext
  199.   Next
  200.   %>
  201.           <tr class="hback"> 
  202.             <td colspan="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  203.                 <tr  class="hback"> 
  204.                   <td colspan="2"> <%
  205. response.Write "<p>"&  fPageCount(RsBookObj,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
  206. %> <div align="right"> </div></td>
  207.                 </tr>
  208.                 <tr  class="hback"> 
  209.                   <td width="64%"><div align="right">节省每一分空间,请及时删除无用信息 
  210.                       <input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
  211.                       选中所有留言 
  212.                       <input name="Action" type="hidden" id="Action" value="Del">
  213.                       <input name="strAction" type="hidden" id="strAction" value="<% = strAction%>">
  214.                         </div></td>
  215.                   <td width="18%"><input type="submit" name="Submit" value="删除选中的留言" onClick="{if(confirm('确定清除您所选择的记录吗??')){this.document.form1.submit();return true;}return false;}"> 
  216.                   </td>
  217.                 </tr>
  218.               </table></td>
  219.           </tr>
  220.           <%end if%>
  221.         </form>
  222.       </table>
  223.        </td>
  224.     </tr>
  225.     <tr class="back"> 
  226.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  227.           <!--#include file="Copyright.asp" -->
  228.         </div></td>
  229.     </tr>
  230.  
  231. </table>
  232. </body>
  233. </html>
  234. <%
  235. Set Fs_User = Nothing
  236. %>
  237. <script language="JavaScript" type="text/JavaScript">
  238. function CheckAll(form)  
  239.   {  
  240.   for (var i=0;i<form.elements.length;i++)  
  241.     {  
  242.     var e = form.elements[i];  
  243.     if (e.name != 'chkall')  
  244.        e.checked = form.chkall.checked;  
  245.     }  
  246.   }
  247. </script>
  248. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->