📄 admin_edit.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetActicle")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim RsSetInfo,SortID,Sort1,Sort2,sContent
If Request("action") = "Edit" Then
SortID=trim(Request.Form("SortID"))
If SortID="isnull" Then
Response.Write "<script>alert(""请选择信息类型!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if SortID="null" Then
Response.Write "<script>alert(""你选的类别有二级分类,请选一个二级分类!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("title")="" Then
Response.Write "<script>alert(""请输入信息标题!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("Content")="" Then
Response.Write "<script>alert(""请输入信息内容!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("Key")="" Then
Response.Write "<script>alert(""请输入关键字!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
ID=Request("ID")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Info where Id="& ID
rs.open sql,conn,1,3
SortID=Request.Form("SortId")
Sort1=left(SortID,Instr(SortID,"|")-1)
Sort2=right(SortID,len(SortID)-Instr(SortID,"|"))
rs("Sort1")=Sort1
rs("Sort2")=Sort2
rs("Title")=server.HTMLEncode(trim(Request("Title")))
rs("Content")= request("content")
if Request("Pic")<>""then
rs("Pic")=Request("Pic")
rs("Ispic")=1
else
rs("Ispic")=0
end if
rs("Key")=server.HTMLEncode(Request("Key"))
rs("Date")=DATE()
if Request("Pw_Good")<>"" then
rs("Pw_Good")=Request("Pw_Good")
else
rs("Pw_Good")=False
end if
rs.update
rs.close
Response.Write "<script>alert(""修改成功"");location.href=""Admin_List.asp"";</script>"
Response.End
End IF
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信 息 修 改</title>
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
// 信息表单提交客户端检测
function doSubmit(){
if (document.form.SortID.value=="Add"){
alert("请先添加信息类型!");
return false;
} if (document.form.SortID.value=="isnull"){
alert("请选择信息类型!");
return false;
}
if (document.form.SortID.value=="null"){
alert("你选的类别有二级分类,请选一个二级分类!!");
return false;
}
if (document.form.title.value==""){
alert("信息标题不能为空!");
return false;
}
if (document.form.key.value==""){
alert("关键字不能为空!");
return false;
}
// getHTML()为eWebEditor自带的接口函数,功能为取编辑区的内容
if (Content.getHTML()==""){
alert("信息内容不能为空!");
return false;
}
return true;
}
</script>
</head>
<body topmargin='20' leftmargin='0' bottommargin='0'>
<%
if Request("id")<>"" then
Id=Request("Id")
Sql2 = "Select * from Info where Id="&Id&""
Set RsSetInfo = Conn.Execute(Sql2)
%>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>信息修改</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#A1BBE0'>
<form action="?action=Edit" method="POST" name="form" id="form" onSubmit="return doSubmit()">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" align="left" valign="middle"> 信息类型:
<select name="SortID" id="SortID"><option selected value="isnull">===请重选栏目===</option>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from a125_type where a125_big_id=0 and a125_setting<>4 and a125_setting<>5 order by a125_order"
rs.OPEN sql,Conn,1,1
if not (rs.eof and rs.bof) then
rs.movefirst
do while not rs.eof
sql="Select * from a125_type where a125_big_id= "& Rs("ID") &" and a125_setting<>3 order by a125_order"
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,1,1
if not (rs2.eof and rs2.bof) then
do while not rs2.eof
%>
<option value='<%=trim(rs("Id"))%>|<%=trim(rs2("Id"))%>' <%if RsSetInfo("Sort1")=RS("Id") and RsSetInfo("sort2")=Rs2("Id") then%>selected<%end if %>>『<%=rs("a125_names")%>』<%=rs2("a125_names")%></option>
<%
rs2.movenext
loop
end if
rs.movenext
rs2.close
set rs2=nothing
loop
end if
rs.close
set rs=nothing
%>
</select>
</td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" align="left" valign="middle"> 信息标题:
<input name="title" type="text" id="信息标题" value="<%=RsSetInfo("title")%>" size="40" maxlength="100">
<input name="Pw_Good" type="checkbox" id="Pw_Good" style="border:0px " value="True" <% if RsSetInfo("Pw_Good")=True then%>checked<%end if%>>
推荐 <font color="#FF0000">
<input name="ID" type="hidden" id="ID" value="<%=RsSetInfo("ID")%>" size="1" >
</font></td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td align="left" valign="middle"> <textarea name="content" id="content" style="display:none"><%=RsSetInfo("Content")%></textarea>
<IFRAME ID="Content" SRC="../editor.asp?id=Content" FRAMEBORDER="0" SCROLLING="no" WIDTH="590" HEIGHT="425"></IFRAME>
</td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" valign="middle">相关信息:<input name="Key" type="text" class="smallinput" ID="相关信息" value="<%=RsSetInfo("Key")%>" size="10" maxlength="50">
修改日期:<input name="Date" type="text" id="时间" value="<%=Date()%>" size="10" readonly>
<%
' 保存远程图片:<input name="SavePic" type="checkbox" style="border:0px" value="1" readonly>是
%><font color="red">*</font>注:图片上传请点图标<img src="../images/edit/Img.gif" width="22" height="22">
</td>
</tr>
<tr bgcolor='#EAEAEA'>
<td height="23" align="center"> <input
name="cmdok" type="submit" class="buttonface" value=" 修 改 " onClick="return doSubmit()">
<input type="reset" value=" 清 除 "
name="cmdcancel" class="buttonface"> </td>
</tr></form>
</table></td></tr></table><br>
<%
RsSetInfo.close
set RsSetInfo =nothing
conn.Close
set conn = nothing
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -