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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/ns_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <%
  7. response.buffer=true
  8. Response.CacheControl = "no-cache"
  9. Dim Conn,User_Conn
  10. MF_Default_Conn
  11. 'session判断
  12. MF_Session_TF 
  13. if not MF_Check_Pop_TF("WS002") then Err_Show
  14. %>
  15. <html>
  16. <HEAD>
  17. <TITLE>FoosunCMS留言系统</TITLE>
  18. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  19. </HEAD>
  20. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  21. <script language="javascript">
  22. function goback(){
  23. history.go(-1);
  24. }
  25. </script>
  26. <body>
  27. <%
  28. Dim ID,ShowRs,SaveRs,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,strShowErr
  29. Set ShowRs=Server.CreateObject(G_FS_RS)
  30. Set SaveRs=Server.CreateObject(G_FS_RS)
  31. if Request.QueryString("Act")="NoteEdit" then
  32. ID=Request.QueryString("ID")
  33. if ID="" then
  34. strShowErr = "<li>参数出错!</li>"
  35. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  36. Response.end
  37. end if
  38. ShowRs.open "Select ID,ClassID,User,Topic,Body,AddDate,IsTop,State,IsAdmin,Face,LastUpdateDate,LastUpdateUser From FS_WS_BBS Where ID="&ID&"",Conn,1,1
  39. if ShowRs.eof and ShowRs.bof then
  40. strShowErr = "<li>你要修改的帖子已不存在了!</li>"
  41. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  42. Response.end
  43. else
  44. %>
  45. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  46.   <tr class="hback">
  47.     <td align="left" colspan="2" class="xingmu">留言板&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  48.   </tr>
  49.   <tr>
  50.     <td colspan="2" class="hback"><a href="#" onClick="goback()">返回</a></td>
  51.   </tr>
  52. </table>
  53. <form id="WriteNote" name="WriteNote" action="?Act=Save" method="post">
  54. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  55. <tr class="hback">
  56. <td class="hback" align="right" width="20%">贴子标题</td>
  57. <td class="hback" ><input type="test" name="Topic" size="20" maxlength="50" value="<%=ShowRs("Topic")%>">&nbsp;&nbsp;
  58. <%
  59. if ShowRs("IsAdmin")="0" then
  60. Response.write("<input type=""checkbox"" id=""IsAdmin"" name=""IsAdmin"" value=""1"">")
  61. else
  62. Response.write("<input type=""checkbox"" id=""IsAdmin"" name=""IsAdmin"" value=""1"" checked>")
  63. end if
  64. %>公管理员可见</td>
  65. </tr>
  66. <tr class="hback">
  67. <td class="hback" align="right" width="20%">贴子类型</td>
  68.   <td class="hback" align="left">
  69. <%
  70. if ShowRs("IsTop")=0 then 
  71. response.write("<input type=""radio"" name=""Style"" value=""1"">推荐帖子<input type=""radio"" name=""Style"" value=""0"" checked>普通帖子")
  72. else
  73. response.write("<input type=""radio"" name=""Style"" value=""1"" checked>推荐帖子<input type=""radio"" name=""Style"" value=""0"">普通帖子")
  74. end if
  75. %>
  76. </td>
  77. </tr>
  78. <tr class="hback">
  79. <td class="hback" align="right" width="20%">当前表情</td>
  80. <td class="hback" align="left">
  81.   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  82.             <tr>
  83.               <td>
  84.                 <input name="FaceNum" type="radio" value="1" <%If ShowRs("Face")=1 then response.Write("Checked")%>>
  85.                 <img src="Images/face1.gif" width="22" height="22"> </td>
  86.               <td>
  87.                 <input type="radio" name="FaceNum" value="2" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  88.                 <img src="Images/face2.gif" width="22" height="22"> </td>
  89.               <td>
  90.                 <input type="radio" name="FaceNum" value="3" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
  91.                 <img src="Images/face3.gif" width="22" height="22"> </td>
  92.               <td>
  93.                 <input type="radio" name="FaceNum" value="4" <%If ShowRs("Face")=4 then response.Write("Checked")%>>
  94.                 <img src="Images/face4.gif" width="22" height="22"> </td>
  95.               <td>
  96.                 <input type="radio" name="FaceNum" value="5" <%If ShowRs("Face")=5 then response.Write("Checked")%>>
  97.                 <img src="Images/face5.gif" width="22" height="22"> </td>
  98.               <td>
  99.                 <input type="radio" name="FaceNum" value="6" <%If ShowRs("Face")=6 then response.Write("Checked")%>>
  100.                 <img src="Images/face6.gif" width="22" height="22"></td>
  101.               <td>
  102.                 <input type="radio" name="FaceNum" value="7" <%If ShowRs("Face")=7 then response.Write("Checked")%>>
  103.                 <img src="Images/face7.gif" width="22" height="22"> </td>
  104.               <td>
  105.                 <input type="radio" name="FaceNum" value="8" <%If ShowRs("Face")=8 then response.Write("Checked")%>>
  106.                 <img src="Images/face8.gif" width="22" height="22"> </td>
  107.               <td>
  108.                 <input type="radio" name="FaceNum" value="9" <%If ShowRs("Face")=9 then response.Write("Checked")%>>
  109.                 <img src="Images/face9.gif" width="22" height="22"></td>
  110.             </tr>
  111.             <tr>
  112.               <td>
  113.                 <input type="radio" name="FaceNum" value="10" <%If ShowRs("Face")=10 then response.Write("Checked")%>>
  114.                 <img src="Images/face10.gif" width="22" height="22"></td>
  115.               <td>
  116.                 <input type="radio" name="FaceNum" value="11" <%If ShowRs("Face")=11 then response.Write("Checked")%>>
  117.                 <img src="Images/face11.gif" width="22" height="22"> </td>
  118.               <td>
  119.                 <input type="radio" name="FaceNum" value="12" <%If ShowRs("Face")=12 then response.Write("Checked")%>>
  120.                 <img src="Images/face12.gif" width="22" height="22"></td>
  121.               <td>
  122.                 <input type="radio" name="FaceNum" value="13" <%If ShowRs("Face")=13 then response.Write("Checked")%>>
  123.                 <img src="Images/face13.gif" width="22" height="22"> </td>
  124.               <td>
  125.                 <input type="radio" name="FaceNum" value="14" <%If ShowRs("Face")=14 then response.Write("Checked")%>>
  126.                 <img src="Images/face14.gif" width="22" height="22"></td>
  127.               <td>
  128.                 <input type="radio" name="FaceNum" value="15" <%If ShowRs("Face")=15 then response.Write("Checked")%>>
  129.                 <img src="Images/face15.gif" width="22" height="22"></td>
  130.               <td>
  131.                 <input type="radio" name="FaceNum" value="16" <%If ShowRs("Face")=16 then response.Write("Checked")%>>
  132.                 <img src="Images/face16.gif" width="22" height="22"></td>
  133.               <td>
  134.                 <input type="radio" name="FaceNum" value="17" <%If ShowRs("Face")=17 then response.Write("Checked")%>>
  135.                 <img src="Images/face17.gif" width="22" height="22"> </td>
  136.               <td>
  137.                 <input type="radio" name="FaceNum" value="18" <%If ShowRs("Face")=18 then response.Write("Checked")%>>
  138.                 <img src="Images/face18.gif" width="22" height="22"> </td>
  139.             </tr>
  140.           </table>
  141. </td>
  142. </tr>
  143. <tr class="hback">
  144. <td class="hback" align="right">帖子内容</td>
  145.         <td class="hback" valign="top" >
  146. <textarea name="Content" id="Content" rows="8" cols="25"><%=ShowRs("Body")%></textarea>
  147. </tr>
  148. <tr class="hback">
  149. <td class="hback">&nbsp;<input type="hidden" name="NoteID" ID="NoteID" value="<%=ShowRs("ID")%>"></td>
  150.   <td class="hback"><input type="submit" name="submit" value="OK保存贴子">&nbsp;&nbsp;
  151.     <input type="reset" name="reset" value=" 清  空 ">
  152. </table>
  153. </form>
  154. <%
  155. end if
  156. end if
  157. set ShowRs=nothing
  158. if NoSqlHack(Request.QueryString("Act"))="Save" then
  159. ID=Request.Form("NoteID")
  160. Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
  161. IsTop=NoHtmlHackInput(trim(Request.form("Style")))
  162. Content=NoHtmlHackInput(Trim(Request.form("Content")))
  163. IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
  164. if IsAdmin="" then
  165. IsAdmin="0"
  166. end if
  167. if ID="" then
  168. strShowErr = "<li>参数出错!</li>"
  169. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  170. Response.end
  171. end if
  172. if Topic="" then
  173. strShowErr = "<li>标题不能为空!</li>"
  174. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  175. Response.end
  176. end if
  177. if isTop="" then
  178. strShowErr = "<li>帖子类型值没传过来!</li>"
  179. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  180. Response.end
  181. end if
  182. if Content="" then
  183. strShowErr = "<li>内容不能为空!</li>"
  184. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  185. Response.end
  186. end if
  187. SaveRs.open "Select ID,ClassID,User,Topic,Body,AddDate,IsTop,State,Face,IsAdmin,LastUpdateDate,LastUpdateUser From FS_WS_BBS Where ID="&ID&"",Conn,1,3
  188. if not SaveRs.eof then
  189. SaveRs("Topic")=Topic
  190. SaveRs("Body")=Content
  191. SaveRs("IsTop")=IsTop
  192. SaveRs("IsAdmin")=IsAdmin
  193. SaveRs("Face")=Request.Form("FaceNum")
  194. SaveRs("LastUpdateUser")=session("Admin_Name")
  195. SaveRs("LastUpdateDate")=now()
  196. SaveRs.update
  197. Set SaveRs=nothing
  198. Response.write("<script>history.go(-2);</script>")
  199. Response.end
  200. else
  201. Set SaveRs=nothing
  202. strShowErr = "<li>参数出错!</li>"
  203. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  204. Response.end
  205. end if
  206. end if
  207. Set Conn=nothing
  208. %>
  209. </body>
  210. </html>