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

📄 product_admin.asp

📁 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会 商会
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
if Session("userqx")>="1" and Session("userqx")<="9" then
else
	Response.Redirect "warn.asp"
end if
%>
<!-- #include file="../dsn.asp" -->
<%
classcode=Request.QueryString("classcode")
pageno=Request.QueryString("pageno")
delkeyno=Request.QueryString("delkeyno")
ordername=Request.QueryString("ordername")
byasc=Request.QueryString("byasc")

set cn=server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
set rs2=server.CreateObject("ADODB.Recordset")

tablename="product"

if classcode="" then
	sqltext="select top 1 * from product_class where parentcode<>'0' order by classcode"
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		classcode=rs("classcode")
		classname=trim(rs("classname"))
		basclass=trim(rs("basclass"))
		qxflag=trim(rs("qxflag"))		
		byasc=trim(rs("byasc"))
		listcount=rs("listcount")
	else
		Response.End
	end if
	rs.Close
else
	sqltext="select * from product_class where classcode='"+classcode+"'"
	rs.Open sqltext,cn,1,1
	if not rs.EOF then
		classcode=rs("classcode")
		classname=trim(rs("classname"))
		basclass=trim(rs("basclass"))
		qxflag=trim(rs("qxflag"))		
		byasc=trim(rs("byasc"))
		listcount=rs("listcount")
	else
		Response.End	
	end if	
	rs.Close
end if
sql="select classcode,classname from product_class where classcode='"+left(classcode,3)+"'"
rs2.Open sql,cn,1,1
if not rs2.EOF then
	parentname=trim(rs2(1))
end if
rs2.Close

if ordername="" then ordername="sortnum"
byasc = "desc"
ordertxt=" order by "+ordername+" "+byasc

htmlname="product_admin.asp?classcode="+classcode+"&ordername="+ordername+"&byasc="+byasc
htmlname2="product_admin.asp?classcode="+classcode
addhtml="product_edit.asp?classcode="+classcode+"&ordername="+ordername+"&byasc="+byasc

wheretxt=" where classcode='"+classcode+"'"

if Request.ServerVariables("REQUEST_METHOD")="POST" then
	rectot=Request.Form("rectot")
	for i=1 to rectot
		checksele=Request.Form("checksele"&i)
		if checksele<>"" then
			seleitem=Request.Form("seleitem"&i)
			cn.BeginTrans
			sqltext="delete from picfiles where tablename='"+tablename+"' and keyno="&seleitem
			cn.Execute(sqltext)
			
			sqltext="select keyno from product_info where prono="&seleitem
			rs.Open sqltext,cn,1,1
			do while not rs.EOF
				sqltext="delete from picfiles where tablename='product_info' and keyno="&rs(0)
				cn.Execute sqltext
				rs.MoveNext	
			loop
			rs.Close
			
			sqltext="delete from product_info where prono="&seleitem
			cn.Execute(sqltext)
			sqltext="delete from product where prono="&seleitem
			cn.Execute sqltext
			cn.CommitTrans
		end if
	next
end if
qxflag="110000000000"
%>

<HTML>
<HEAD>
<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: 宋体;}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:12px 宋体;color:ffffff} 

.bt1 {font:14px 宋体;color=000000} 
.bt2 {font:14px 宋体;color:ffffff} 

A:link {color: #000066}
A:visited {color: #000066}
A:hover {color: #ff0000}

A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#ff6600;}

A.r2:link {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:visited {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
-->
</style>
</HEAD>

<body topmargin=5 leftmargin=5 bgcolor=#ffffff>
<table width="100%" align=center border="0" cellspacing="0" cellpadding="2">
	<tr><td align="left">
		<table width="100%" border="0" cellspacing="0" cellpadding="0"  height=24>
		   <form name=form1 method="post" action="<%=htmlname%>">
			<tr valign=bottom>
				<td style="font-size:12px;">
				&nbsp;<font color=ff6600><%=parentname%></font> &gt; <font color=ff6600><%=classname%></font>
				&nbsp;<a href="<%=htmlname%>&pageno=<%=pageno%>">[刷新列表]</a>
				<a href="<%=addhtml%>">[增加]</a>
				</td>
				<td align="right">
				<input type="button" name="mydele" value="删除" style="width:60px;height:20px" onclick="delmsg(this.form)">
				<input type="checkbox" name="seleall" onclick="checkall(this.form)" >全选
				</td>
			</tr>
			</table>
	</td></tr>
	<%
		sqltext="select * from "+tablename+" "+wheretxt+ordertxt
		'Response.Write sqltext
		rs.Open sqltext,cn,1,1
	
		rs.PageSize=listcount
		if pageno="" then pageno=1 else pageno=cint(pageno)	
		if rs.PageCount>0 then rs.AbsolutePage=pageno

	%>
	<tr><td valign=top height=360>
		<table width="100%" border="0" cellspacing="1" cellpadding="1">
			<tr bgcolor="527c72" style="color:#ffffff" align="center">
				<td width=10 height=20 align=center></td>
				<td class=t2 height=20 width="35">序号</td>
				<td class=t2><a class=r2 href="<%=htmlname2%>&ordername=title&byasc=<%=selectxh("title",ordername,byasc,"asc")%>">产品名称</a></td>
				<td class=t2 width="60"><a class=r2 href="<%=htmlname2%>&ordername=state&byasc=<%=selectxh("state",ordername,byasc,"desc")%>">状态</a></td>
				
				<%if mid(qxflag,1,1)="1" then%>				
				<td class=t2 width="60"><a class=r2 href="<%=htmlname2%>&ordername=nomflag&byasc=<%=selectxh("nomflag",ordername,byasc,"desc")%>">新品推荐</a></td>
				<%end if%>

				<td class=t2 width="40"><a class=r2 href="<%=htmlname2%>&ordername=querycount&byasc=<%=selectxh("querycount",ordername,byasc,"desc")%>">点击</a></td>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=picflag&byasc=<%=selectxh("picflag",ordername,byasc,"desc")%>">小图</a></td>
				
				<%if mid(qxflag,2,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=picflag2&byasc=<%=selectxh("picflag2",ordername,byasc,"desc")%>">放大图</a></td>
				<%end if%>

				<%if mid(qxflag,4,1)="1" then%>
				<td class=t2 width="76"><a class=r2 href="<%=htmlname2%>&ordername=picflag3&byasc=<%=selectxh("picflag3",ordername,byasc,"desc")%>">推荐图</a></td>
				<%end if%>

				<%if mid(qxflag,6,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=spicflag4&byasc=<%=selectxh("spicflag4",ordername,byasc,"desc")%>">产品大图1</a></td>
				<%end if%>

				<%if mid(qxflag,7,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=spicflag5&byasc=<%=selectxh("spicflag5",ordername,byasc,"desc")%>">产品大图2</a></td>
				<%end if%>

				<%if mid(qxflag,8,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=spicflag6&byasc=<%=selectxh("spicflag6",ordername,byasc,"desc")%>">产品大图3</a></td>
				<%end if%>

				<%if mid(qxflag,5,1)="1" then%>
				<td class=t2 width="70"><a class=r2 href="<%=htmlname2%>&ordername=fileflag&byasc=<%=selectxh("fileflag",ordername,byasc,"desc")%>">PDF文档</a></td>
				<%end if%>

				<%if mid(qxflag,3,1)="1" then%>
				<td class=t2 width="76"><a class=r2 href="<%=htmlname2%>&ordername=infocount&byasc=<%=selectxh("infocount",ordername,byasc,"desc")%>">图文混排</a></td>
				<%end if%>
			</tr>
		<%
		i=1
		do while not rs.EOF and i<=listcount
			if (i mod 2)=0 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
		%>
				<td width=10 height=20 align=center>
					<input type=hidden name="seleitem<%=i%>" value="<%=rs("prono")%>">
					<input type=checkbox name="checksele<%=i%>" value="0">
				</td>

⌨️ 快捷键说明

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