?? sold2.asp
字號:
<title><%=webname%>--銷售排行</title>
<TABLE WIDTH="253" height="98" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="TOP">
<%
Const MaxPerPage=6
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
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,prename,name,company,mark,intro,introduce,predate,productdate,pretype,type,viewnum,price,price1,price2,other,grade,discount,pic from product where iscx=1 and isfb=0 order by solded desc",conn,1,1
if err.number<>0 then
response.write "<p align='center'>數據庫中暫時無數據</p>"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center'> 對不起,目前還沒有這種商品!</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,"sold.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"sold.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"sold.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<TABLE WIDTH="96%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="50%" ROWSPAN="3" align="center">
<TABLE style="LETTER-SPACING: 1px" cellSpacing=0 cellPadding=0
width=112 border=0>
<TBODY>
<TR vAlign=top>
<TD height=112
background=images/skin/default/jingpin_bg.gif style="PADDING-LEFT: 2px; PADDING-TOP: 2px"><a href=product.asp?id=<% = rs("id") %> target="_blank">
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic"))%> BORDER=0 width="<% = webimg9 %>" height="<% = webimg10 %>">
</a>
<% else %>
<img src=images/emptybook.jpg border=0>
<% end if %>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width="43%" height="30" valign="bottom"><a href=product.asp?id=<%=rs("id")%> target=_blank><font color=#FF6600><strong><%=trim(rs("name"))%></strong></font></a></TD>
</TR>
<TR>
<TD valign="middle">市場價:<%=rs("price1")%>元<br>
會員價:<font color="#FF6600"><%=rs("price2")%>元</font><br>
節 省:<%=rs("price1")-rs("price2")%>元</TD>
</TR>
</TABLE>
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing%>
<%
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 %>
<%
End Function
%>
</TD>
</TR>
</TABLE>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -