📄 adminedit2.asp
字号:
<%@ Language=VBScript%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
Response.Buffer=true
Response.Expires=0
%>
<%
if session("adminusername")="" then
session("xhy")=1
Response.Redirect linkwarn
end if
id=Request.QueryString("id")
pid=Request.QueryString("pid")
ppid=Request.QueryString("ppid")
pppid=Request.QueryString("pppid")
pageno=Request.QueryString ("pageno")
englishflag=Request.QueryString ("englishflag")
if pppid="" then
pppid=0
else
pppid=cint(pppid)
end if
if ppid="" then
ppid=0
else
ppid=cint(ppid)
end if
if pid="" then
pid=0
else
pid=cint(pid)
end if
if id="" then
id=0
else
id=cint(id)
end if
if englishflag="" then
englishflag=0
else
englishflag=englishflag
end if
if englishflag=0 then
pidtabname="danwei"
tabname="cdanwei"
txt="<font color=red>(中文版)</font>"
else
pidtabname="edanwei"
tabname="ecdanwei"
txt="<font color=blue>(英文版)</font>"
end if
if pageno="" then pageno=1
backhtml=linkadmin2&"?pid="&pid&"&ppid="&ppid&"&pppid="&pppid&"&pageno="&pageno&"&englishflag="&englishflag
creadate=now()
set cn=Server.CreateObject("ADODB.Connection")
set rs1=Server.CreateObject("ADODB.Recordset")
set rs2=Server.CreateObject("ADODB.Recordset")
set rs3=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
if pppid<>0 then
sqltext="select name from scool where id="&pppid
rs1.Open sqltext,cn,1,1
if not rs1.EOF then
scoolname=rs1("name")
end if
rs1.Close
end if
if ppid<>0 then
sqltext="select name from classes where id="&ppid
rs1.Open sqltext,cn,1,1
if not rs1.EOF then
classesname=rs1("name")
end if
rs1.Close
end if
if pid<>0 then
sqltext="select name,flag from "+pidtabname+" where id="&pid
rs1.Open sqltext,cn,1,1
if not rs1.EOF then
danweiname=rs1("name")
modeflag=rs1("flag")
end if
rs1.Close
end if
if id<>0 then
sqltext="select name from "+tabname+" where id="&id
rs1.Open sqltext,cn,1,1
if not rs1.EOF then
cdanweiname=rs1("name")
end if
rs1.Close
end if
%>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
yx=Request.Form("c1")
title=trim(Request.Form("title"))
dateyx=Request.Form ("c2")
pl=trim(Request.Form("t1"))
add=checkstring(trim(Request.Form("httpadd")))
sqltext3="select max(pl) as maxpl from "+tabname+" where pid="&pid&" and ppid="&ppid&" and pppid="&pppid
if pl="" or not isnumeric(pl) then
rs2.Open sqltext3,cn,1,1
if not rs2.EOF then
pl=rs2("maxpl")+1
end if
rs2.Close
end if
if pl="" or not isnumeric(pl) then pl=1
if id=0 then
sqltext3="select * from "+tabname+" where name='"+title+"'and pid="&pid&" and ppid="&ppid&" and pppid="&pppid
rs2.Open sqltext3,cn,1,1
if not rs2.EOF then
err=1
errtxt="错误:标题:“"&title&"”已存在,请换名重试!"
title=""
else
sqltext2="select id from "+tabname
rs1.Open sqltext2,cn,1,2
rs1.AddNew
rs1.Update
id=rs1("id")
rs1.Close
end if
rs2.Close
end if
if err<>1 then
sqltext2="select * from "+tabname+" where id="&id
rs1.Open sqltext2,cn,1,2
rs1("name")=title
rs1("name2")=trim(Request.Form ("name2"))
rs1("creatdate")=now()
rs1("body")=Replace(trim(Request.Form ("content")),"../upfile/","./upfile/")
rs1("pl")=pl
if ppid=6 then
rs1("body1")=trim(Request.Form ("content1"))
rs1("keyword1")=trim(Request.Form ("keyword"))
end if
if yx="on" then
rs1("enable")=1
end if
if yx="" then
rs1("enable")=0
end if
if dateyx="on" then
rs1("dateenable")=1
end if
if dateyx="" then
rs1("dateenable")=0
end if
if modeflag=1 then
rs1("flag")=1
else
rs1("flag")=0
end if
rs1("pid")=pid
rs1("ppid")=ppid
rs1("pppid")=pppid
rs1.Update
rs1.Close
Response.Redirect backhtml
end if
end if
if id<>0 then
sqltext1="select * from "+tabname+" where id="&id
rs1.Open sqltext1,cn,1,1
cdanweiname=rs1("name")
title=rs1("name")
name2=rs1("name2")
yxx=rs1("enable")
creadate=rs1("creatdate")
dateyx=rs1("dateenable")
pl=rs1("pl")
body=rs1("body")
body=replace(body,"./upfile/","../upfile/")
if ppid=6 then
body1=trim(rs1("body1"))
keyword=trim(rs1("keyword1"))
end if
name2=rs1("name2")
rs1.Close
if len(cdanweiname)>18 then
cdanweiname=left(cdanweiname,18)&"..."
else
title=cdanweiname
end if
else
cdanweiname="增加新条目"
yxx=1
oneenable=1
pl=""
body=""
end if
txtname="标题"
txtname1="内容"
if ppid=6 then
txtname="名称"
txtname1="产品简介"
txtname2="详细介绍"
end if
%>
<html>
<head>
<title>网站管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;line-height:130%}
.t1 {font:12px 宋体;color=000000}
.t2 {font:12px 宋体;color:ffffff}
.t3 {font:12px 宋体;color:336699}
.t4 {font:12px 宋体;color:ff0000}
.t5 {font:12px 宋体;color:ff6600}
.bt1 {font:14px 宋体;color=000000}
.bt2 {font:12px 宋体;color:ffffff}
.bt3 {font:14px 宋体;color:336699}
.bt4 {font:14px 宋体;color:ff0000}
.bt5 {font:14px 宋体;color:0000ff}
.bt10 {font:14px 宋体;color:0000ff}
.td1 {font-size:12px;background-color:#3388bb;color:#ffffff}
.td2 {font-size:12px;background-color:#ffffff;color:#000000;}
A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}
A.r1:link {text-decoration:none;color:#304556;}
A.r1:visited {text-decoration:none;color:#304556;}
A.r1:hover {text-decoration:underline;color:ff6600;}
A.r2:link {text-decoration:none;color:#ffffff;}
A.r2:visited {text-decoration:none;color:#ffffff;}
A.r2:hover {text-decoration:underline;color:cccc00;}
-->
</style>
</head>
<body bgcolor=#ffffff topmargin=10>
<form action="<%=linkadminedit2%>?id=<%=id%>&pid=<%=pid%>&ppid=<%=ppid%>&pppid=<%=pppid%>&englishflag=<%=englishflag%>" method=post name=editform>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td><font class=t5>当前位置:<%=scoolname%>→ <%=classesname%><%if englishflag=1 then Response.Write "<font color=blue>(英文版)</font>"%>→ <%=danweiname%>→ <%=cdanweiname%></b></font>
← <a href="<%=backhtml%>">返回列表</a></td>
</tr>
<tr><td><hr size=1></td></tr>
<tr bgcolor=ffe4c4><td height=20><font class=t1>具体内容</font><br>
</td></tr>
<tr><td height=5></td></tr>
</table>
<div align=center class=t1><font color="red"><b><%=errtxt%></b></font></div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr><td width=80 align=right>有效性:</td>
<td>
<%if yxx=1 then%>
<input type="checkbox" checked name="c1">
<%else%>
<input type="checkbox" name="c1">
<%end if%>
(更新时间:<font color=000000><%=creadate%></font>
<%if ppid<>5 then%>
<%if modeflag=1 then%>
<%if dateyx=1 then%>
<input type="checkbox" checked name="c2">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -