📄 hot.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--关注排行</title>
<!--#include file="include/header.asp"-->
<TABLE WIDTH="778" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER">
<tr>
<td height="24" colspan="6" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7%" height="51" align="center" valign="middle"><img src="images/skin/default/index7.gif" width="14" height="10"></td>
<td width="46%"><font color="#000000"><a href="index.asp">首 页</a>>>关注排行</font>
</td>
<td width="47%"><TABLE width="334" BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="#FFFFFF">
<tr
>
<form name="searchform" method="post" action="research.asp" >
<td width="319" height="51"> <select name="action" id="select2">
<option value="1">按商品名称查询</option>
<option value="2">按商品品牌查询</option>
<option value="3">按商品类别查询</option>
</select> <input name="searchkey" type="text" size="10" value="关键字" onFocus="this.value=''">
<input type="submit" name="Submit2" value="查询" onClick="return check();" >
</td>
</form>
</tr>
</TABLE></td>
</tr>
</table></td>
</tr>
<TR>
<td bgcolor="#f2f2f2"></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 viewnum 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,"hot.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"hot.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"hot.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"))%> width="<% = webimg9 %>" height="<% = webimg10 %>" border=0 ></a>
<% else %>
<img src=images/emptybook.jpg border=0>
<% 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>
<table height=1 cellspacing=0 cellpadding=0 width=660
align=center bgcolor=#f2f2f2 border=0 valign="top">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</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 %>
<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 + -