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

数据库编程

开发平台:

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. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. dim ShowChar,strAction,ShowChar_1
  14. if NoSqlHack(Request.QueryString("type"))="rebox" then
  15.   ShowChar = "收件箱"
  16. ShowChar_1 = "发件人"
  17.   strAction = "rebox"
  18. Elseif  NoSqlHack(Request.QueryString("type"))="drabox" then
  19.   ShowChar = "草稿箱"
  20. ShowChar_1 = "收件人"
  21.   strAction = "drabox"
  22. Elseif  NoSqlHack(Request.QueryString("type"))="sendbox" then
  23.   ShowChar = "发件箱"
  24. ShowChar_1 = "收件人"
  25.   strAction = "sendbox"
  26. End if
  27. If Request.Form("Action") = "Del" then
  28. Dim DelID,Str_Tmp,Str_Tmp1
  29. DelID = request.Form("MessageID")
  30. if DelID = "" then 
  31. strShowErr = "<li>你必须选择一项再删除</li>"
  32. Call ReturnError(strShowErr,"")
  33. End if
  34. if Trim(Request.Form("strAction")) = "drabox" then
  35. User_Conn.execute("Delete From FS_ME_Message where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'")
  36. Elseif  Trim(Request.Form("strAction")) = "sendbox"  then
  37. Dim RsTFSQL,RsTFObj
  38. Set RsTFObj = Server.CreateObject(G_FS_RS)
  39. RsTFSQL = "Select isDelF  From FS_ME_Message  where  MessageId in ("&DelID&") "
  40. RsTFObj.Open RsTFSQL,User_Conn,1,3
  41. if RsTFObj("isDelF") = 1 then
  42. User_Conn.execute("Delete From FS_ME_Message where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'")
  43. Else
  44. User_Conn.execute("Update FS_ME_Message set isDelR = 1  where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'") End if
  45. Elseif   Trim(Request.Form("strAction")) = "rebox"   then
  46. Dim RsTFSQL1,RsTFObj1
  47. Set RsTFObj1 = Server.CreateObject(G_FS_RS)
  48. RsTFSQL1 = "Select isDelF  From FS_ME_Message  where  MessageId in ("&DelID&") "
  49. RsTFObj1.Open RsTFSQL1,User_Conn,1,3
  50. if RsTFObj1("isDelF") = 1 then
  51. User_Conn.execute("Delete From FS_ME_Message where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'")
  52. Else
  53. User_Conn.execute("Update FS_ME_Message set isDelR = 1  where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'") End if
  54. Else
  55. strShowErr = "<li>错误的参数</li>"
  56. Call ReturnError(strShowErr,"")
  57. 'User_Conn.execute("Update FS_ME_Message set isDelR = 1  where MessageId in ("&DelID&") and M_ReadUserNumber ='"& Fs_User.UserNumber&"'")
  58. End if
  59. strShowErr = "<li>删除短信成功</li>"
  60. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  61. Response.end
  62. End if
  63. %>
  64. <html xmlns="http://www.w3.org/1999/xhtml">
  65. <title>短信---<% = ShowChar%>---网站内容管理系统</title>
  66. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  67. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  68. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  69. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  70. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  71. <head>
  72. <body>
  73. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  74.   <tr>
  75.     <td>
  76.       <!--#include file="top.asp" -->
  77.     </td>
  78.   </tr>
  79. </table>
  80. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  81.   
  82.     <tr class="back"> 
  83.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  84.     </tr>
  85.     <tr class="back"> 
  86.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  87.           <!--#include file="menu.asp" -->
  88.         </div></td>
  89.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  90.           <tr class="hback"> 
  91.             
  92.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  93.             <a href="main.asp">会员首页</a> &gt;&gt; 短信-<% = ShowChar %></td>
  94.           </tr>
  95.         </table>
  96.         
  97.       <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  98.         <form name="form1" method="post" action="">
  99.           <tr class="hback"> 
  100.             <td colspan="12" class="hback">
  101. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  102.                 <tr class="hback"> 
  103.                   <td width="27%" class="hback">  
  104.                     <%
  105. Dim RsMessageObj,RsMessageSQL
  106. Dim strpage,strSQLs
  107. strpage=request("page")
  108. if len(strpage)=0 Or strpage<1 or trim(strpage)=""  Then strpage="1"
  109. Set RsMessageObj = Server.CreateObject(G_FS_RS)
  110. if NoSqlHack(Request.QueryString("type"))="rebox" then
  111. RsMessageSQL = "Select MessageID,M_Title,M_FromUserNumber,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,isRecyle,isDelF,isDelR,LenContent,isSend,isDraft From FS_ME_Message  where M_ReadUserNumber='"&Fs_User.UserNumber&"'  and isRecyle=0 and isDelR=0 and isDraft=0 Order by MessageID desc"
  112. Elseif  NoSqlHack(Request.QueryString("type"))="drabox" then
  113. RsMessageSQL = "Select MessageID,M_Title,M_FromUserNumber,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,isRecyle,isDelF,isDelR,LenContent,isSend,isDraft From FS_ME_Message  where M_FromUserNumber='"&Fs_User.UserNumber&"'  and isRecyle=0 and isDelR=0 and isDraft=1 Order by MessageID desc"
  114. Elseif  NoSqlHack(Request.QueryString("type"))="sendbox" then
  115. RsMessageSQL = "Select MessageID,M_Title,M_FromUserNumber,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,isRecyle,isDelF,isDelR,LenContent,isSend,isDraft From FS_ME_Message  where M_FromUserNumber='"&Fs_User.UserNumber&"'  and isRecyle=0 and isDelR=0 and isDraft=0 and issend=1 Order by MessageID desc"
  116. Else
  117. RsMessageSQL = "Select MessageID,M_Title,M_FromUserNumber,M_ReadUserNumber,M_Content,M_FromDate,M_ReadTF,isRecyle,isDelF,isDelR,LenContent,isSend,isDraft From FS_ME_Message  where M_ReadUserNumber='"&Fs_User.UserNumber&"'  and isRecyle=0 and isDelR=0 and isDraft=0 Order by MessageID desc"
  118. End if
  119. RsMessageObj.Open RsMessageSQL,User_Conn,1,3
  120. %>
  121.                     <a href="Message_box.asp?type=rebox"><img src="images/Skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>//recievebox.gif" width="40" height="40" border="0"></a><a href="Message_box.asp?type=sendbox"><img src="images/Skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>//sendbox.gif" width="40" height="40" border="0"></a><a href="Message_box.asp?type=drabox"><img src="images/Skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>//draftbox.gif" width="40" height="40" border="0"></a><a href="Message_write.asp"><img src="images/Skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>//writemessage.gif" width="40" height="40" border="0"></a></td>
  122.                   <td width="14%" class="hback"><div align="left">空间占用:
  123.                       <%
  124.      Dim UnTotle,FS_Message_1
  125.  Set FS_Message_1 = new Cls_Message
  126. UnTotle=FS_Message_1.LenContent(Fs_User.UserNumber)/(1024*100)*100
  127. Set FS_Message_1 = Nothing 
  128. If IsNull(UnTotle) then UnTotle=0
  129. Response.Write Formatnumber(UnTotle,2,-1)&"%"
  130. %>
  131.                     </div></td>
  132.                   <td width="59%" class="hback"> 
  133.                     <table width="100%" height="17" border="0" cellpadding="0" cellspacing="1" class="table">
  134.                       <tr> 
  135.                         <td class="hback_1"><img src="images/space_pic_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.gif" width="<% = Formatnumber((UnTotle),2,-1)%>%" height="17"></td>
  136.                       </tr>
  137.                     </table> </td>
  138.                 </tr>
  139.               </table></td>
  140.           </tr class="hback">
  141.           <%
  142. Dim select_count,select_pagecount,i
  143. if RsMessageObj.eof then
  144.    RsMessageObj.close
  145.    set RsMessageObj=nothing
  146.    Response.Write"<TR  class=""hback""><TD colspan=""7""  class=""hback"" height=""40"">没有记录。</TD></TR>"
  147. else
  148. RsMessageObj.pagesize = 20
  149. RsMessageObj.absolutepage=cint(strpage)
  150. select_count=RsMessageObj.recordcount
  151. select_pagecount=RsMessageObj.pagecount
  152.   %>
  153.           <tr class="hback"> 
  154.             <td width="5%" height="22" class="xingmu"><div align="left"><strong>已读</strong></div></td>
  155.             <td width="15%" class="xingmu"><strong>
  156. <% = ShowChar_1 %>
  157.               </strong></td>
  158.             <td width="36%" height="22" class="xingmu"><div align="left"><strong>标题</strong></div></td>
  159.             <td width="20%" height="22" class="xingmu"><div align="left"><strong>日期</strong></div></td>
  160.             <td width="11%" height="22" class="xingmu"><strong>长度</strong></td>
  161.             <td width="7%" height="22" class="xingmu"><div align="center">查看</div></td>
  162.             <td width="6%" height="22" class="xingmu"><div align="center"><strong>操作</strong></div></td>
  163.           </tr>
  164.           <%
  165. for i=1 to RsMessageObj.pagesize
  166. if RsMessageObj.eof Then exit For 
  167. Dim Returvaluestr_R,Returvaluestr_F,strbstat,strben,strcss,strReadTF
  168. if RsMessageObj("M_ReadTF") =0 then 
  169. strbstat = "<b>"
  170. strben = "</b>"
  171. strcss = "hback"
  172. strReadTF = "<font color=red><b>×</b></font>"
  173. Else
  174. strbstat = ""
  175. strben = ""
  176. strcss = "hback"
  177. strReadTF = "<font color=#999999><b>√</b></font>"
  178. End if
  179. if Request.QueryString("type")="rebox" then
  180. Returvaluestr_R = Fs_User.GetFriendName(RsMessageObj("M_FromUserNumber"))
  181. if Trim(RsMessageObj("M_FromUserNumber")) <> "0" then
  182. Returvaluestr_F = "<a href=ShowUser.asp?UserNumber="& RsMessageObj("M_FromUserNumber") &">"&Fs_User.GetFriendName(RsMessageObj("M_FromUserNumber"))&"</a>"
  183. Else
  184. Returvaluestr_F = "用户不存在"
  185. End if
  186. Else
  187. Returvaluestr_R = Fs_User.GetFriendName(RsMessageObj("M_ReadUserNumber"))
  188. if Trim(RsMessageObj("M_ReadUserNumber")) <> "0" then
  189. Returvaluestr_F = "<a href=ShowUser.asp?UserNumber="& RsMessageObj("M_ReadUserNumber") &">"&Fs_User.GetFriendName(RsMessageObj("M_ReadUserNumber"))&"</a>"
  190. Else
  191. Returvaluestr_F = "用户不存在"
  192. End if
  193. ENd if
  194. %>
  195.           <tr class="hback"> 
  196.             <td class="<% = strcss %>"><div align="center"><% = strReadTF%> </div></td>
  197.             <td class="<% = strcss %>">
  198.               <% =   Returvaluestr_F %>
  199.             </td>
  200.             <td class="<% = strcss %>"  id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(mid<% = RsMessageObj("MessageID")%>);"  language=javascript><% = strbstat & RsMessageObj("M_title") & strben %></td>
  201.             <td class="<% = strcss %>"><% =  RsMessageObj("M_FromDate")  %></td>
  202.             <td class="<% = strcss %>"><% =  RsMessageObj("LenContent")  %>
  203.               Byte</td>
  204.             <td class="<% = strcss %>"> 
  205.               <div align="center">
  206.                 <%
  207. if NoSqlHack(Request.QueryString("type"))="rebox" then
  208. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">回复 </a>"
  209. Elseif  NoSqlHack(Request.QueryString("type"))="drabox" then
  210. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">发送 </a>"
  211. Elseif  NoSqlHack(Request.QueryString("type"))="sendbox" then
  212. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">发送 </a>"
  213. End if
  214. %>
  215.               </div></td>
  216.             <td class="<% = strcss %>"><input name="MessageID" type="checkbox" id="MessageID" value="<% = RsMessageObj("MessageID")%>"></td>
  217.           </tr>
  218.           <tr class="hback" id="mid<% = RsMessageObj("MessageID")%>" style="display:none"> 
  219.             <td colspan="12" class="hback"><table width="100%" height="62" border="0" cellpadding="5" cellspacing="1" class="table">
  220.                 <tr> 
  221.                   <td height="60" valign="top" class="hback_1"> <a href="Message_Read.asp?MessageID = <%  = RsMessageObj("MessageID") %>"> 
  222.                     </a> <table width="100%" border="0" cellspacing="0" cellpadding="4">
  223.                       <tr> 
  224.                         <td height="60" valign="top"> 
  225.                           <% = RsMessageObj("M_Content")%>
  226.                         </td>
  227.                       </tr>
  228.                       <tr> 
  229.                         <td><div align="right"> 
  230.                             <%
  231. if NoSqlHack(Request.QueryString("type"))="rebox" then
  232. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">回复该短信 </a>"
  233. Elseif  NoSqlHack(Request.QueryString("type"))="drabox" then
  234. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">发送此短信 </a>"
  235. Elseif  NoSqlHack(Request.QueryString("type"))="sendbox" then
  236. Response.Write "<a href=""Message_Read.asp?MessageID="& RsMessageObj("MessageID") &"&strstat="&strAction&""">发送此短信 </a>"
  237. End if
  238. %>
  239.                           </div></td>
  240.                       </tr>
  241.                     </table></td>
  242.                 </tr>
  243.               </table></td>
  244.           </tr>
  245.           <%
  246.   RsMessageObj.MoveNext
  247.   Next
  248.   %>
  249.           <tr class="hback"> 
  250.             <td colspan="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  251.                 <tr  class="hback"> 
  252.                   <td colspan="2"> <%  Response.Write("每页:"& RsMessageObj.pagesize &"个,")
  253. Response.write"&nbsp;共<b>"& select_pagecount &"</b>页<b>&nbsp;" & select_count &"</b>条记录,本页是第<b>"& strpage &"</b>页。"
  254. if int(strpage)>1 then
  255. Response.Write"&nbsp;<a href=?page=1>第一页</a>&nbsp;&nbsp;"
  256. Response.Write"&nbsp;<a href=?page="&cstr(cint(strpage)-1)&">上一页</a>&nbsp;&nbsp;"
  257. End if
  258. If int(strpage)<select_pagecount then
  259. Response.Write"&nbsp;<a href=?page="&cstr(cint(strpage)+1)&">下一页</a>&nbsp;"
  260. Response.Write"&nbsp;<a href=?page="& select_pagecount &">最后一页</a>&nbsp;&nbsp;"
  261. End if
  262. Response.Write"<br>"
  263. RsMessageObj.close
  264. Set RsMessageObj=nothing
  265. End if
  266. %> <div align="right"> </div></td>
  267.                 </tr>
  268.                 <tr  class="hback"> 
  269.                   <td width="64%"><div align="right">节省每一分空间,请及时删除无用信息 
  270.                       <input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
  271.                       选中所有短信 
  272.                       <input name="Action" type="hidden" id="Action" value="Del">
  273.                       <input name="strAction" type="hidden" id="strAction" value="<% = strAction%>">
  274.                         </div></td>
  275.                   <td width="18%"><input type="submit" name="Submit" value="删除选中的短信" onClick="{if(confirm('确定清除您所选择的记录吗??')){this.document.form1.submit();return true;}return false;}"> 
  276.                   </td>
  277.                 </tr>
  278.               </table></td>
  279.           </tr>
  280.         </form>
  281.       </table>
  282.        </td>
  283.     </tr>
  284.     <tr class="back"> 
  285.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  286.           <!--#include file="Copyright.asp" -->
  287.         </div></td>
  288.     </tr>
  289.  
  290. </table>
  291. </body>
  292. </html>
  293. <%
  294. Set Fs_User = Nothing
  295. %>
  296. <script language="JavaScript" type="text/JavaScript">
  297. function CheckAll(form)  
  298.   {  
  299.   for (var i=0;i<form.elements.length;i++)  
  300.     {  
  301.     var e = form.elements[i];  
  302.     if (e.name != 'chkall')  
  303.        e.checked = form.chkall.checked;  
  304.     }  
  305.   }
  306. </script>
  307. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->