📄 admin_edit.asp
字号:
<!--#include file="Include/Gaobei_setup.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="include/char.asp" -->
<!--#include file="Include/check.asp"-->
<!--#include FILE="Include/Admin_Function.asp"-->
<%CheckAdmin1%>
<!--修改-->
<%
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")))
if request("SavePic")=1 then
sContent = Request("Content")
sContent = eWebEditor_ReplaceRemoteUrl(sContent, "UploadFile/", "bmp|jpg|gif")
rs("Content")=sContent
else
rs("Content")= request("content")
end if
rs("Pic")=Request("Pic")
if Request("Pic")<>""then
rs("Ispic")=1
else
rs("Ispic")=0
end if
rs("Key")=server.HTMLEncode(Request("Key"))
rs("Date")=server.HTMLEncode(Request("Date"))
rs("writer")=server.HTMLEncode(Request("writer"))
rs("writefrom")=server.HTMLEncode(Request("writefrom"))
rs("ReadGrade")=server.HTMLEncode(Request("ReadGrade"))
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="other/Admin.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 leftmargin="0" topmargin="8">
<%
if Request("id")<>"" then
Id=Request("Id")
Sql2 = "Select * from Info where Id="&Id&""
Set RsSetInfo = Conn.Execute(Sql2)
%>
<form action="?action=Edit" method="POST" name="form" id="form" onsubmit="return doSubmit()">
<table width="590" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr valign="middle" bgcolor="#EAEAEA">
<td height="25" align="center">信 息 修 改</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23" align="left" valign="middle"> 信息类型:
<select name="SortID" id="SortID">
<%
Sql = "select * from Sort where B_id=0 and setting<>4 and setting<>5 order by S_Order "
Set Rs=Conn.Execute(Sql )
if rs.eof and rs.bof then
response.write "<option selected value='Add' selected>===请先添加栏目===</option>"
else
%>
<option selected value="isnull">===请重选栏目===</option>
<% do while not rs.eof%>
<option value=<%if Rs("Setting")<3 then%>"null"<%end if%><%if Rs("Setting")=3 then%>"<%=trim(RS("Id"))%>|0"<%end if%> <%if RsSetInfo("Sort1")=RS("Id") and RsSetInfo("sort2")=0 then%>selected<%end if %>><%=trim(rs("Names"))%></option>
<% if Rs("Setting")<>3 then%>
<%
SqlClass = "Select * from Sort where B_ID= "& Rs("ID") &" and setting<>3 order by S_Order "
Set RsClass = Conn.Execute(SqlClass)
if RsClass.eof and RsClass.bof then
Response.write("")
else
do while not RsClass.eof
%>
<option value="<%=trim(RS("Id"))%>|<%=trim(RsClass("Id"))%>" <%if RsSetInfo("Sort1")=RS("Id") and RsSetInfo("sort2")=RsClass("Id") then%>selected<%end if %> >├<%=trim(RsClass("Names"))%></option>
<%
RsClass.movenext
loop
end if
RsClass.close
set RsClass=nothing
%>
<%end if%>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select> </td>
</tr>
<tr 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">
<td height="23" align="left" valign="middle"> 内容/<font color="#FF0000"> </font>图片:
<input name="pic" type="text" id="pic" value="<%=RsSetInfo("Pic")%>" size="39">
[<a href="JavaScript:openem()">上传图片</a>] [<a href="javascript:preview()">图片预览</a>]</td>
</tr>
<tr 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">
<td height="23" valign="middle"> 相关信息:
<input name="Key" type="text"
class="smallinput" ID="相关信息" value="<%=RsSetInfo("Key")%>" size="20" maxlength="50">
来源:
<input type="text" name="writefrom" size="20"
class="smallinput" maxlength="100" value="<%=RsSetInfo("writefrom")%>" id="来源"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23" align="left" valign="middle"> 发布日期:
<input name="Date" type="text" id="时间" value="<%=Date()%>" size="20" readonly>
作者:
<input name="writer" type="text"
class="smallinput" id="writer2" value="<%=RsSetInfo("writer")%>" size="20" maxlength="100"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="26" align="left" valign="middle"> <strong>保存远程文件:</strong>
<input name="SavePic" type="checkbox" style="border:0px" value="1">
是
<strong>阅读等级</strong>:
<select name="ReadGrade" id="ReadGrade">
<option value="0" <% if RsSetInfo("ReadGrade")=0 then%>selected<%end if%>>游客可读</option>
<option value="1" <% if RsSetInfo("ReadGrade")=1 then%>selected<%end if%>>普通用户</option>
<option value="2" <% if RsSetInfo("ReadGrade")=2 then%>selected<%end if%>>VIP 用户</option>
</select></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>
</table>
</form>
<%
RsSetInfo.close
set RsSetInfo =nothing
conn.Close
set conn = nothing
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -