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

📄 class.asp

📁 网上购物系统 asp+sql server 2005
💻 ASP
字号:
<script language=javascript src=include/pic2.js></script>
<!--#include file="include/dbopenbd.asp" -->
<%

Page=request("page")
If not isNumeric(page) then
response.redirect "main.asp"
response.end
end if
pagecount=page

SubLar=aspsql(request("LarCode"))
SubMid=aspsql(request("MidCode"))
action=aspsql(request("action"))

if action="hot" and page<=1 then
conn.execute ("update s_produc set ClickTimes=ClickTimes-1 where ClickTimes="&conn.execute ("select max(ClickTimes) as maxc from s_produc where online='1'")("maxc"))
end if

sqlprod="select * from s_produc where online='1'"
if SubLar<>"" then sqlprod = sqlprod + "and LarCode='"&SubLar&"'"
if SubMid<>"" then sqlprod = sqlprod + "and MidCode='"&SubMid&"'"

if action="tuijian" then 
title="精品推荐"
sqlprod = sqlprod + " and  Remark='1' order by Tjdate desc,AddDate desc,ClickTimes desc"
elseif action="new" then 
title="最新商品"
sqlprod = sqlprod + " order by AddDate desc,LarCode desc,MidCode desc"
elseif action="tejia" then 
title="特价商品"
sqlprod = sqlprod + " and tejia='1' order by AddDate desc,ClickTimes desc"
elseif action="hot" then
title="热门排行"
sqlprod = sqlprod + " order by ClickTimes desc"
else
title=SubLar &"-"& Submid
sqlprod = sqlprod + "order by LarCode,MidCode,AddDate desc"
end if

%>
<html><head>
<title><%=title%>-<%=sitename%>-<%=siteurl%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitename%>,<%=title%>">
<meta name="keywords" content="<%=sitename%>,<%=title%>">
<link rel="stylesheet" href="include/css.css" type="text/css">
<style type=text/css>
.pic1{MARGIN-TOP: -135px;MARGIN-left:0px}
.pic2{padding-top:6px}
</style>
</head>
<center>
  <!--#include file="a_top.asp"-->
 <TABLE width=760 border=0 cellpadding=0 cellspacing=0 align=center bgcolor=#ffffff class="grayline">
  <TR><td bgcolor="FFFBF7" align="center" valign="top" width="185">
        <!--#include file="a_login.asp"-->
        <!--#include file="a_tree.asp"-->
  </TD>
  <td bgcolor="#CCCCCC" width="1"></td>
  <td valign="top" align="center" bgcolor="#FFFFFF" width=574>
        <table width="90%" border="0" cellspacing="0" cellpadding="0"><tr><td height=8></td></tr></table>
<%
Set rsprod=Server.CreateObject("ADODB.RecordSet") 
rsprod.open sqlprod,conn,1,1
n=0
if rsprod.bof and rsprod.eof then
response.write "<table><tr><td height=100 align=center>对不起,没有相关商品</td></tr></TABLE>"
else
%>

<table width="99%" border="0" align="center" cellpadding=2 cellspacing=1 bgcolor="#fefefe">
<tr><td>目前位置:<a href=main.asp>首页</a> > 
<% if sublar<>"" then%>
<a href='class.asp?LarCode=<%=server.URLEncode(sublar)%>'><%=sublar%></a> 
<%if submid<>"" then%>
 > <a href="class.asp?LarCode=<%=server.URLEncode(sublar)%>&MidCode=<%=server.URLEncode(submid)%>"><%=submid%></a>
<%
end if
else
response.write title
end if
%>
</td></tr>

<%
pages=fenlei_num
rsprod.pagesize=fenlei_num
allPages = rsprod.pageCount	'总页数
If not isNumeric(page) then page=1
if isEmpty(page) or clng(page) < 1 then
page = 1
elseif clng(page) >= allPages then
page = allPages 
end if
rsprod.AbsolutePage=page
Do While Not rsprod.eof	and pages>0
%> 

<tr><td width="570">
	<table border=0 width=100% bgcolor=cccccc cellpadding=0 cellspacing=1>
	<tr><td valign=top width=190  bgcolor=FFFFFF align=center>
	<table border=0 width=100%><tr><td class="pic2" align=center valign=bottom>
	<img border=0 src=images/small/pic_bg_big<%=pic_xiaogao%>.gif><p class="pic1">
	<a href=list.asp?ProdId=<%=rsprod("ProdId")%>>
	<img border=0 alt='<table border=0 width=300><tr><td width=70><b><%=rsprod("ProdNametext")%></b>:</td><td><%=rsprod("ProdName")%></td></tr><tr><td width=70><b>商品类别</b>:</td><td><%=rsprod("larcode")%></td></tr><td width=70><b><%=rsprod("ProdIdtext")%></b>:</td><td><%=rsprod("ProdId")%></td></tr><tr><td><b>浏览次数</b>:</td><td><%=rsprod("ClickTimes")%></td></tr><tr><td><b>商品简介</b>:</td><td><%=rsprod("ProdDisc")%></td></tr></table>' onload='DrawImage(this)' src="<%=rsprod("ImgPrev")%>"></a>
	</td></tr></table>
	</td>
	<td valign=top width=368 bgcolor=ffffff>
	<table border=0 width=100% style="table-layout:fixed;word-break:break-all">
	<TR><TD height=20 width=80>【<%=rsprod("ProdNametext")%>】</td><td colspan=4> <%=lleft(rsprod("ProdName"),40)%></TD></TR>
	<TR><TD height=20>【<%=rsprod("prodidtext")%>】</td><td colspan=4> <%=rsprod("prodid")%></TD></TR>
<%
if rsprod("Modeltext")<>"" and rsprod("Model")<>"" then response.write "<TR><TD height=20>【"&rsprod("modeltext")&"】</td><td colspan=4> "&rsprod("model")&"</TD></TR>"
if rsprod("Prodtext1")<>"" and rsprod("Prod1")<>"" then response.write "<TR><TD height=20>【"&rsprod("Prodtext1")&"】</td><td colspan=4> "&rsprod("Prod1")&"</TD></TR>"
if rsprod("prodtext2")<>"" and rsprod("prod2")<>"" then response.write "<TR><TD height=20>【"&rsprod("prodtext2")&"】</td><td colspan=4> "&rsprod("prod2")&"</TD></TR>"
%>
<tr><td valign=middle width=80>【商品价格】</td>
<td valign=bottom align=center width=90><%=FormatNum(rsprod("PriceList"),2)%><br><img border=0 src=images/small/price2.gif><br><%=rsprod("PriceListtext")%></td>
<td valign=bottom align=center width=90>
<%	if request.cookies("buyok")("userid")="" then 
	response.write "<b><font color=red>"&huiyuanjia&"</b></font><br>"
	else
	response.write "<b><font color=red>"&FormatNum(rsprod("PriceOrigin"),2)&"</font></b><br>"
	end if
%><img border=0 src=images/small/price3.gif><br><%=rsprod("PriceOrigintext")%></font></td><td> </td></tr>
<%
if rsprod("quantity")=0 then 
	response.write "<TR><TD height=20>【商品备注】</td><td colspan=4> <b><font color=red>"&quehuo&"</font></b></TD></TR>"
elseif rsprod("PriceList")=0 then
	response.write "<TR><TD height=20>【商品备注】</td><td colspan=4> <b><font color=red>"&wujiage&"</font></b></TD></TR>"
end if
%>
<tr><td align=center colspan=5>
<a href=list.asp?ProdId=<%=rsprod("ProdId")%>><img border=0 src=images/small/xiangxi.gif alt=详细了解></a>
<%
if rsprod("quantity")<>0 and rsprod("PriceList")<>0 then%>
<span  style='cursor:hand' onClick="window.open('order/shop.asp?ProdId=<%=rsprod("ProdId")%>','add','scrollbars=yes,resizable=no,width=650,height=450')"><img border=0 src=images/small/buynow.gif alt=千寻万觅,要的就是她></span>
<%else%>
<img border=0 src=images/small/buynow.gif alt=暂时不能购买此商品>
<%end if%>
<span  style='cursor:hand' onClick="window.open('order/fav.asp?ProdId=<%=rsprod("ProdId")%>','add','scrollbars=yes,resizable=no,width=650,height=450')">
<img border=0 src=images/small/favnow.gif alt=好东东,收藏起来先></span>
</td></tr>
</table></td></tr></table>
</td></tr>
<%
pages = pages - 1
rsprod.movenext
if rsprod.eof then exit do
loop
%>
<table width=99% border="0" cellspacing="1" cellpadding="2" align="center" bgcolor=#FFFFFF>

<tr><td height="22" >商品总数<font color=red><%=RSprod.RecordCount%></font>,每页商品数<font color=red><%=fenlei_num%></font> &nbsp;&nbsp;
<%
'翻页函数
mPage "class.asp?action="&action&"&LarCode="&server.URLEncode(SubLar)&"&MidCode="&server.URLEncode(SubMid),page,allpages
%> 
          </td>
        </tr>
</table>

<%
rsprod.close
set rsprod=nothing
%> 
</table>

<%end if%> 
</TD></TR></TABLE>
<!--#include file="a_bottom.asp"-->
</body></center>

</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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