📄 discount.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--特价商品</title>
<link href="images/css-1.css" rel="stylesheet" type="text/css">
<!--#include file="include/header.asp"-->
<TABLE width=778 border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=5></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
<TBODY>
<TR>
<TD class=bg3 vAlign=top width=595><TABLE cellSpacing=0 cellPadding=0 width="595" border=0>
<TBODY>
<TR background="images/skin/default/service.gif">
<TD height=25 colspan="2" class=bg2>
<table width="115" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="29" background="images/skin/default/logoo.gif"><div align="center"><FONT COLOR="#FFFFFF"><FONT COLOR="#000000">
<strong><font color="<%=bgclr1%>">商城快讯</font></strong></FONT></FONT></div></td>
</tr>
</table>
</TD>
</TR>
<TR valign="top">
<TD width="1" background="images/skin/login_02.gif"> </TD>
<TD><TABLE WIDTH="590" BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0">
<tr>
<td colspan="2" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="2"> <TABLE WIDTH="590" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" bgcolor="#FFFFFF">
<TR ALIGN="center">
<TD WIDTH="250"><a href="discount.asp?action=12"><img src="images/t12.gif" alt="一至二折区" name="Image12" width="179" height="38" border="0"></a></TD>
<TD WIDTH="250"><A HREF="discount.asp?action=34"><IMG SRC="images/z34.gif" ALT="三至四折区" NAME="Image8" WIDTH="180" HEIGHT="38" BORDER="0"></A></TD>
<TD WIDTH="250"><A HREF="discount.asp?action=56"><IMG SRC="images/z56.gif" ALT="五至六折区" NAME="Image9" WIDTH="180" HEIGHT="38" BORDER="0"></A></TD>
</TR>
</TABLE></td>
</tr>
<TR>
<TD HEIGHT="200" VALIGN="TOP" BGCOLOR=<%=bgclr3%>>
<%dim action
action=request.QueryString("action")
Const MaxPerPage=8
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")
select case action
case ""
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 discount<=1 and isfb=0 and istj=1 order by discount asc",conn,1,1
case "12"
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 discount<=0.20 and isfb=0 and istj=1 order by discount asc",conn,1,1
case "34"
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 discount<=0.40 and discount>0.2 and isfb=0 and istj=1 order by discount asc",conn,1,1
case "56"
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 discount<=0.60 and discount>0.4 and isfb=0 and istj=1 order by discount asc",conn,1,1
case "78"
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 discount<=0.80 and discount>0.6 and isfb=0 and istj=1 order by discount asc",conn,1,1
end select
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,"discount.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"discount.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"discount.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="8" 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/skin/default/emptybook.jpg width="100" height="100" border=0>
<% end if %>
</TD>
</TR>
</TABLE></TD>
<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("intro"))%><%=trim(rs("introduce"))%></TD>
</TR>
<TR>
<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>节 省:<font color="#FF0000"><%=rs("price1")-rs("price2")%></font>元</TD>
</TR>
<tr>
<td COLSPAN="3" height="5"></td>
</tr>
<tr>
<TD colspan="2"><div align="center"><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></div></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>
</TR>
<tr>
<TD colspan="3"></TD>
</TR>
</TABLE>
<table height=1 cellspacing=0 cellpadding=0 width=400
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%>?action=<%=action%>>
<p align="center">
<%
If CurrentPage<2 Then %>
首 页 上一页
<% Else %>
<a href=<% = filename %>?page=1&action= <% = action %>>首
页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&action=<% = action %>>上一页</a>
<% End If
If n-currentpage<1 Then %>
下一页 末 页
<% Else %>
<a href=<% = filename %>?page=<% = (CurrentPage+1) %>&action=<% = action %>>下一页</a>
<a href=<% = filename %>?page=<% = n %>&action=<% = action %>>末
页</a>
<% End If %>
第 <b>
<% = CurrentPage %>
</b> 页 共 <b>
<% = n %>
</b> 页 共 <b>
<% = totalnumber %>
</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></TD>
</TR>
<TR>
<TD height=1 colSpan=2 bgColor=<%=bgclr1%>></TD>
</TR>
<TR>
<TD colSpan=2></TD>
</TR>
</TABLE></TD>
<TD width=183 vAlign=top background=images/skin/default/product_02.gif>
<TABLE cellSpacing=0 cellPadding=0 width=183 border=0>
<TBODY>
<TR>
<TD height="25"><img src="images/skin/default/product_03.gif" width="183" height="25"></TD>
</TR>
<TR>
<TD height=20>
<!--#include file="include/pronav.asp"-->
</TD>
</TR>
</TBODY>
</TABLE>
<div align="center"><br>
</div></TD>
</TR>
<TR bgcolor="<%=bgclr1%>">
<TD height=5 colSpan=2></TD>
</TR>
</TBODY>
</TABLE>
<!--#include file="include/footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -