📄 sortlist.asp
字号:
<!-- #include file="setup.asp" -->
<%
if Request.ServerVariables("request_method")="POST" then
validate "Login.asp",1
BuyProId=Trim(Request.Form("BuyProId"))
D1=Trim(Request.Form("D1"))
TheSort=Request.Form("TheSort")
if IsNumEric(TheSort)=False Then Error 2,"错误的产品类别!",""
if D1="ThePage" Then
OPt=Request.Cookies("OrderProduct")
Buy=Split(BuyProId,",")
BuyPro=""
For i=0 to Ubound(Buy)
if instr(OPt,Buy(i))=0 Then
BuyPro=BuyPro&Buy(i)&","
End if
Next
Response.Cookies("OrderProduct")=Request.Cookies("OrderProduct")&BuyPro&","
Elseif D1="TheSort" Then
PID=""
Sql="Select ProductID From Product_Info Where ProductSort="&TheSort
Set Rs = Conn.Execute(Sql)
Do While Not Rs.Eof
PID=PID&Rs("ProductID")&","
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing
Response.Cookies("OrderProduct")=Request.Cookies("OrderProduct")&PID&","
Else
Error 2,"错误的产品信息!",""
End if
Conn.Close
Set Conn = Nothing
response.redirect "SortList.asp?SortId="&TheSort
Response.end
End if
if Request.QueryString("menu") = "SortPsd" Then
SortID=Request.QueryString("SortID")
SortPd=Request.QueryString("pass")
If IsNumEric(SortID)=False Then Error 2,"参数非法传递!",""
If Trim(Conn.Execute("Select SortPWD From Product_Sort where SortID="&SortID)(0)) = SortPd Then
Session(SortID) = SortPd
Response.write "<Script>location.href='SortList.asp?SortID="&SortID&"';</Script>"
Response.end
else
Response.write "<script language=javascript>alert('密码错误!');history.back();</script>"
Response.end
end if
End if
Call top
Call table()
if conn.execute("Select FunctionOC from Functions where FunctionID=29")(0)=True and Request.Cookies("User")="" Then response.redirect "login.asp"
SortID=Request.QueryString("SortID")
If IsNumEric(SortID)=False Then Error 2,"参数非法传递!",""
ProducL=Request.Cookies("Product")
if ProducL="" Then ProducL = 0
SortPwd=Trim(Conn.Execute("Select SortPWD From Product_Sort where SortID="&SortID)(0))
if SortPwd = "vip" and ProducL < 2 Then Error 2,"对不起,此类别产品为VIP专柜!\n您不能进入!",""
if SortPwd <> "vip" and SortPwd <> "" and Session(SortID) <> SortPwd Then %>
<script>var id=prompt("此产品类别已加密,请输入通行密码!","");if(id){window.location.href='SortList.asp?menu=SortPsd&SortID=<%=SortID%>&pass='+id+'';}</script>
<%Response.end
end if%>
<style>
<!--
TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}
.border1 {
border-left:1px solid #A4B6D7; border-right:1px solid #A4B6D7; border-top:1px none #A4B6D7; border-bottom:none none none;
}
-->
</style>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" link="#000000">
<br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b>■ </b><%=Community%><%SortA SortID,""%></td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=25 width="95%" > <img src="images/2.gif" width="60" height="9">该类的下属子类: <%SortSonList SortID,""%></TD>
<TD ><div align="right"><select onChange=MM_jumpMenu('parent.main',this,0)><option selected>其他类产品</option><% Sortlist(conn.execute("Select SortDad from Product_Sort where SortID="&SortID)(0)) %></select></div></TD>
</TR>
</TABLE>
<script>
function VerifyInput(){
if (document.form1.D1.value == ""){
alert("定购选项未选择!");
document.form1.D1.focus();
return false;
}
return true;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
if(selObj.options[selObj.selectedIndex].value!=""){
eval(targ+".location='"+"?Menu=<%=Request("menu")%>&SortID="+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
}
function loadThreadFollow(ino){
var targetDiv =eval("follow" + ino);
if (targetDiv.style.display!='block'){
targetDiv.style.display="block";
}else{
targetDiv.style.display="none";
}
}
</script>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse"><form method="POST" name=form1 onsubmit="return VerifyInput();">
<TR>
<TD height=25 width="75%"><input name="TheSort" type="hidden" value="<%=SortID%>"> 产品信息: 定购
<select size="1" name="D1">
<option selected>选项</option>
<option value="ThePage">当前网页</option>
<option value="TheSort"><%=conn.execute("Select SortCnName from Product_Sort where SortID="&SortID)(0)%></option>
</select> 所有产品 <input type="submit" value="提交" name="B1">
</TD>
<TD height=25 >
<p align="right"><a href=OrderList.asp?menu=Confirm><img src=images/Confirm.gif border=0><img src=images/shoping.gif border=0 title="您的购物袋中已有<%=BuyNum%>种产品!"></a></TD>
</TR>
</TABLE>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
Sql="Select ProductID,ProductNum,ProductCnName,ProductEnName,ProductImgI,ProductImgII,ProductI,ProductII,ProductIII From Product_Info Where ProductSort="&SortID&" and DelThis=False and ProductConceal=False order by ProductArrange"
rs.open sql,conn,1
if page > rs.pagecount Then page=rs.pagecount
rs.pagesize=20 '设定分页显示条数
page=Cint(Request.QueryString("page"))
if page = "" Then Page=1
if page < 1 then page=1
if page > rs.pagecount Then page=rs.pagecount
num=rs.recordcount
maxpage=rs.pagecount
if not Rs.eof and not Rs.bof Then
i=1
rs.absolutepage=page
do while (not rs.eof) and (i<rs.pagesize)
Response.Write "<table border=0 cellpadding=0 cellspacing=4 style=border-collapse: collapse width=100% class=border1><tr>"
For i=i to i+4
if rs("ProductImgI") <> "" then
shuchu "S",rs("ProductImgI"),2
elseif rs("ProductImgII") <> "" then
shuchu "B",rs("ProductImgII"),2
else
shuchu "","",3
end if
rs.MoveNext
if rs.EOF Then Exit For
Next
Response.Write "<tr></table>"
loop
end if
Rs.close
Set Rs = Nothing
%>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="6" width="100%" border="1" style="border-collapse: collapse" height="7">
<tr height="1">
<td>
</td>
</tr></form>
</table>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="6" width="100%" border="1" style="border-collapse: collapse" height="7">
<form><tr height="25">
<td>页码:此类共有<%=num%>个产品,共有<%=maxpage%>页, 当前在<%=page%>页 跳转到第 <input type="text" name="pagel" size="2" maxlength=3 value=<%=page%>> 页 <input name="go" type="button" value="GO!" Onclick=javascript:location.href='?SortID=<%=SortId%>&page='+form.pagel.value;>
</td>
<td><p align="right">
<%
if page <> 1 then
response.write "<a href=?SortID="&SortID&"&page=1>第一页</a></font> "&_
"<a href=?SortID="&SortID&"&page="&(page-1)&">上一页</a></font> "
end if
if page<>maxpage then
response.write "<a href=?SortID="&SortID&"&page="&(page+1)&">下一页</a> "&_
"<a href=?SortID="&SortID&"&page="&maxpage&">最后一页</a>"
end if
%>
</td></tr></form></table><br>
<%
Online
htmlend()
sub shuchu(bas,img,lis)
Select case lis
case 2
Response.Write "<td width=20% ><center><input type=hidden name=BuyProId value="&rs("ProductID")&">货号:"&rs("ProductNum")&"<br><a style='cursor:hand;' title=点击查看"&rs("ProductCnName")&"详细介绍 onclick=javascript:location.href='ShowProDuct.asp?ProId="&rs("ProductID")&"';><img src=UpProductimg/"&bas&"/"&img&" width=80 height=80 border=1 ></a><br><br>"&rs("ProductCnName")&"<br>"
if Application(registered&"ProductI")<>"" then Response.Write "<strike>"& Application(registered&"ProductI")&":"&FormatCurrency(rs("ProductI"))&"</strike><br>"
if Application(registered&"ProductII")<>"" then Response.Write Application(registered&"ProductII")&":"&FormatCurrency(rs("ProductII"))&"<br>"
if Application(registered&"ProductIII")<>"" then Response.Write "<font color=#ff9966>"&Application(registered&"ProductIII")&":"&FormatCurrency(rs("ProductIII"))&"</font><br>"
Response.Write "<a href=ShowProDuct.asp?ProId="&rs("ProductID")&"><font color=#A4B6D7>[详细介绍]</a></font><br> <a style='cursor:hand;' title=点击订购"&rs("ProductCnName")&" style='cursor:hand;' onclick=javascript:open('OrderList.asp?menu=AddPro&ProID="&rs("ProductID")&"&ProCName="&rs("ProductCnName")&"','','width=400,height=150')><img src=images/nico_01.gif border=0>订购</a> <hr width=80% color=#A4B6D7 SIZE=1></center></td>"
case 3
Response.Write "<td width=20% ><center>货号:"&rs("ProductNum")&"<br><a style='cursor:hand;' title=点击查看"&rs("ProductCnName")&"详细介绍 onclick=javascript:location.href='ShowProDuct.asp?ProID="&rs("ProductID")&"';><img src=images/none.gif width=80 height=80 border=1 ></a><br><br>"&rs("ProductCnName")&"<br>"
if Application(registered&"ProductI")<>"" then Response.Write "<strike>"&Application(registered&"ProductI")&":"&FormatCurrency(rs("ProductI"))&"</strike><br>"
if Application(registered&"ProductII")<>"" then Response.Write Application(registered&"ProductII")&":"&FormatCurrency(rs("ProductII"))&"<br>"
if Application(registered&"ProductIII")<>"" then Response.Write "<font color=#ff9966>"&Application(registered&"ProductIII")&":"&FormatCurrency(rs("ProductIII"))&"</font><br>"
Response.Write "<a href=ShowProDuct.asp?ProId="&rs("ProductID")&"><font color=#A4B6D7>[详细介绍]</font></a><br><img src=images/nico_01.gif> <a title=点击订购"&rs("ProductCnName")&" style='cursor:hand;' onclick=javascript:open('OrderList.asp?menu=AddPro&ProID="&rs("ProductID")&"&ProCName="&rs("ProductCnName")&"','','width=400,height=150')>订购</a> <hr width=80% color=#A4B6D7 SIZE=1><center></td>"
End Select
end sub
Sub Sortlist(SortDadid)
Sql="Select SortID,SortCnName From Product_Sort where SortDad="&SortDadid
Set Rs1 = Conn.Execute(sql)
Do While Not Rs1.Eof
Response.write "<option value="&rs1("SortID")&">"&rs1("SortCnName")&"</option>"
Rs1.Movenext
Loop
Rs1.Close
End Sub
Sub SortSonList(Sorid,SortN)
Dim Sql,rs
Sql="Select SortID,SortCnName From Product_Sort where SortDad="&Sorid
Set rs = Conn.Execute(Sql)
do while not rs.eof
SortN=SortN&"<a href=?SortId="&Rs("SortID")&">"&Rs("SortCnName")&"</a> | "
rs.movenext
loop
Rs.Close
Response.write SortN
Set Rs = Nothing
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -