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

📄 admin.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
if session("adminusername")="" then
		session("xhy")=1
		Response.Redirect linkwarn
end if
enable=""
id=cint(Request.QueryString("id"))
pid=cint(Request.QueryString("pid"))
delid=cint(Request.QueryString("delid"))
yxid=cint(Request.QueryString("yxid"))
ppid=Request.QueryString("ppid")
englishflag=Request.QueryString ("englishflag")
plflag=Request.QueryString ("plflag")
pl1=Request.QueryString ("pl")
if pl1="" or pl1=1 then pl1=1
if pl1=1 then 
		pl1=9
	else
		pl1=1
end if 
if ppid="" then
		ppid=0
	else
		ppid=cint(ppid)
end if
pl1=cint(pl1)
if plflag="" then plflag="pl"
if englishflag="" then
		englishflag=0
	else
		englishflag=cint(englishflag)
end if
pageno=Request.QueryString("pageno")
addhtml=linkadminedit&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
admin2html=linkadmin2&"?ppid="&pid&"&pppid="&ppid&"&englishflag="&englishflag
htmlname=linkadmin&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
yzhtml=linkadmin&"?pid="&pid&"&ppid="&ppid
xyhtml=linkxy&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
plhtml=linkadmin&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
admin2=linkadmin2&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
pichtml="adminpic.asp?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag

'if pid=10 then Response.Redirect xyhtml
if pid=9 then Response.Redirect linkengageadmin&"?pid="&pid&"ppid="&ppid
if pid=10 then Response.Redirect linkengageuser&"?ppid="&ppid&"&pid="&pid
'if pid=14 then Response.Redirect linkorderadmin&"?pid="&pid&"&ppid="&ppid
if pid=11 then Response.Redirect linkcountadmin&"?pid="&pid&"&ppid="&ppid
if pid=12 then Response.Redirect linkcontactadmin&"?pid="&pid&"&ppid="&ppid
if pid=13 then	Response.Redirect linkadmins&"?pid="&pid&"&ppid="&ppid
if pid=14 then	Response.Redirect linkcountlist
if pid=15 then	Response.Redirect linkadminpass

set cn=Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs1=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")
if pid=1 or pid=2 or pid=4 or pid=5 or pid=6 or pid=7 or pid=8 or pid= 16 then de=1
if pid=2 then
		txtname="新闻类别"
elseif pid=3 then	
		txtname="刊号"
elseif pid=6 then	
		txtname="产品类别"		
else
		txtname="名称"		
end if
if englishflag=0 then
		tabname="danwei"
		tabnamepic="danweipic"
		txt="<font color=red>(中文版)</font>"
	else
		tabname="edanwei"
		tabnamepic="edanweipic"
		txt="<font color=blue>(英文版)</font>"
end if		
if delid<>0 then
	sqltext3="delete from "+tabname+" where id="&delid
	cn.Execute sqltext3
	delid=""
end if

if yxid<>0 then
		sqltext4="select * from "+tabname+" where id="&yxid
		rs1.Open sqltext4,cn,1,2
		if not rs1.EOF then
				if rs1("enable")=1 then
						rs1("enable")=0
					else
						rs1("enable")=1
				end if
				yxid=0
		end if
		rs1.Update 
		rs1.Close 
		Response.Redirect htmlname
end if

if pid<>0 then
	sqltext1="select * from classes where id="&pid
	rs1.Open sqltext1,cn,1,1
	if not rs1.EOF then
			classname=rs1("name")
	end if
	rs1.Close
end if
if ppid<>0 then
	sqltext1="select * from scool where id="&ppid
	rs1.Open sqltext1,cn,1,1
	scoolname=rs1("name")
	rs1.Close 
end if
htmltitle="基本数据管理"
%>
<html>
<head>
<title><%=htmltitle%></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 topmargin=5>
<table width="100%" align=center>
	<tr>
	<td valign="top" align="left" width="100%">
		<table width="100%" height="20" border="0">
			<tr>
			<td style="font-size:12px;"></td>
			<td><font class="t5">当前位置:<%=scoolname%>→  <%=classname%>列表 <%=txt%></font>
			<% if pid=4 then%>
			  (注意:该栏目为首页弹出窗口的内容)
			 <% end if%>
			</td>
			<td align="right">
			</td>
			</tr>
			</table>
			</td>
			</tr>
			</table>
		<table width="100%" height="20" border="0">
			<tr>
		<%
			if pl1=1 then
					sqltext1="select * from "+tabname+" where pid="&pid&" order by "+plflag
				else
					sqltext1="select * from "+tabname+" where pid="&pid&" order by "+plflag+" desc"
			end if
			rs1.Open sqltext1,cn,1,1
		listcs=30
		rs1.PageSize=listcs
		if pageno="" then 
			pageno=1
		else
			pageno=cint(pageno)	
		end if	
		if rs1.PageCount>0 then rs1.AbsolutePage=pageno%>
				<td class=t1 align="left" width=300>
			<a href="Javascript:window.location.reload()">[刷新列表]</a>
			<a href="<%=addhtml%>">[增加]</a>
		<%
		if de=1 then
		if englishflag=0 then%>
				<a href="<%=yzhtml%>&englishflag=1">[英文版]</a>
			<%else%>
				<a href="<%=yzhtml%>&englishflag=0">[中文版]</a>
		<%end if
		end if
		%>	
		</td>
		<td align="right">
		<%if rs1.PageCount>1 then%>
			[第<b><font color=ff6600><%=pageno%></font></b>页, 共<b><font color=ff6600><%=rs1.PageCount%></font></b>页<b><font color=ff6600><%=rs1.RecordCount%></font></b>条记录		              	
			<%if pageno>1 then%>
				<a class=r href="<%=htmlname%>&pageno=1">首页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno-1%>">上页</a>              
			<%end if              
			if pageno<rs1.PageCount then%>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno+1%>">下页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=rs1.PageCount%>">末页</a>              
			<%end if%>              
		<%end if              
		%>              
		</td></tr>
		</table>
		
		
		<table width="100%" border="0" cellspacing="1" cellpadding="1" style="font-size:14.5px;line-height:100%">
			<tr bgcolor="336699" style="color:#ffffff" align="center">
				<td class=bt2>删除</td>
				<td class=bt2>有效性</td>
				<td class=bt2><a href="<%=plhtml%>&plflag=pl&pl=<%=pl1%>"><font color="#ffffff">序号</font></a></td>
				<td class=bt2><a href="<%=plhtml%>&plflag=name&pl=<%=pl1%>"><font color="#ffffff"><%=txtname%></font></a></td>
				<%if pid<>4 and pid<>7 then%>
				<%if pid=2 then%>
						<td class=bt2><a href="<%=plhtml%>&plflag=flag&pl=<%=pl1%>"><font color="#ffffff">排版模式</font></a></td>
				<%end if%>
				<%if pid=16 then%>		
					<td class=bt2>图片</td>
				<%else%>	
				<%if pid<>17 then%>
				<%if pid=2 or pid=3 or pid=6 then%>		
						<td class=bt2>下级管理</td>
					<%else%>	
						<td class=bt2>图片管理</td>
				<%end if%>		
				<%end if%>
				<%end if%>
				<%end if%>
				<%if pid=4 then%>
						<td class=bt2>图片</td>
				<%end if%>		
			</tr>
		<%
		i=0
		do while not rs1.EOF and i<listcs 
			csflag=0
			if (i mod 2)=1 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
			csflag=0
			if pid=6 or pid=7 then
					sqltext="select id from cdanwei where pid="&rs1("id")&" and ppid="&pid&" and pppid="&ppid
					'Response.Write sqltext
					rs2.Open sqltext,cn,1,1
					if not rs2.EOF then
							csflag=1
						else
							csflag=0
					end if
					rs2.Close 
			end if
			sqltext="select id from "+tabnamepic+" where pid="&rs1("id")&" and ppid="&pid&" and pppid="&ppid
			rs2.Open sqltext,cn,1,1
			if not rs2.EOF then
					csflag=1
			end if
			picsm=0
			picsm=rs2.RecordCount 
			rs2.Close 
		%>
		<td width="35" align="center" onclick="Javascript:delrec('<%=rs1("id")%>','<%=trim(rs1("name"))%>','<%=csflag%>')"><img  src="delete.gif"></td>
		<td width="50" align="center"><input type="checkbox" name="yxc" onclick="Javascript:yx('<%=rs1("id")%>')"  <%if rs1("enable")=1 then Response.Write ("checked")%>></td>
		<td width="50" align="center"><%=rs1("pl")%></td>
		<td align=left><a href="<%=addhtml%>&id=<%=rs1("id")%>&pageno=<%=pageno%>"><%=rs1("name")%></a>
        <%if pid<>4 and pid<>7 then%>
        <%if pid=2 then%>
				<td width="80" align="center"><%if rs1("flag")=0 then Response.Write ("简单模式") else Response.Write ("<font color=red>图文混排</font>") end if%></td>
		<%end if%>		
		<%if pid<>16 then%>
		<%if pid<>17 then%>
		<%if pid=2 or pid=3 or pid=6 then%>			
				<td width="80" align="center"><a href="<%=admin2html%>&pid=<%=rs1("id")%>">下级管理</a></td>
			<%else%>	
				<td width="80" align="center">
					<a href="danweiadminpic.asp?pid=<%=rs1("id")%>&pageno=<%=pageno%>&ppid=<%=pid%>&pppid=<%=ppid%>&englishflag=<%=englishflag%>">附加图片(<font color=red><%=picsm%>条</font>)</a>
				</td>
		<%end if%>
		<%end if%>
		<%else%>
			<td width="80" align="center">
				<a href="Javascript:editimage('<%=rs1("id")%>','0')">图片</a>
					<%if rs1("picflag")="1" then Response.Write("<font color=red style='font-size:12px'>(有)</font>") else Response.Write("<font color=navy style='font-size:12px'>(无)</font>")%>
			</td>
		<%end if%>
		<%end if%>		
		<%if pid=4 then%>
			<td width="80" align="center">
				<a href="Javascript:editimage('<%=rs1("id")%>','0')">图片</a>
					<%if rs1("picflag")="1" then Response.Write("<font color=red style='font-size:12px'>(有)</font>") else Response.Write("<font color=navy style='font-size:12px'>(无)</font>")%>
			</td>
		<%end if%>	
	</tr>
	<%rs1.MoveNext 
	i=i+1
	loop%>
</table>
</body>
</html>
<script language="Javascript">

	function delrec(code,topic,csflag)
	{
		if (confirm('您确认要删除“'+topic+'”吗?')==true)
		{
			if (csflag==1){ alert("该条目下还有数据,为维护数据的完整性,不能删除,要删除该分类,请先删除该分类下所有数据及图片!");} else{window.location.href="<%=htmlname%>&delid="+code+"";}
		return false;
		}
	}
	
		function yx(code)
	{	window.location.href="<%=htmlname%>&yxid="+code+""
	}
	
	function editimage(keyno,pic)
	{
		var str
		str="upload.asp?" ;
		str=str+"id="+keyno;
		str=str+"&pic="+pic;
		str=str+"&tablename=<%=tabname%>"
	window.open(str,"mywin","toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=yes,width=550,height=400,left=120,top=70")		
	}
</script>


⌨️ 快捷键说明

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