📄 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" onMouseOver="window.status='〖<%=webname%>〗<%=weburl%>欢您的访问!';return false">
<!--#include file="webtop.asp"-->
<TABLE width=778 border=0 align=center cellPadding=0 cellSpacing=0 background="images/content.gif">
<TBODY>
<TR>
<TD class=b width=7> </TD>
<TD class=b vAlign=top align=left width=758><table width="752" 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>
<%set rs=server.createobject("adodb.recordset")
if leixing="big" then
rs.open "select * from shop_books where anclassid="&anclassid&" order by adddate desc",conn,1,1
elseif leixing="small" then
rs.open "select * from shop_books where anclassid="&anclassid&" and nclassid="&nclassid&" order by 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 adddate desc",conn,1,1
elseif leixing="news" then
rs.open "select * from shop_books where newsbook=1 order by adddate desc",conn,1,1
else
rs.open "select * from shop_books where newsbook=1 order by 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 =15 '每页记录条数
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
%>
<table width="100%" class="table-xia" border="0" cellspacing="0" cellpadding="10" align="center">
<tr><%
ii=0
For i=1 To x
%>
<td width="33%" class="table-zuo"><table width="214" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><font color="#ff6600"><u>
<img src="images/ring01.gif">
<%
response.write trim(rs("bookname"))%>
</u></font></td>
</tr>
<tr>
<td width="108"><TABLE onmouseover="this.style.backgroundColor='#FF4FAE'" onmouseout="this.style.backgroundColor=''" width=108 height=100 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
<TBODY>
<TR>
<TD width=102 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=90 border=0 height=90></a>
<%end if%>
</td>
</tr>
</tbody>
</table></td>
<td width="106"><table width="83%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=center> <div align="left">
<p> <a href=list.asp?id=<%=rs("bookid")%> ><font color="#ff6600"><u>
</u></font></a></p>
</div></td>
</tr>
<tr>
<td align=center>市场价:<s><%=trim(rs("shichangjia"))%> 元</s><br>
会员价:<font color=#FF3300><%=trim(rs("huiyuanjia"))%> 元</font></td>
</tr>
<tr>
<td height="39" align=center><a href="gouwu.asp?id=<%=rs("bookid")%>&action=add" target="_blank"><img src="images/goumai.gif" border=0></a> <a href="shoucang.asp?id=<%=rs("bookid")%>&action=add" target="_blank"><br>
<img src="images/shoucang1.gif" border=0></a> </td>
</tr>
</table></td>
</tr>
</table></td>
<%rs.movenext
ii=ii+1%>
<%if ii mod 3 =0 then%></tr><tr><%end if%>
<% next%>
<td width="33%" > </td>
<td > </td>
</tr>
</table>
<%
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></TD>
<TD class=b width=7></TD>
</TR>
</TBODY>
</TABLE>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -