📄 syscode_shop.asp
字号:
<%
'****************************************************
dim s_id,scat_id
dim founderr,errmsg
dim action,rsCatN,shop_temp
if request.querystring("s_id")<>"" then
if not isInteger(request.querystring("s_id")) then
Response.Redirect "show_error.asp?eid=传值参数非法!"
Response.End
end if
s_id=CLng(request("s_id"))
else
s_id=0
end if
if request.querystring("scat_id")<>"" then
if not isInteger(request.querystring("scat_id")) then
Response.Redirect "show_error.asp?eid=传值参数非法!"
Response.End
end if
scat_id=CLng(request("scat_id"))
start="在线商城 - 商品列表"
else
scat_id=0
start="在线商城 - 商品列表"
end if
if s_id>0 then
sql="select * from shop where passed=0 and s_id="&s_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你要找的商品不存在,或者已经被管理员删除!</li>"
else
if rs("Passed")=1 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你要找的商品尚未被管理员审核!</li>"
else
start="在线商城 - "&rs("s_name")&""
scat_id=CLng(rs("scat_id"))
end if
end if
end if
'=================================================
if FoundErr=True then
Call HxErrMsg()
response.end
end if
'=================================================
'过程名:main_shop
'作 用:显示商城位置导航
'参 数:无
'Web: www.ynsky.com.cn
'=================================================
sub main_shop()
if scat_id>0 then
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a>" & vbCrLf
sql="select * from scat where scat_id="&scat_id
set rs3=conn.execute(sql)
if rs3.eof then
Response.Redirect "show_error.asp?eid=参数错误,找不到相关的记录!"
Response.End
End IF
Response.Write " >> <a href=""shop.asp?action=1&scat_id="&rs3("scat_id")&""">"&rs3("scat_name")&"</a>"
rs3.close
set rs3=nothing
elseif request("t")="best" then
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a> >> 推荐商品" & vbCrLf
elseif request("t")="tj" then
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a> >> 特价商品" & vbCrLf
elseif request("t")="hot" then
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a> >> 热卖商品" & vbCrLf
elseif Request("action")="1" then
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a> >> 全部商品" & vbCrLf
else
Response.Write " 您的位置: <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>在线商城</a> >> 首页" & vbCrLf
end if
end sub
'=================================================
'过程名:list_shop
'作 用:显示产品相关操作内容
'参 数:无
'Web: www.ynsky.com.cn
'=================================================
sub list_shop()
action = Request.QueryString("action")
Select Case action
Case ""
Call index_shop()
Case "1"
Call displayList_shop(20,12)
Case else
Call index_shop()
End Select
End Sub
'=================================================
'过程名:index_shop
'作 用:产品首页
'参 数:无
'Web: www.ynsky.com.cn
'=================================================
sub index_shop()
%>
<table border="0" width="100%" align="center" cellpadding="0" cellspacing="2">
<tr>
<td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1'><font style="color: #F76885"><b>新品上架</b></font></a></td>
</tr>
<TR>
<TD style="padding-left:5px;"><IMG height=2 src="img/sub_spe_sun.gif" width=555></TD>
</TR>
<tr>
<td valign="top"><%call i_shop(4,22,0)%></TD>
</tr>
<tr>
<td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1&t=best'><font style="color: #006666"><b>推荐商品</b></font></a></td>
</tr>
<TR>
<TD style="padding-left:5px;"><IMG height=2 src="img/sub_theme_sun.gif" width=555></TD>
</TR>
<tr>
<td valign="top"><%call i_shop(4,22,1)%></TD>
</tr>
<tr>
<td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1&t=tj'><font style="color: #FF6600"><b>特价商品</b></font></a></td>
</tr>
<TR>
<TD style="padding-left:5px;"><IMG height=2 src="img/sub_chu_sun.gif" width=555></TD>
</TR>
<tr>
<td valign="top"><%call i_shop(4,22,2)%></TD>
</tr>
</TABLE>
<BR>
<%
end sub
'=================================================
'过程名:i_shop
'作 用:产品调用
'参 数:n-调用条数,nn-显示长度
' sclass-----标识属性,0-最新,1-推荐,2-特价,3-热卖
'Web: www.ynsky.com.cn
'=================================================
sub i_shop(n,nn,sclass)
dim nnn
if sclass=0 then
nnn="where passed=0"
elseif sclass=1 then
nnn="where isbest = 1 and passed=0"
elseif sclass=2 then
nnn="where istj = 1 and passed=0"
elseif sclass=3 then
nnn="where ishot = 1 and passed=0"
else
nnn="where passed=0"
end if
Response.Write "<table border=0 cellspacing=0 cellpadding=4 width='100%' align='center'><tr>" & vbCrLf
set rsb=server.createobject("adodb.recordset")
set rsb=conn.execute("SELECT top "&n&" * FROM shop "&nnn&" order by s_id desc")
i=0
do while not rsb.eof
%>
<td width=50% valign=top>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#E7E7E7">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td align="center" valign="top" width="80" style="padding-right:5px">
<a href="shopView.asp?s_id=<%=rsb("s_id")%>" Title='商品名称:<%=rsb("s_name")%>
上架时间:<%=rsb("s_date")%>
购买次数:<%=rsb("s_count")%>'><font color="#666666"><img src="<%=rsb("s_pic")%>" width=75 border=0 align=center vspace=0 hspace=0 style='border-color:#dfdfdf'></font></a></td>
<td valign="top">
<table width="100%" border="0" cellspacing="1" cellpadding="0" height="20">
<tr valign="top">
<td height="20"><a href="shopView.asp?s_id=<%=rsb("s_id")%>"><font color="#000000"><%=gotTopic(rsb("s_name"),nn)%></font></a></td>
</tr>
<tr>
<td><font color="#666666">市场价:<%=FormatNumber(rsb("price_1"),2)%></font></td>
</tr>
<tr>
<td><font color="#006666">会员价:<%=FormatNumber(rsb("price_2"),2)%></font></td>
</tr>
<tr>
<td><font color="#FF6600">VIP 价:<%=FormatNumber(rsb("price_3"),2)%></font></td>
</tr>
<tr valign="bottom">
<td height="20" ><a href="shopView.asp?s_id=<%=rsb("s_id")%>"><img src="img/content2.gif" border="0"></a> <a href="shop_Basket.asp?id=<%=rsb("s_id")%>"><img src="img/cart2.gif" border="0"></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="5" bgcolor="#E7E7E7"></td>
</tr>
</table>
</td>
<%
i=i+1
if i mod 2 = 0 then
Response.Write "</tr><tr>"
end if
rsb.movenext
loop
if rsb.bof and rsb.eof then
Response.Write "<tr><td align='center' valign='middle'>没有商品!</td></tr>"
end if
rsb.close
set rsb=nothing
Response.Write "</TABLE>" & vbCrLf
end sub
'=================================================
'过程名:top_shop
'作 用:销售排行榜
'参 数:n-调用条数,nn-显示长度
' NewWindows-----是否新窗打开,True为是,False为否
'Web: www.ynsky.com.cn
'=================================================
sub top_shop(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set rst=server.createobject("adodb.recordset")
set rst=conn.execute("SELECT top "&n&" * FROM shop where passed=0 ORDER by s_count DESC,s_id DESC")
do while not rst.eof
Response.Write "<tr><td height=25 class=table-xia><font color=#FF0000>·</font><a href='shopView.asp?s_id="&rst("s_id")&"' Title='商品名称:"&rst("s_name")&"
上架时间:"&rst("s_date")&"
购买次数:"&rst("s_count")&"' "& nnn &">"&gotTopic(rst("s_name"),nn)&"</a></td><td height=25 class=table-xia align='right'><font color=#FF6633>"&rst("price_3")&"</font> </td></tr>" & vbCrLf
rst.movenext
loop
if rst.bof and rst.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有商品</td></tr>"
end if
rst.close
set rst=nothing
Response.Write "</TABLE>" & vbCrLf
end sub
'=================================================
'过程名:class_shop
'作 用:产品分类——纵排
'参 数:无
'Web: www.ynsky.com.cn
'=================================================
sub class_shop()
dim i
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
sql="select * from scat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<tr><td height=26>" & vbCrLf
if request("scat_id")=cstr(rs1("scat_id")) then
response.write "<font color=""#FF0000"">·"&rs1("scat_name")&"</font>" & vbCrLf
else
response.write "<font color=""#FF0000"">·</font><a href='?action=1&scat_id="&rs1("scat_id")&"'>"&rs1("scat_name")&"</a>" & vbCrLf
end if
response.write "</td><td> </td></tr><tr>" & vbCrLf
sql="select * from scat where sid="&rs1("scat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
i=0
do while not rs2.eof
response.write "<td width=""50%"" height=22>" & vbCrLf
if request("scat_id")=cstr(rs2("scat_id")) then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -