?? productclass2.asp
字號:
<div align="center">
<center>
<table width="170" height="147" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#ffcc39" height="17" valign="bottom"> <p align="center"><b><font color="#FFFFFF">商 品 分 類</font></b>
</td>
</tr>
<tr>
<td height="3"> </td>
</tr>
<tr>
<td height="250" valign="top" >
<%
set rs_class_1=server.createobject("adodb.recordset")
sqltext2="select * from Class_1 "
rs_class_1.open sqltext2,conn,1,1
While Not rs_class_1.EOF
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td>
<%
set rs_p2=server.createobject("adodb.recordset")
sqltext3="select * from Class_2 where Class_1_Name='" & rs_class_1("Class_1_Name") & "'"
rs_p2.open sqltext3,conn,1,1
%>
<%=rs_class_1("Class_1_Name")%><br>
<%While Not rs_p2.EOF%>
<a href="ProductClass.asp?ProductClass_1=<%=rs_class_1("Class_1_Name")%>&ProductClass_2=<%=rs_p2("Class_2_Name")%>"><%=rs_p2("Class_2_Name")%></a>
<%
rs_p2.MoveNext
j=j+1
Wend
rs_p2.close
%>
<table width="153" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="3"></td>
</tr>
<tr>
<td height="1" bgcolor="#EAAF00"></td>
</tr>
<tr>
<td height="3"></td>
</tr>
</table></td>
</tr>
</table>
<%
rs_class_1.MoveNext
Wend
rs_class_1.close
%>
</td>
</tr>
</table>
</center>
</div></td>
<td width="7" height="62"></td>
<td width="600" height="62" valign="top">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class=main1 height="83" >
<tr>
<td width="15%" height="22" valign="top"><%=ProductClass_1%>===>></td>
<td width="85%" height="22" valign="top">
<%
set rs_class_2=server.createobject("adodb.recordset")
sqltext3="select * from Class_2 where Class_1_Name='" & ProductClass_1 & "'"
rs_class_2.open sqltext3,conn,1,1
do while not rs_class_2.eof%>
<><a href="productclass.asp?ProductClass_1=<%=rs_class_2("Class_1_Name")%>&ProductClass_2=<%=rs_class_2("Class_2_Name")%>"><%=rs_class_2("Class_2_Name")%></a>
<%rs_class_2.movenext
loop
rs_class_2.close
%>
</td>
</tr>
<tr>
<td height="1" colspan="2" valign="middle" bgcolor="#999999"> </td>
</tr>
<tr>
<td height="15" valign="middle" colspan="2"> </td>
</tr>
<tr>
<td height="31" colspan="2"> <div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="148" class=main1>
<tr>
<%
'/////////////////////////////////////////////////////////假如沒有商品時//////////////////
If rs.eof and rs.bof then
response.write "<td><p align='center'><font color='#ff0000'>此類別暫時還沒有商品資料!</font></p></td>"
End if %>
<%
'/////////////////////////////////////顯示帖子的子程序////// ///////////////////////////////////
row_count=1
Sub list()
i=0
Do While Not rs.EOF%>
<td width="160" align="center" valign="top"><a href="<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>" target="_blank"><img src="<%=rs("small_pic")%>" name="small" width="75" height="78" border="0" ></a>
<br>
<a href="<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>"><%=rs("Product_Name")%></a><br>
<font color="#cc0000">銷售商:</font><%=rs("p_shop")%><font color="#cc0000"><br>
會員價:</font><%=rs("P_NewPrice")%>元<br> <a href="javascript:openbag('check.asp?cpbm=<%=rs("Product_Id")%>&shopname=<%=rs("p_shop")%>')"><img style="CURSOR: hand" height="22" src="images/che1.gif" width="56" align="absMiddle" border="0"></a>
<br> <br> </td>
<%if row_count mod 4 =0 then%>
</tr>
<tr>
<%end if%>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.MoveNext
row_count=row_count+1
Loop
end Sub
%>
<%
call list
If Rs.recordcount > MaxPerPage then
call showpages
end if
%>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<table width="778" border="0" cellpadding="0" cellspacing="0" bgcolor="#B8A194">
<tr>
<td height="1"> </td>
</tr>
</table>
</div>
<%
'顯示翻頁的子程序
sub showpages()%>
<table border="0" cellPadding="0" cellSpacing="0" width="96%" >
<form method="POST" action="ProductClass2.asp">
<tr>
<td width="100%" height="28"> </td>
</tr>
<tr>
<td >
<INPUT type=hidden value=<%=ProductClass_1%> name=ProductClass_1>
<table border="0" cellPadding="0" cellSpacing="0" width="100%" height="30">
<tr>
<td> <div align="center"><font color="#000000">
<%
If currentpage > 1 Then
response.write "<a href='ProductClass2.asp?&page="+cstr(1)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><font color='#000000'>首頁</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='ProductClass2.asp?page="+Cstr(currentpage-1)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><font color='#000000'>前頁</font></a><font color='#000000'><b>-</b></font>"
Else
Response.write "<font color='#000000'>首頁-</font>"
Response.write "<font color='#000000'>前頁-</font>"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='ProductClass2.asp?page="+Cstr(currentPage+1)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><font color='#000000'>后頁</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='ProductClass2.asp?page="+Cstr(Rs.PageCount)+"&ProductClass_1="+Cstr(ProductClass_1)+"'><font color='#000000'>尾頁</font></a> "
Else
Response.write "<font color='#000000'>后頁-</font>"
Response.write "<font color='#000000'>尾頁</font> "
End if
Response.write "<font color='#000000'>頁次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> "
Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>種商品/頁 " & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>種商品</font> "
response.write "<font color='#000000' class=main1> 轉(zhuǎn)到第</font><input type='text' name='page' size=2 maxlength=3 class=smallInput value="&Currentpage&">頁 "
response.write "<input class=buttonface type='submit' value='Go' name='cndok' style='background-color: #E6E4C4'></span> "
%>
</font> </div></td>
</tr>
</table>
</td></tr>
</form>
</table>
<%end sub%>
<!--#include file="bottom.asp" -->
</body>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -