NoteEdit.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:9k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <% Option Explicit %>
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <!--#include file="../../FS_InterFace/ns_Function.asp" -->
- <!--#include file="../../FS_Inc/Function.asp" -->
- <%
- response.buffer=true
- Response.CacheControl = "no-cache"
- Dim Conn,User_Conn
- MF_Default_Conn
- 'session判断
- MF_Session_TF
- if not MF_Check_Pop_TF("WS002") then Err_Show
- %>
- <html>
- <HEAD>
- <TITLE>FoosunCMS留言系统</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
- </HEAD>
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <script language="javascript">
- function goback(){
- history.go(-1);
- }
- </script>
- <body>
- <%
- Dim ID,ShowRs,SaveRs,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,strShowErr
- Set ShowRs=Server.CreateObject(G_FS_RS)
- Set SaveRs=Server.CreateObject(G_FS_RS)
- if Request.QueryString("Act")="NoteEdit" then
- ID=Request.QueryString("ID")
- if ID="" then
- strShowErr = "<li>参数出错!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- 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
- if ShowRs.eof and ShowRs.bof then
- strShowErr = "<li>你要修改的帖子已不存在了!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- else
- %>
- <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
- <tr class="hback">
- <td align="left" colspan="2" class="xingmu">留言板 <a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
- </tr>
- <tr>
- <td colspan="2" class="hback"><a href="#" onClick="goback()">返回</a></td>
- </tr>
- </table>
- <form id="WriteNote" name="WriteNote" action="?Act=Save" method="post">
- <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
- <tr class="hback">
- <td class="hback" align="right" width="20%">贴子标题</td>
- <td class="hback" ><input type="test" name="Topic" size="20" maxlength="50" value="<%=ShowRs("Topic")%>">
- <%
- if ShowRs("IsAdmin")="0" then
- Response.write("<input type=""checkbox"" id=""IsAdmin"" name=""IsAdmin"" value=""1"">")
- else
- Response.write("<input type=""checkbox"" id=""IsAdmin"" name=""IsAdmin"" value=""1"" checked>")
- end if
- %>公管理员可见</td>
- </tr>
- <tr class="hback">
- <td class="hback" align="right" width="20%">贴子类型</td>
- <td class="hback" align="left">
- <%
- if ShowRs("IsTop")=0 then
- response.write("<input type=""radio"" name=""Style"" value=""1"">推荐帖子<input type=""radio"" name=""Style"" value=""0"" checked>普通帖子")
- else
- response.write("<input type=""radio"" name=""Style"" value=""1"" checked>推荐帖子<input type=""radio"" name=""Style"" value=""0"">普通帖子")
- end if
- %>
- </td>
- </tr>
- <tr class="hback">
- <td class="hback" align="right" width="20%">当前表情</td>
- <td class="hback" align="left">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <input name="FaceNum" type="radio" value="1" <%If ShowRs("Face")=1 then response.Write("Checked")%>>
- <img src="Images/face1.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="2" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
- <img src="Images/face2.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="3" <%If ShowRs("Face")=2 then response.Write("Checked")%>>
- <img src="Images/face3.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="4" <%If ShowRs("Face")=4 then response.Write("Checked")%>>
- <img src="Images/face4.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="5" <%If ShowRs("Face")=5 then response.Write("Checked")%>>
- <img src="Images/face5.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="6" <%If ShowRs("Face")=6 then response.Write("Checked")%>>
- <img src="Images/face6.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="7" <%If ShowRs("Face")=7 then response.Write("Checked")%>>
- <img src="Images/face7.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="8" <%If ShowRs("Face")=8 then response.Write("Checked")%>>
- <img src="Images/face8.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="9" <%If ShowRs("Face")=9 then response.Write("Checked")%>>
- <img src="Images/face9.gif" width="22" height="22"></td>
- </tr>
- <tr>
- <td>
- <input type="radio" name="FaceNum" value="10" <%If ShowRs("Face")=10 then response.Write("Checked")%>>
- <img src="Images/face10.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="11" <%If ShowRs("Face")=11 then response.Write("Checked")%>>
- <img src="Images/face11.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="12" <%If ShowRs("Face")=12 then response.Write("Checked")%>>
- <img src="Images/face12.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="13" <%If ShowRs("Face")=13 then response.Write("Checked")%>>
- <img src="Images/face13.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="14" <%If ShowRs("Face")=14 then response.Write("Checked")%>>
- <img src="Images/face14.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="15" <%If ShowRs("Face")=15 then response.Write("Checked")%>>
- <img src="Images/face15.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="16" <%If ShowRs("Face")=16 then response.Write("Checked")%>>
- <img src="Images/face16.gif" width="22" height="22"></td>
- <td>
- <input type="radio" name="FaceNum" value="17" <%If ShowRs("Face")=17 then response.Write("Checked")%>>
- <img src="Images/face17.gif" width="22" height="22"> </td>
- <td>
- <input type="radio" name="FaceNum" value="18" <%If ShowRs("Face")=18 then response.Write("Checked")%>>
- <img src="Images/face18.gif" width="22" height="22"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="hback">
- <td class="hback" align="right">帖子内容</td>
- <td class="hback" valign="top" >
- <textarea name="Content" id="Content" rows="8" cols="25"><%=ShowRs("Body")%></textarea>
- </tr>
- <tr class="hback">
- <td class="hback"> <input type="hidden" name="NoteID" ID="NoteID" value="<%=ShowRs("ID")%>"></td>
- <td class="hback"><input type="submit" name="submit" value="OK保存贴子">
- <input type="reset" name="reset" value=" 清 空 ">
- </table>
- </form>
- <%
- end if
- end if
- set ShowRs=nothing
- if NoSqlHack(Request.QueryString("Act"))="Save" then
- ID=Request.Form("NoteID")
- Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
- IsTop=NoHtmlHackInput(trim(Request.form("Style")))
- Content=NoHtmlHackInput(Trim(Request.form("Content")))
- IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
- if IsAdmin="" then
- IsAdmin="0"
- end if
- if ID="" then
- strShowErr = "<li>参数出错!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if Topic="" then
- strShowErr = "<li>标题不能为空!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if isTop="" then
- strShowErr = "<li>帖子类型值没传过来!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- if Content="" then
- strShowErr = "<li>内容不能为空!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- 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
- if not SaveRs.eof then
- SaveRs("Topic")=Topic
- SaveRs("Body")=Content
- SaveRs("IsTop")=IsTop
- SaveRs("IsAdmin")=IsAdmin
- SaveRs("Face")=Request.Form("FaceNum")
- SaveRs("LastUpdateUser")=session("Admin_Name")
- SaveRs("LastUpdateDate")=now()
- SaveRs.update
- Set SaveRs=nothing
- Response.write("<script>history.go(-2);</script>")
- Response.end
- else
- Set SaveRs=nothing
- strShowErr = "<li>参数出错!</li>"
- Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
- Response.end
- end if
- end if
- Set Conn=nothing
- %>
- </body>
- </html>