📄 sold.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--销售排行</title>
<!--#include file="include/header.asp"-->
<TABLE WIDTH="760" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER">
<tr>
<td colspan="2" bgcolor="<% = bgclr1 %>" height="20"><font color="#FFFFFF"> 您的位置:首 页>>销售排行</font></td>
</tr>
<TR>
<TD HEIGHT="200" VALIGN="TOP" BGCOLOR=<%=bgclr3%>>
<%
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
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 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="2" CELLSPACING="2">
<TR>
<TD WIDTH="20%" ROWSPAN="7" 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"))%> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/emptybook.jpg border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% end if %>
</TD></TR>
</TABLE></TD>
<TD COLSPAN="4"><%=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="3"><%=trim(rs("intro"))%><%=trim(rs("introduce"))%></TD>
</TR>
<TR>
<TD width="20%"><%=trim(rs("predate"))%><%=trim(rs("productdate"))%></TD>
<TD width="20%">浏览次数:<%=trim(rs("viewnum"))%></TD>
<TD width="20%"><%=trim(rs("pretype"))%><%=trim(rs("type"))%></TD>
<TD width="20%"><%=trim(rs("other"))%><%=trim(rs("grade"))%></TD>
</TR>
<TR>
<TD><%=trim(rs("price"))%><%=rs("price1")%>元</TD>
<TD>会 员 价:<font color="#FF0000"><%=rs("price2")%>元</font></TD>
<TD>折 扣:<%=rs("discount")*100&"%"%></TD>
<TD>节 省:<font color="#FF0000"><%=rs("price1")-rs("price2")%></font>元</TD>
</TR>
<tr>
<td COLSPAN="4" height="5"></td>
</tr>
<tr>
<TD></TD>
<TD><a href=# onClick="javascript:window.open('cart.asp?id=<% = rs("id") %>','','width=630,height=350,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><a href=# onClick="javascript:window.open('addto.asp?id=<% = rs("id") %>&action=add','','width=630,height=350,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>
<TD></TD>
</TR>
</TABLE>
<HR WIDTH="100%" SIZE="1" COLOR=#999999>
<%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 %>
<form method=Post action=<%=filename%>>
<p align="center">
<%
If CurrentPage<2 Then %>
首 页 上一页
<% Else %>
<a href=<% = filename %>?page=1>首 页</a>
<a href=<% = filename %>?page=<% = CurrentPage-1 %>>上一页</a>
<% End If
If n-currentpage<1 Then %>
下一页 末 页
<% Else %>
<a href=<% = filename %>?page=<% = (CurrentPage+1) %>>下一页</a>
<a href=<% = filename %>?page=<% = n %>>末 页</a>
<% End If %>
第 <b><% = CurrentPage %></b> 页 共 <b><% = n %></b> 页
共 <b><% = totalnumber %></b> 件商品 每页 <b><% = maxperpage %></b> 件商品
转到第:<input type='text' name='page' size=2 maxlength=10 class=smallInput value=<% = currentpage %>>
页<input type='submit' class='contents' value='跳转' name='cndok'></form>
<%
End Function
%>
</TD>
</TR>
</TABLE>
<!--#include file="include/footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -