?? class.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
dim sortsid,i,strsql,strcat,strsorts,catid
sortsid=request.querystring("nid")
catid = request.QueryString("aid")%>
<title><%=webname%>--商品分類</title>
<!--#include file="include/header.asp"-->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0"><br><br>
<% set rs = server.CreateObject("adodb.recordset")
rs.open "select category from category where categoryid="&catid&" ",conn,1,1
strcat = rs("category")
rs.close
rs.open "select sorts from sorts where sortsid="&sortsid&" ",conn,1,1
strsorts = rs("sorts")
rs.close
set rs = nothing
%>
<tr> <td width="1" bgcolor="#CCCCCC"><img src="images/linebg.gif" width="1" height="6"></td>
<td width="200" valign="top"> <table width="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="200" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td valign="top"><a href="profile.asp?action=addtocart"> </a>
<TABLE width="200" BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="#FFFFFF">
<tr
>
<td height="26" background="images/skin/default/hot_.gif">
<div align="center"><strong>商 品 搜 索</strong></div></td>
</tr>
<tr
>
<form name="searchform" method="post" action="research.asp" >
<td width="250" height="70">
<select name="select" id="select">
<option value="1">按商品名稱查詢</option>
<option value="2">按商品品牌查詢</option>
<option value="3">按商品類別查詢</option>
</select> <br> <input name="searchkey2" type="text" size="10" value="關鍵字" onFocus="this.value=''">
<input type="submit" name="Submit22" value="查詢" onClick="return check();" >
<br> <a href="search.asp"> 詳細查詢</a>
</td>
</form>
</tr>
</TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>商
品 小 類</strong></div></td>
</tr>
</table>
<!--#include file="include/cat_.asp" -->
<br> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>商
品 分 類</strong></div></td>
</tr>
</table>
<div align="center"><br>
<!--#include file="include/pronav.asp" -->
<br>
<!--#include file="include/catdis.asp"-->
<!--#include file="include/catsold.asp"-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" background="images/skin/default/hot_.gif"><div align="center"><strong>推
薦 購 買</strong></div></td>
</tr>
</table>
<br>
<A HREF=<%=zuo3url%> TARGET="_blank"><IMG SRC=<%=zuo1%> BORDER="0" WIDTH="190"></A><A HREF=<%=zuo2url%> TARGET="_blank"><br>
<IMG SRC=<%=zuo2%> BORDER="0" WIDTH="190"></A><A HREF=<%=zuo3url%> TARGET="_blank"><br>
<IMG SRC=<%=zuo3%> BORDER="0" WIDTH="190"></A><br>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="1" bgcolor="#CCCCCC"><img src="images/skin/default/linebg.gif" width="1" height="6"></td>
<td valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="95%" align="center">
<tr>
<td width="4%" height="51" align="center" valign="middle"><img src="images/skin/default/index7.gif" width="14" height="10"></td>
<td width="96%" valign="middle"><font color="#000000"><%=webname%>>>><%=strcat %>>>><%=strsorts %></font></td>
</tr>
<tr>
<td colspan="2" valign="top"><table height=1 cellspacing=0 cellpadding=0 width=550
align=center bgcolor=#b8b8b9 border=0 valign="top">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top"> </td>
</tr>
<tr>
<td colspan="2" valign="top">
<%
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
if sortsid="" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,pic,prename,name,company,mark,pretype,type,intro,introduce,predate,productdate,viewnum,other,grade,price1,price2,discount from product where isfb=0 order by adddate desc",conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,pic,prename,name,company,mark,pretype,type,intro,introduce,predate,productdate,viewnum,other,grade,price1,price2,discount from product where isfb=0 and sortsid="&sortsid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "數據庫中暫時無數據"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 對不起,此分類暫時還沒有商品!</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"class.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"class.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"class.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<% do while not rs.eof%>
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td width="28%" valign="middle" align="center"><TABLE WIDTH="90" HEIGHT="96" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#cccccc">
<TR>
<TD WIDTH="90" BGCOLOR="#FFFFFF" align="center"> <a href=product.asp?id=<% = rs("id") %> target="_blank">
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic"))%> width="<% = webimg9 %>" height="<% = webimg10 %>" border=0 ></a>
<% else %>
<img src=images/emptybook.jpg border=0>
<% end if %>
</TD>
</TR>
</TABLE></td>
<td width="72%"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td colspan="3">
<% = trim(rs("prename")) %>
<a href=product.asp?id=<%=rs("id")%>><font color="#FF0000"><%=trim(rs("name"))%></font></a></td>
</tr>
<tr>
<td> <%=trim(rs("company"))%><%=trim(rs("mark"))%></td>
<td colspan="2"><%=trim(rs("pretype"))%><%=trim(rs("type"))%></td>
</tr>
<tr>
<td width="41%">市場價:<s>¥<%=rs("price1")%>元</s></td>
<td width="32%">會 員 價:<font color="#FF0000">¥</font><font color=red><%=rs("price2")%>元</font></td>
<td width="27%">折扣:<%=rs("discount")*10%>折</td>
</tr>
<tr>
<td> <a href=# onClick="javascript:window.open('cart.asp?id=<% = rs("id") %>','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/cart.gif width=50 height=19 align=absmiddle border=0></a>
</td>
<td colspan="2"><a href=# onClick="javascript:window.open('addto.asp?id=<% = rs("id") %>&action=add','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/addto.gif width=50 height=19 align=absmiddle border=0></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3" colspan="2"> <table height=1 cellspacing=0 cellpadding=0 width=500
align=center bgcolor=#f2f2f2 border=0 valign="top">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<%
i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If %>
<form method=Post action= <% = filename %>?nid=<% = sortsid %>&aid=<% = catid %>>
<p align='center'>
<%
If CurrentPage<2 Then %>
首 頁 上一頁
<%
Else %>
<a href=<% = filename %>?page=1&nid=<% = sortsid %>&aid=<% = catid %>>首
頁</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&nid=<% = sortsid %>&aid=<% = catid %>>上一頁</a>
<%
End If
If n-currentpage<1 Then %>
下一頁 末 頁
<%
Else %>
<a href=<% = filename %>?page=<% = (CurrentPage+1) %>&nid=<% = sortsid %>&aid=<% = catid %>>下一頁</a>
<a href=<% = filename %>?page=<% = n %>&nid=<% = sortsid %>&aid=<% = catid %>>末
頁</a>
<%
End If %>
第 <b>
<% = CurrentPage %>
</b> 頁 共 <b>
<% = n %>
</b> 頁 共 <b>
<% = totalnumber %>
</b> 件商品 轉到第:
<input type='text' name='page' size=2 maxlength=20 class=smallInput value=<% = currentpage %>>
頁
<input type='submit' class='contents' value='跳轉' name='cndok'>
</form>
<%
End Function
%>
</td>
</tr>
</table></td>
<td width="1" bgcolor="#CCCCCC"><img src="images/linebg.gif" width="1" height="6"></td>
</tr>
</table>
<!--#include file="include/footer.asp"-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -