⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminedit.asp

📁 一个不错的企业网站源代码!
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ 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=0
pid=0
ppid=0
pageno=0
id=Request.QueryString("id")
pid=Request.QueryString("pid")
ppid=Request.QueryString("ppid")
pageno=Request.QueryString ("pageno")
englishflag=Request.QueryString ("englishflag")
if id="" then id=0
if pid="" then pid=0
if ppid=0 then ppid=0
if pageno="" then pageno=1
backhtml=linkadmin&"?pid="&pid&"&ppid="&ppid&"&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 englishflag="" then
		englishflag=0
	else
		englishflag=englishflag
end if
if englishflag=0 then
		tabname="danwei"
		tabnamepic="danweipic"
		url="../upfile/"
	else
		tabname="edanwei"
		tabnamepic="edanweipic"
		url="../english/upfile/"
end if	
if ppid<>"" then
		sqltext="select name from scool where id="&ppid
		rs1.Open sqltext,cn,1,1
		if not rs1.EOF then
				scoolname=rs1("name")
		end if
		rs1.Close 
end if
if pid<>"" then
		sqltext="select name from classes where id="&pid
		rs1.Open sqltext,cn,1,1
		if not rs1.EOF then
				classname=rs1("name")
		end if
		rs1.Close 
end if
if id<>"" then
		sqltext="select name from "+tabname+" where id="&id
		rs1.Open sqltext,cn,1,1
		if not rs1.EOF then
				danweiname=rs1("name")
		end if
		rs1.Close 
end if
%>


<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then

		if id="" then id=0
		if cid="" then cid=0
		yx=Request.Form("c1")
		title=trim(Request.Form("title"))
		pl=trim(Request.Form("t1"))
		add=checkstring(trim(Request.Form("idd")))
		if pid=4 then
				yhj=trim(Request.Form ("yhj"))
				thj=trim(Request.Form ("thj"))
				if yhj="" or not isnumeric(yhj) then yhj="500"
				if thj="" or not isnumeric(thj) then thj="400"
		end if		
		sqltext3="select max(pl) as maxpl from "+tabname+" where pid="&pid
		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
				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
			if englishflag=0 then
				rs1("body")=Replace(trim(Request.Form ("content")),"../upfile/","./upfile/")
				if pid=5 then
					rs1("body1")=Replace(trim(Request.Form ("content1")),"../upfile/","./upfile/")
				end if
			else
				rs1("body")=Replace(trim(Request.Form ("content")),"../english/upfile/","./english/upfile/")
				if pid=5 then
					rs1("body1")=Replace(trim(Request.Form ("content1")),"../english/upfile/","./english/upfile/")
				end if
			end if	
				if pid=2  then
					rs1("flag")=cint(Request.Form ("rr1"))
				else
					rs1("flag")=1											
				end if
				if pid=4 then
						rs1("yhj")=yhj
						rs1("thj")=thj
				end if	
				rs1("creatdate")=now()	
				rs1("pl")=pl
				if yx="on" then
					rs1("enable")=1
				end if
				if yx="" then
					rs1("enable")=0
				end if
				if pid=7 or pid=5 then
						rs1("add")=trim(Request.Form ("address"))
						rs1("tel")=trim(Request.Form ("tel"))
				end if			
				if pid=5 then
						rs1("yhj")=trim(Request.Form ("fax"))
						rs1("thj")=trim(Request.Form ("email"))
				end if	
				if pid=6 then
						if Request.Form ("rr99")<>"" then
								rs1("fileflag")=cint(trim(Request.Form ("rr99")))
						end if		
				end if
				rs1("pid")=pid
				rs1("ppid")=ppid
				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
		danweiname=rs1("name")
		yxx=rs1("enable")
		creadate=rs1("creatdate")
		title=rs1("name")
		pl=rs1("pl")
		body=rs1("body")
		if body<>"" then
				body=replace(body,"./upfile/","../upfile/")
		end if		
		body1=rs1("body1")
		if body1<>"" then
				body1=replace(body1,"./upfile/","../upfile/")
		end if		
		if pid=2  then
				flag=rs1("flag")
		end if	
		if pid=4 then
				yhj=rs1("yhj")
				thj=rs1("thj")
		end if	
		if pid=7 or pid=5 then
				address=rs1("add")
				tel=rs1("tel")
		end if	
		if pid=5 then
				fax=trim(rs1("yhj"))
				email=trim(rs1("thj"))
		end if	
		if pid=6 then
		        fileflag=rs1("fileflag")
		end if		
		rs1.Close
		if len(danweiname)>18 then
				danweiname=left(danweiname,18)&"..."
			else
				title=danweiname
		end if
	else
		danweiname="增加新条目"
		yxx=1
		title=""
		pl=""
		body=""
		flag=0
end if

txtname="名称"
txtname1="内容"
if pid=2 then
	txtname="新闻类别名称"
end if	
if pid=3 then
	txtname="刊号"
end if	
if pid=6 then
	txtname="产品类别"
end if	
if pid=5 then
	txtname1="企业简介"
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="<%=linkadminedit%>?id=<%=id%>&pid=<%=pid%>&ppid=<%=ppid%>&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%></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=90 align=right>有效性:</td>
		<td>
			<%if yxx=1 then%>
					<input type="checkbox" checked name="c1">
				<%else%>
					<input type="checkbox" name="c1">
			<%end if%>					  	
		&nbsp;&nbsp;(更新时间:<font color=000000><%=creadate%></font>)
		</td></tr>
	<tr><td width=90 align=right>序号:</td><td><input type="text" value="<%=pl%>" name="t1" maxlength=60 size=10></td></tr>
	<tr><td width=90 align=right><%=txtname%>:</td>
		<td><input type="text" value="<%=title%>" name=title maxlength=60 size=35><font color=red>*</font></td></tr>
	<%if pid=2 then%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -