📄 class.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html><head>
<title><%=webname%>--<%
leixing=lcase(trim(request("lx")))
leixing=replace(leixing,"'","")
select case leixing
case "big"
response.write "大类商品"
case "small"
response.write "小类商品"
case "tejia"
response.write "特价商品"
case "news"
response.write "新品上架"
case else
response.write "新品上架"
end select%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp"-->
<table width="770" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
<tr>
<td width="100%" valign="top" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<%leixing=lcase(trim(request("lx")))
if InStr(leixing,"'")>0 then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
end if
'leixing=replace(leixing,"'","")
select case leixing
case "big"
anclassid=trim(request("anid"))
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
anclassname=rs("anclass")
%>
<tr>
<td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> <%=anclassname%></td></tr>
<tr>
<td colspan="3" bgcolor="#F5F5F5" >
<div align="center">
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_nclass where anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td width="100%" height="30" align="center" colspan="8">暂无小分类</td>
</tr>
<%
else
i=0
while not rs_s.eof
%>
<tr>
<td height="30"><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a>
<%rs_s.movenext
if rs_s.eof then
response.write " "
else
%>
</td>
<td ><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a>
<%rs_s.movenext
if rs_s.eof then
response.write " "
else
%>
</td>
<td ><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a>
<%rs_s.movenext
if rs_s.eof then
response.write " "
else
%>
</td>
<td ><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a>
<%rs_s.movenext
if rs_s.eof then
response.write " "
else
%>
</td>
<td ><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a>
<%rs_s.movenext
if rs_s.eof then
response.write " "
else
%>
</td>
<td ><a href="class.asp?lx=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a> </td>
<%
rs_s.movenext
end if
end if
end if
end if
end if
wend
end if
end if
end if
%>
</tr>
</table>
</div>
</td>
</tr>
<%
case "small"
anclassid=request("anid")
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
nclassid=request("nid")
if not isnumeric(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,1,1
anclassname=rs("anclass")
rs.close
rs.open "select * from shop_nclass where nclassid="&nclassid,conn,1,1
nclassname=rs("nclass")
rs.close
%>
<tr><td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> <a href=class.asp?lx=big&anid=<%=anclassid%>><%=anclassname%></a> >> <%=nclassname%></td></tr>
<%
end if
end if
end if
end if
case "tejia"%>
<tr><td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 特价促销</td></tr>
<%case "hot"%>
<tr><td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 热卖排行</td></tr>
<%case "news"%>
<tr><td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 最新上架</td></tr>
<%case else%>
<tr><td colspan="3" background="images/class_bg.jpg" height=50> <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 最新上架</td></tr>
<%end select%>
</table>
<table width=100% align=center class=table-shang border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1>
<TR>
<TD bgColor=#ffffff colSpan=3 height=1></TD>
<TR>
<tr>
<td align=center width=20% height=30>产品预览</td>
<td align=center width=60% height=30>产品名称</td>
<td align=center width=20% height=30>产品价格</td>
</tr>
<TR>
<TD bgColor=#cccccc colSpan=3 height=1></TD>
</TR>
<TR>
<TD bgColor=#f1f1f1 colSpan=3 height=3></TD>
</TR>
</table>
<%set rs=server.createobject("adodb.recordset")
if leixing="big" then
rs.open "select * from shop_books where anclassid="&anclassid&" order by b desc,c,adddate desc",conn,1,1
elseif leixing="small" then
rs.open "select * from shop_books where anclassid="&anclassid&" and nclassid="&nclassid&" order by b desc,c,adddate desc",conn,1,1
elseif leixing="hot" then
rs.open "select * from shop_books order by chengjiaocount desc",conn,1,1
elseif leixing="tejia" then
rs.open "select * from shop_books where tejiabook=1 order by b desc,c,adddate desc",conn,1,1
elseif leixing="news" then
rs.open "select * from shop_books where newsbook=1 order by b desc,c,adddate desc",conn,1,1
elseif leixing="chengjiao" then
rs.open "select * from shop_books where newsbook=1 order by chengjiaocount desc",conn,1,1
else
rs.open "select * from shop_books where newsbook=1 order by b desc,c,adddate desc",conn,1,1
end if
if rs.recordcount=0 then
%>
<table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
<tr><td align=center>暂无商品</td></tr>
</table>
<%
else
rs.PageSize =20 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
For i=1 To x
%>
<table width="100%" class="table-xia" border="0" cellspacing="0" cellpadding="10" align="center">
<tr>
<td width="20%" rowspan="4" class="table-you" align="center">
<TABLE onmouseover="this.style.backgroundColor='#FF4FAE'" onmouseout="this.style.backgroundColor=''" width=100 height=100 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
<TBODY>
<TR>
<TD width=100 height=100 bgColor=#ffffff align=center>
<%if rs("bookpic")="" then
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" ><img src=images/emptybook.gif width=90 height=90 border=0></a></div>"
else%>
<a href=list.asp?id=<%=rs("bookid")%> ><img src="<%=trim(rs("bookpic"))%>" width=100 border=0 height=100></a>
<%end if%>
</td>
</tr>
</tbody>
</table>
</td>
<td width="60%"><img src="images/ring01.gif"> <a href=list.asp?id=<%=rs("bookid")%> ><font color="#ff6600"><u>
</u></font></a><a href=list.asp?id=<%=rs("bookid")%> target="_blank" >
<%
if rs("a")<>0 then
response.write"<font color=#"&rs("a")&">"
end if
%>
<%if len(rs("bookname"))>13 then%>
<%=left(rs("bookname"),13)%>..
<%else%>
<%=rs("bookname")%>
<%end if%>
<%
if rs("yikoujia")=1 then
response.write"<font color=#BA8BB9>[一口价]</font>"
end if
%>
</a>
<%if rs("b")>=1 then
response.write "<font color=#BA8BB9>"
response.write "[<img src=""images/jsq.gif"">"&rs("b")&"]</font>"
end if%>
</td>
<td width="20%" rowspan="4" class="table-zuo">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=center> <div align="left">
<%if rs("yikoujia")<>1 then %>
起拍价:<font color=#FF3300><%=trim(rs("shichangjia"))%> 元</font><br>
竞价剃度:<font color=#FF3300><%=trim(rs("huiyuanjia"))%> 元</font><br>
<%else%>
一口价:<font color=#FF3300><%=trim(rs("shjiatejiabook"))%> 元</font><br>
<%end if%>
剩余数量:<font color=#FF3300><%=trim(rs("kucun"))%><%=trim(rs("bookchuban"))%></font><br>
<%
enddate=trim(rs("closedate"))
s1=DateDiff("s",now(),enddate)
if s1>0 then
showdate=int(s1/3600/24)
h=int((s1-showdate*3600*24)/3600)
m=int((s1-showdate*3600*24-h*3600)/60)
s=s1-showdate*3600*24-h*3600-m*60
end if
%>
<%
if s1>0 then
response.write"剩余时间:<br>"
response.write "<font color=#A886AC>"
if showdate>0 then
response.write ""&showdate&"天"
end if
if h>0 then
response.write"" &h&"小时"
end if
if m>0 then
response.write"" &m&"分"
end if
if s>0 then
response.write"" &s&"秒"
end if
response.write "</font>"
else
response.write"该商品已经过期"
end if
%>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><font color="#666666">
<%if len(trim(rs("bookcontent")))>150 then
response.write left(trim(rs("bookcontent")),120)&"..."
else
response.write trim(rs("bookcontent"))
end if%>
<font color="#0000FF">...</font>
<%
response.write "[ <a href=index.asp?id="&rs("shjiaid")&" ><font color=blue>"
response.write trim(rs("shjianame"))
response.write "</font></a> ]"
%>
</font></td>
</tr>
</table>
<%rs.movenext
next
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1>" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR bgcolor=#f1f1f1>" & vbCrLf )
Response.Write("<TD align=center height=35>" & vbCrLf )
Response.Write(font_style & vbCrLf )
if page<=1 then
Response.Write ("首 页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首 页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾 页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾 页</A> " & vbCrLf)
end if
Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf)
Response.Write(" 共有" & iCount & "种商品" & vbCrLf)
Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
</td>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -