📄 productbase.asp
字号:
<%
'=================================================
'过程名:ShowNewProductPreview
'作 用:预览最新手机
'参 数:
' ShowType, ProductType, KeyWord, CurPage
'分别表示: 显示类型:Top/All,类型ID,过滤关键字,当前页
'=================================================
Sub ShowNewProductPreview(ShowType, ProductType, KeyWord, CurPage)
%>
<TABLE cellSpacing = 0 cellPadding = 0 width = "100%" bgColor = #ffffff border = "0" style = "border-collapse: collapse" bordercolor = "#111111" ID = "Table22">
<TBODY>
<TR>
<TD class = "tabTitle" height = "22" bgColor=<%=conTitleColor%>><b>新品快递</b></TD></TR>
<TR>
<TD bgcolor = "<%=conBackColor%>">
<% call ShowNewProductPreviewList(ShowType, ProductType, KeyWord, CurPage) %>
</TD>
</TR>
<TR>
<TD align = middle bgcolor = "<%=conBackColor%>">
</TD></TR>
</TBODY>
</TABLE>
<%
end sub
'=================================================
'过程名:ShowNewProductPreviewList
'作 用:预览最新手机数据(无修饰)
'参 数:
' ShowType, ProductType, KeyWord, CurPage
'分别表示: 显示类型:Top/All,类型ID,过滤关键字,当前页
'=================================================
Sub ShowNewProductPreviewList(ShowType, ProductType, KeyWord, CurPage)
dim page, PageCount, TotalCount
dim thisUrl
dim strSrc,strTemp
dim strSQL, rsObj
dim num_row '每行显示的产品个数
dim rows '显示的产品行数
dim nMaxPerPage
dim nImageHeight
const conBaseImageHeight = 90
dim i, j, k
dim szProductName
num_row = 2 '每行放置的产品数
rows = 6 '放置的产品行数
nMaxPerPage = num_row * rows
nImageHeight = conBaseImageHeight - 15 * (num_row - 1)
Session("oldUrl") = thisUrl & "&page = " & CurPage
if ShowType = "Top" then
strSQL = "SELECT top 10 * FROM product WHERE Recommend >-1 ORDER by id desc"
nMaxPerPage = 10
elseif ShowType = "All" then
thisUrl = "product.asp?ProductType=" & ProductType & "&Keyword = " & KeyWord
strSQL = "SELECT * FROM product WHERE id>1 "
if not (KeyWord = "" or IsEmpty(KeyWord) ) then
strSQL = strSQL & " AND name like '%"&KeyWord&"%'"
end if
if ProductType > 0 then
strSQL = strSQL & " AND ProductType = " & ProductType
end if
strSQL = strSQL & " ORDER by id desc"
end if
set rsObj = conn.execute (strSQL)
rsObj.pagesize = nMaxPerPage
if (CurPage = "" or IsEmpty(CurPage)) then CurPage = 1
if not (rsObj.eof or err) then rsObj.move (CurPage-1) * nMaxPerPage
page = CurPage
PageCount = rsObj.pageCount
TotalCount = rsObj.recordCount
Response.Write "<table width = '100%' border = '0' cellspacing = '0' cellpadding = '0'>"
j = 1
do while not (rsObj.eof or err)
if (j mod num_row) = 1 then
strTemp = "<tr><td colspan = '" & (num_row*2-1) & "' height = 1> <IMG height = 1 src = 'images/spacer.gif' width = 1></td></tr>"
strTemp = strTemp & "<tr>"
Response.Write strTemp
end if
Response.Write "<td width = '" & (100/num_row) & "%' align = center>"
if rsObj("smallImg") = "nothing" then
strSrc = "images/noSmallImg.gif"
else
strSrc = "smallimg/"&rsObj("smallImg")
end if
if not (KeyWord = "" or IsEmpty(KeyWord) ) then
szProductName = Replace(rsObj("name"), KeyWord, "<font color = red>" & KeyWord & "</font>")
else
szProductName = rsObj("name")
end if
%>
<!-- 此table用来输出一个商品元素-->
<table width = "98%" border = "0" cellspacing = "0" cellpadding = "5" align = "center" ID = "Table25">
<tr>
<td width = 100>
<div align = "center"><a href = "ProductDetail.asp?id=<%=rsObj("id")%>" title = "点击查看具体信息">
<img src = "<%=strSrc%>" border = 0 height = "<%=nImageHeight%>"></a></div>
</td>
<td width = "200" valign = top><a href = "ProductDetail.asp?id=<%=rsObj("id")%>" title = "点击查看具体信息"><b><u><%=szProductName%></u></b></a>
<br>
<strike><font color = "#666666">市场价: <%=rsObj("marketPrice")%> 元</font></strike><br>
商城价: <%=rsObj("memberPrice")%> 元<br>
<a href = "shopCart.asp?productID=<%=rsObj("id")%>"><img src = "images/cart.gif" width = "22" height = "22" border = 0 align = "absmiddle"> 放入购物车</a>
</td>
<%
if num_row = 1 then
Response.Write "<td valign=bottom align=center>"
Response.Write "【<A href=""javascript:window.scroll(0,-360)"">顶部】"
Response.Write "</td>"
end if
%>
</tr>
</table>
<%
Response.Write "</td>"
'根据一行是否结否来输出换行符以及插入一行分隔线
if (j mod num_row) = 0 then
Response.Write "</tr>"
%>
<!-- 这段tr是用来输出一行的分隔线 -->
<tr>
<td colspan = "<%=(num_row*2-1)%>">
<TABLE align = center background = "images/global.gif" border = 0 cellPadding = 0 cellSpacing = 0 width = "100%" ID = "Table13">
<TBODY>
<TR>
<TD><IMG height = 1 src = "images/spacer.gif" width = 1></TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<%
else '如果没有结束,插一个竖的分隔线
Response.Write "<TD background = 'images/point.gif' width = 1>"
Response.Write "<IMG height = 1 src = 'images/spacer.gif' width = 1></TD>"
end if
j = j+1
if j>nMaxPerPage then exit do
rsObj.MoveNext
loop
'处理最后的空行
k = (j-1) mod num_row
if not (k = 0) then
Response.Write "<td colspan = "&(num_row-k)&" width = "&(cint(100/num_row)*(num_row-k))&"> </td>"
Response.Write "</tr>"
end if
Response.Write "</table>"
end sub
'=================================================
'过程名:ShowProduct
'作 用:显示手机详细信息
'参 数:无
'=================================================
sub ShowProduct(ProductId)
dim strSQL, rsObj
if IsEmpty(ProductId) then ProductId = 0
strSQL = "SELECT * FROM product WHERE id = " & ProductId
set rsObj = conn.execute (strSQL)
if not (rsObj.eof or err) then
%>
<table width = "94%" border = "0" bordercolordark = #ffffff bordercolorlight = #FFCF00 cellspacing = "0" cellpadding = "8" align = "center" ID = "Table10">
<tr>
<td width = "180" valign = "top">
<div align = "center">
<a target = "_blank" href = "bigimg/<%=rsObj("smallImg")%>">
<img src = "<% if rsObj("bigImg") = "nothing" then Response.Write "images/noBigImg.gif" else Response.Write "bigimg/"&rsObj("smallImg") end if%>" width=<%=conBigImagewWidth%> border = "0" alt = "点击放大查看"></a><br>
<br>
</div>
</td>
<td valign = "top"> <b class = "Font_10_5"><%=rsObj("name")%></b> (图片仅供参考)<br>
<br>
<strike>市场价: <%=rsObj("marketPrice")%> 元</strike><br>
商城价: <%=rsObj("memberPrice")%>元<br>
立即节省: <font color = RED><%=rsObj("marketPrice")-rsObj("memberPrice")%></font>
元<br>
<br>
<a href = "shopCart.asp?productID=<%=rsObj("id")%>"><img src = "images/cart.gif" width = "22" height = "22" border = "0" align = "absmiddle"> 放入购物车</a>
</td>
</tr>
</table>
<table width = "94%" border = "0" cellspacing = "0" cellpadding = "4" align = "center" ID = "Table11">
<tr>
<td><img src = "images/cha1.gif" width = "12" height = "12">产品介绍:</td>
</tr>
</table>
<table align = center background = "images/global.gif" border = 0 cellpadding = 0 cellspacing = 0 width = "92%" ID = "Table12">
<tbody>
<tr>
<td><img height = 1 src = "images/spacer.gif" width = 1></td>
</tr>
</tbody>
</table>
<table width = "94%" border = "0" cellspacing = "0" cellpadding = "4" align = "center" ID = "Table14">
<tr>
<td><p><%=convert(rsObj("introduce"))%></p></td>
</tr>
</table>
<br>
<table width = "94%" border = "0" cellspacing = "0" cellpadding = "4" align = "center" ID = "Table15">
<tr>
<td><img src = "images/cha1.gif" width = "12" height = "12">其他说明:</td>
</tr>
</table>
<table align = center background = "images/global.gif" border = 0 cellpadding = 0 cellspacing = 0 width = "92%" ID = "Table16">
<tbody>
<tr>
<td><img height = 1 src = "images/spacer.gif" width = 1></td>
</tr>
</tbody>
</table>
<table width = "94%" border = "0" cellspacing = "0" cellpadding = "4" align = "center" ID = "Table17">
<tr>
<td><%=convert(rsObj("Remark"))%></td>
</tr>
</table>
<br>
<p align = "center"><a href = "Javascript:window.history.go(-1)">返回</a> <font face = "Wingdings 3">`</font>
</p>
<%
'修改点击率+1
dim nID
nID = RealString(Request.QueryString("id"))
strSQL = "Update product set hitNum = hitNum+1 WHERE id = " & nID
conn.execute (strSQL)
end if
set rsObj = nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -