📄 class.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--<%leixing=lcase(trim(request("id")))
select case leixing
case "big"
response.write "大类商品"
case "small"
response.write "小类商品"
end select%>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp" -->
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="770" valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <%leixing=lcase(trim(request("id")))
if InStr(leixing,"'")>0 then
response.write"<script>alert(""非法访问!"");location.href=""default.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=""default.asp"";</script>"
response.end
else
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""default"";</script>"
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from sh_sort where anclassid="&anclassid,conn,1,1
anclassname=rs("anclass")
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="170" valign="top"><table width="100%" height="49" border="0" cellpadding="0" cellspacing="0">
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="34"><img src="images/main/benlei.gif" width="178" height="34"></td>
</tr>
<tr>
<td height="55"><table width="178" border="0" cellpadding="0" cellspacing="0">
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from sh_sort2 where anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
if rs_s.recordcount=0 then
%>
<tr>
<td height="30" align="center" colspan="7">暂无小分类</td>
</tr>
<%
else
i=0
while not rs_s.eof
%>
<tr>
<td width="45%" height="30"><div align="center"><a href="class2.asp?id=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
%>
</div></td>
<td width="45%" ><a href="class2.asp?id=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>
</tr>
<tr>
<td ><div align="center"><a href="class2.asp?id=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
%>
</div></td>
<td ><a href="class2.asp?id=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> </tr> <tr>
<td width="10%" ><div align="center"><a href="class2.asp?id=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> <a href="class2.asp?id=small&anid=<%=rs("anclassid")%>&nid=<%=rs_s("nclassid")%>"><u><%=rs_s("nclass")%></u></a> </div></td>
<%
rs_s.movenext
end if
end if
end if
end if
end if
wend
end if
end if
end if
%>
</tr>
</table><tr>
<td><!--#include file="tonglei_market.asp"--></td>
</tr>
<tr>
<td><!--#include file="tonglei_tejia.asp"--></td>
</tr></td>
</tr>
</table>
</td>
<td width="1" bgcolor="#e3e3e8"></td>
<td width="590" valign="top" ><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<td><table width="590" height="33" valign="top" cellpadding="0" cellspacing="0" background="images/main/leibg.gif">
<tr>
<td ><img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=default.asp><%=webname%></a> >> <a href=class.asp?id=big&anid=<%=anclassid%>><%=anclassname%></a></td>
</tr>
</table></td>
<%
case "small"
anclassid=request("anid")
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""default.asp"";</script>"
response.end
else
if not isnumeric(anclassid) then
response.write"<script>alert(""非法访问!"");location.href=""default.asp"";</script>"
else
nclassid=request("nid")
if not isnumeric(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""default.asp"";</script>"
response.end
else
if not isnumeric(nclassid) then
response.write"<script>alert(""非法访问!"");location.href=""default.asp"";</script>"
else
set rs=server.createobject("adodb.recordset")
rs.open "select * from sh_sort where anclassid="&anclassid,conn,1,1
anclassname=rs("anclass")
rs.close
rs.open "select * from sh_sort2 where nclassid="&nclassid,conn,1,1
nclassname=rs("nclass")
rs.close
%>
<tr>
<td background="images/class_bg.jpg" height=50 valign="top" > <img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=default.asp><%=webname%></a> >> <a href=class.asp?id=big&anid=<%=anclassid%>><%=anclassname%></a> >> <%=nclassname%></td>
</tr>
<%
end if
end if
end if
end if %>
<%case else%>
<%end select%>
</table> <%set rs=server.createobject("adodb.recordset")
if leixing="big" then
rs.open "select * from sh_chanpin where anclassid="&anclassid&" order by adddate desc",conn,1,1
elseif leixing="small" then
rs.open "select * from sh_chanpin where anclassid="&anclassid&" and nclassid="&nclassid&" order by adddate desc",conn,1,1
end if
if rs.recordcount=0 then
%> <div align="center">
<table width="493" valign="top" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td width="483" valign="top" align=center>暂无商品</td>
</tr>
</table>
<%
else
rs.PageSize =12 '每页记录条数
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%" valign="top" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <!--#include file="fenleichanpin.asp"--></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 " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right>" & 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 TYEP=TEXT NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
<!--#include file="fenlei_tuijian.asp"-->
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="webfoot.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -