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

📄 lbadmin.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"))
yxid=cint(Request.QueryString("yxid"))
enable=Request.QueryString("enable")
ppid=cint(Request.QueryString("ppid"))
pageno=Request.QueryString("pageno")
cpflag=Request.QueryString("cpflag")
if cpflag="" then 
		cpflag=0 
	else
		cpflag=cint(cpflag)
end if
htmlname=linklbadmin&"?pid="&pid&"&ppid="&ppid&"&cpflag="&cpflag
addhtml=linklbadminedit&"?pid="&pid&"&ppid="&ppid&"&cpflag="&cpflag
delid=cint(Request.QueryString("delid"))
if cpflag=1 then
		if ppid=0 then 
				tabname="scool"
				classesname="类型"
			else
				tabname="classes"
				classesname="品牌"
		end if
	else
		if pid=1 then
				tabname="classes"
				classesname="小类"
			else
				tabname="scool"
				classesname="大类"
		end if
end if
set cn=Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
set rs1=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")
scoolname="类别管理"
if ppid<>0 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 delid<>0 then
	sqltext3="delete from "+tabname+" where id="&delid
	cn.Execute sqltext3
	delid=0
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
		end if
		rs1.Update 
		rs1.Close 
		if ppid=0 then
				sqltext5="select enable from product where pppid="&yxid
		elseif ppid<>0 then
				sqltext5="select enable from product where ppid="&yxid
		end if
				rs1.Open sqltext5,cn,3,3
				do while not rs1.EOF 
				if rs1("enable")=0 then
						rs1("enable")=1
					else
						rs1("enable")=0
				end if
				rs1.Update				
				rs1.MoveNext 
				loop
				rs1.Close 
				yxid=0
		
end if

htmltitle="基本数据管理"
txtname="名称"
%>
<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">当前位置: <%Response.Write (scoolname)%>→  <%Response.Write (classesname)%>列表</font>
			</td>
			<td align="right">
			</td>
			</tr>
			</table>
			</td>
			</tr>
			</table>
		<table width="100%" height="20" border="0">
			<tr>
		<%

		if cpflag=0 then
				if pid=0 then
						sqltext1="select * from scool order by pl"
					else
						sqltext1="select * from classes order by pl"
				end if
			else
				if ppid=0 then
						sqltext1="select * from scool where flag=1 order by pl"
					else
						sqltext1="select * from classes where pid="&ppid&" order by pl"
				end if
		end if 
		'Response.Write sqltext1
		rs1.Open sqltext1,cn,1,1
		if ppid<>0 then
				listcs=5
			else
				listcs=30
		end if
		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>
		</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 width=50>序号</td>
				<td class=bt2><%=txtname%></td>
				<%if ppid=-1 then%>
				<td class=bt2 width=120>经销商</td>
				<%end if%>
			<%if pid=1 then%>
					<td class=bt2>所属大类</td>
			<%end if%>
			</tr>
		<%
		i=0
		do while not rs1.EOF and i<listcs 
				ccflag=0
					if ppid=0 then
							sqltext="select id from classes where pid="&rs1("id")
							rs2.Open sqltext,cn,1,1
							if not rs2.EOF then
									ccflag=1
								else
								ccflag=0
							end if
							rs2.Close 
						else
							sqltext="select id from danwei where pid="&rs1("id")
							rs2.Open sqltext,cn,1,1
							if not rs2.EOF then
									ccflag=1
								else
									ccflag=0
							end if
							rs2.Close 
				end if
				if cpflag=1 then
						sqltext="select id from product where pid="&rs1("id")
						rs2.Open sqltext,cn,1,1
						if  not rs2.EOF then
								ccflag=1
							else
								ccflag=0
						end if
						rs2.Close 
				end if
			if (i mod 2)=1 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
			if keyno1="" then keyno1=rs1("id")
		if rs1("enable")=1 then 
				enableflag="无效" 
			else 
				enableflag="有效" 
		end if	
		%>
		<td width="35" align="center" onclick="Javascript:delrec('<%=rs1("id")%>','<%=trim(rs1("name"))%>','<%=ccflag%>')"><img  src="delete.gif"></td>
		<td width="50" align="center"><input type="checkbox" name="yxc" onclick="Javascript:yxxcc('<%=rs1("id")%>','<%=ccflag%>','<%=trim(rs1("name"))%>','<%=enableflag%>')" <%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")%><%if pid=1 then Response.Write ("&lbpid="&rs1("pid"))%>"><%=rs1("name")%></a>
		  <%if pid=1 then%>			
						<td width="80" align="center">
						     <%sqltext="select name from scool where id="&rs1("pid")
						       rs2.Open sqltext,cn,1,1
						       if not rs2.EOF then%>
										<%Response.Write (trim(rs2("name")))%>
						       <%end if
						       rs2.Close %>
						</td>
		  <%end if%>
			<%if ppid=-1 then
			if rs1("sell")<>"" then
				sell=split(rs1("sell"),"/")'核心经销商ID文本数组
				sellm=ubound(sell,1)'核心经销商个数
				sqltext="select id from sell where flag=1"
				rs.Open sqltext,cn,1,1
				sellm=sellm-rs.RecordCount 
				rs.Close 
			else
				sellm=0
			end if
			sqltext="select id from sell"
			rs2.Open sqltext,cn,1,1
			sm=rs2.RecordCount 
			rs2.Close 
			%>
			<td width="120" align="center"><a href="<%=linkselllist%>?keyno=<%=rs1("id")%>" target=myview>核心(<font color=red><%=sellm%></font>)</a></td>
			<%end if%>
			</tr>
			<%rs1.MoveNext 
			i=i+1
			loop%>
		</table>
		<%if ppid=-1 then%>
		<table width="100%"> 
		<tr height=60><td></td></tr>
		</table>
		<table width="100%"> 
		<tr><td bgcolor="cccccc">
			<iframe name=myview scrolling=auto width=100% height=340 src="<%=linkselllist%>?keyno=<%=keyno1%>" frameborder=0></iframe>
		</td></tr>
		</table>
		<%end if%>
</body>
</html>
<script language="Javascript">

	function delrec(code,topic,ccflag)
	{
		if(ccflag==1){alert("该分类下还有数据,为保证数据的完整性,您不能删除,要删除请先删除该分类下的所有数据!");}else{
		if (confirm('您确认要删除“'+topic+'”吗?')==true)
		{
			window.location.href="<%=htmlname%>&delid="+code+""
		return false;
		}}
	}
	
	function yxxcc(code,ccflag,topic,enableflag)
	{
		if(ccflag==1){if (confirm('您确认要将“'+topic+'”以及“'+topic+'”分类下的所有数据都设置为'+enableflag+'吗?')==true){
		window.location.href="<%=htmlname%>&yxid="+code+""}}else{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 + -