⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showspecialproduct.asp

📁 网上购物源代码
💻 ASP
字号:

<% 

Sub ShowSpecialProduct(strFilter, nCount)
	dim strSpecialText
	if strFilter  =  "Hot" then
		strSpecialText  =  "Hotlist"
	elseif strFilter  =  "Recommended" then
		strSpecialText  =  "Recommendlist"
	elseif strFilter  =  "Cheap" then
		strSpecialText  =  "Cheaplist"
	else
		strFilter  =  "Hot"
		strSpecialText  =  "Hotlist"
	end if
%>

	<TABLE cellSpacing = "0" cellPadding = "0" width = "100%" border = "0" ID = "Table1">
		<TBODY>
			<TR>
				<TD height = "1" background = "images/titlebg.gif" align = center><strong><%=strSpecialText%></strong>
				</TD>
			</TR>
			<TR>
				<TD height = "1"></TD>
			</TR>
			<TR>
				<TD vAlign = "top">
					<table width = "95%" border = "0" align = "center" cellpadding = "0" cellspacing = "0" ID = "Table2">
						<tr>
							<td>
								<% call ShowSpecialProductList(strFilter, nCount) %>
							</td>
						</tr>
					</table>
				</TD>
			</TR>
			<TR>
				<TD height = "3"></TD>
			</TR>
		</TBODY>
	</TABLE>
<%
end sub
Sub ShowSpecialProductList(strFilter, nCount)
	dim strSQL, rsObj, productName, i
	nCount = CInt(nCount)
	if nCount > 20 then nCount = 20
	if nCount < 1 then nCount = 1
	Response.Write "<table width = '100%' border = '0' cellspacing = '0' cellpadding = '0' ID = 'Table3'>"
	if strFilter  =  "Hot" then
		strSQL = "SELECT TOP " & nCount & " ID, [Name] FROM product "
		strSQL = strSQL & " ORDER BY buyNum desc,id desc"
	elseif strFilter  =  "Recommended" then
		strSQL = "SELECT TOP " & nCount & " ID, [Name] FROM product "
		strSQL = strSQL & " ORDER BY recommend desc, recommenddate desc, id desc"	
	elseif strFilter  =  "Cheap" then
		strSQL = "SELECT TOP " & nCount & " ID, [Name], memberPrice/marketPrice AS Discount "
		strSQL = strSQL & "FROM Product WHERE marketPrice <> 0 "
		strSQL = strSQL & " ORDER BY memberPrice/marketPrice, id desc"	
	else
		strSQL = "SELECT TOP " & nCount & " ID, [Name] FROM Product "
		strSQL = strSQL & " ORDER BY buyNum desc,id desc"
	end if
		
	set rsObj = conn.Execute (strSQL)
	
	if rsObj.EOF And rsObj.BOF then
		Response.Write "No number now"
	end if
	i = 1
	
	do while not (rsObj.eof or err)
		Response.Write "<tr><td height  =  23>"
		Response.Write "<img src = images/cha1.gif>"
		
	
		if strFilter  =  "Cheap" then
			productName = i & "." & rsObj("name") & "(<font color = red>" & FormatNumber(rsObj("Discount")*10,1) & "</font>discuont)"
		else
			productName = rsObj("name")
			
			if len(productName) > 14 then
				productName  =  left(productName,9)&"..."
			end if
		end if
		Response.Write "<a href = ProductDetail.asp?id=" & rsObj("ID") & ">  " & productName & "</a>"
		Response.Write "</td></tr>"
		i = i+1
		if i>100 then exit do
		rsObj.MoveNext
	loop 
	
	rsObj.Close()
	Set rsObj = Nothing
	Response.Write "</table>"
end sub
Sub ShowTheBest()
	dim strSQL, rsObj
	dim strTemp, strSrc, strIntro
	strSQL = "SELECT top 1 * FROM product "
	strSQL = strSQL & " WHERE Recommend > 0 "
	strSQL = strSQL & " ORDER by RecommendDate DESC, buyNum DESC, ID DESC"
	set rsObj = conn.execute (strSQL)
	if rsObj.EOF and rsObj.BOF then
		Response.Write "<br><br><br><br>"
		rsObj.Close()
		Set rsObj = Nothing
		Exit Sub
	end if	
	if rsObj("bigImg") = "nothing" then
		strSrc  =  "images/noBigImg.gif"
    else
		strSrc  =  "bigImg/"&rsObj("bigImg")
    end if
	strIntro = Convert(rsObj("introduce"))
	if lenB(strIntro)>300 then
		strIntro = leftB(strIntro,300)
	end if
%>
	<table width = "100%" border = "0" bordercolordark = #ffffff bordercolorlight = #FFCF00 cellspacing = "0" cellpadding = "0" align = "center" ID = "Table20">
	<tr>
		<TD class  = "tabTitle" height = "22"  bgColor=<%=conTitleColor%> colspan = 2><b>Newbooks:&nbsp;<marquee direction="right">welcome to Onestar bookshop!(一星欢迎您!)</marquee></b></TD>
	</tr>	
	
	
	</table>
<%
	rsObj.Close()
	set rsObj  =  Nothing
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -