📄 danweiadmineditpic.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=cint(Request.QueryString("id"))
pid=cint(Request.QueryString("pid"))
ppid=cint(Request.QueryString("ppid"))
pppid=cint(Request.QueryString("pppid"))
ppppid=Request.QueryString("ppppid")
englishflag=Request.QueryString ("englishflag")
pageno=Request.QueryString ("pageno")
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 englishflag="" then
englishflag=0
else
englishflag=englishflag
end if
if englishflag=0 then
tabnamepic="danweipic"
txtyy="(中文版)"
else
tabnamepic="edanweipic"
txtyy="(英文版)"
end if
if ppppid=0 then
if englishflag=0 then
tabname="danwei"
else
tabname="edanwei"
end if
else
if englishflag=0 then
tabname="cdanwei"
else
tabname="ecdanwei"
end if
end if
if ppppid=0 then
if pppid<>0 then
sqltext1="select * from scool where id="&pppid
rs1.Open sqltext1,cn,1,1
scoolname=rs1("name")
rs1.Close
end if
if ppid<>0 then
sqltext1="select * from classes where id="&ppid
rs1.Open sqltext1,cn,1,1
classname=rs1("name")
rs1.Close
end if
if pid<>0 then
sqltext1="select * from "+tabname+" where id="&pid
rs1.Open sqltext1,cn,1,1
danweiname=rs1("name")
rs1.Close
end if
else
if ppppid<>0 then
sqltext1="select * from scool where id="&ppppid
rs1.Open sqltext1,cn,1,1
scoolname=rs1("name")
rs1.Close
end if
if pppid<>0 then
sqltext1="select * from classes where id="&pppid
rs1.Open sqltext1,cn,1,1
classname=rs1("name")
rs1.Close
end if
if ppid<>0 then
if englishflag=0 then
sqltext1="select * from danwei where id="&ppid
else
sqltext1="select * from edanwei where id="&ppid
end if
rs1.Open sqltext1,cn,1,1
danweiname=rs1("name")
rs1.Close
end if
if pid<>0 then
sqltext1="select * from "+tabname+" where id="&pid
rs1.Open sqltext1,cn,1,1
cdanweiname=rs1("name")
rs1.Close
end if
danweiname=danweiname&"→ "&cdanweiname
end if
backhtml=linkdanweiadminpic&"?pid="&pid&"&ppid="&ppid&"&pppid="&pppid&"&ppppid="&ppppid&"&englishflag="&englishflag
%>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
title=trim(Request.Form("title"))
pl=trim(Request.Form("t1"))
sqltext3="select max(pl) as maxpl from "+tabnamepic+" 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 "+tabnamepic+" 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 "+tabnamepic
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 "+tabnamepic+" where id="&id
rs1.Open sqltext2,cn,1,2
rs1("name")=title
rs1("creatdate")=now()
rs1("pl")=pl
rs1("enable")=1
rs1("pid")=pid
rs1("ppid")=ppid
rs1("pppid")=pppid
rs1("ppppid")=ppppid
rs1.Update
rs1.Close
Response.Redirect backhtml
end if
end if
if id<>0 then
sqltext1="select * from "+tabnamepic+" where id="&id
rs1.Open sqltext1,cn,1,1
picname=rs1("name")
yxx=rs1("enable")
creadate=rs1("creatdate")
title=rs1("name")
pl=rs1("pl")
rs1.Close
if len(picname)>10 then
picname=left(picname,10)&"..."
end if
else
picname="增加新图片"
yxx=1
dateyxx=1
title=""
pl=""
body=""
end if
txtname="名称"
nr="内容"
%>
<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="<%=linkdanweiadmineditpic%>?id=<%=id%>&pid=<%=pid%>&ppid=<%=ppid%>&pppid=<%=pppid%>&ppppid=<%=ppppid%>&englishflag=<%=englishflag%>" method=post name=editform>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td><font class=t5>当前位置:<%=scoolname%>→ <%=classname%><%if englishflag=1 then Response.Write "<font color=blue>(英文版)</font>"%>→ <%=danweiname%><font color="#000000">(图片)</font>→ <%=picname%></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>
</td>
</td></tr>
<tr><td width=80 align=right>序号:</td><td><input type="text" value="<%=pl%>" name="t1" maxlength=60 size=10></td></tr>
<tr><td width=80 align=right><%=txtname%>:</td>
<td><input type="text" value="<%=title%>" name=title maxlength=60 size=35><font color=red>*</font></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td width=200></td><td height=10></td></tr>
<tr>
<td width=200></td>
<td align=left>
<input type="button" name="button1" value="确认提交" onclick="check1()">
</td></tr>
<tr><td width=200></td><td height=10></td></tr>
</table>
</form>
</body>
</html>
<script language=vbscript>
sub check1()
dim form1
set form1=document.editform
if form1("title").value="" then
alert("<%=txtname%>不能为空!")
form1.title.focus
else
form1.submit
end if
end sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -