![]() |
#2
魏兴耀2010-11-07 13:00
|
以下是程序,希望大家帮忙解决一下:

<!-- #include file="Head.asp" -->
<%bigid=request("bigid")
smallid=request("smallid")
if bigid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from bigclass where bigclassid="&bigid&"",conn,1,1
bigclassname=rs("bigclassname")
rs.close
end if
if smallid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from smallclass where smallclassid="&smallid&"",conn,1,1
smallclassname=rs("smallclassname")
rs.close
end if
%>
<%
'请勿改动下面这二行代码
MaxPerPage=MaxPerPage_Default
strFileName="Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName
%>
<table width="962" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="491" ><table width="948" border="0" align="center" cellpadding="0" cellspacing="0" height="491">
<tr>
<td width="236" valign="top"><!--#include file ="leftp.asp"--></td>
<td width="720" valign="top" align="right"><table width="99%" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px">
<tr>
<td valign="top"><table width="100%" height="315" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36"><table width="100%" height="36" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="25"><img src="image/productleft.jpg" width="25" height="36"></td>
<td width="490" class="productbg">产品展示</td>
<td width="162" class="more">当前位置: <A href="/english/index.htm">首页</A> - 产品展示</td>
<td width="20"><img src="image/productright.jpg" width="19" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="pic" style="padding:10px" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%"> </td>
<td width="90%" align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" style="border:dotted 1px #999; padding:3px"><% call ShowProductTotal() %> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
set rsbigp = server.CreateObject ("adodb.recordset")
sqlp="select * from BigClass"
rsbigp.open sqlp,conn,1,1
if rsbigp.eof and rsbigp.bof then
Response.Write "暂无记录……"
else
i=1
do while not rsbigp.eof
%>
<td id="foot">→ <a href='Product.asp?Bigid=<%=rsbigp("BigClassid")%>'><%=rsbigp("BigClassName")%></a><% call ShowPTotal(rsbigp("BigClassName")) %></td>
<%
if i mod 4=0 then
response.Write("</tr><tr>")
end if
i=i+1
rsbigp.movenext
loop
rsbigp.close
set rsbigp=nothing
end if%>
</tr>
</table>
</td>
</tr>
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from Products where Passed=True "
if BigClassName<>"" then
sql=sql & " and BigClassName='" & BigClassName & "' "
end if
if SmallClassName<>"" then
sql=sql & " and SmallClassName='" & SmallClassName & "'"
end if
sql=sql &"order by id asc"
rs.open sql,conn,1,1
i=0
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=12
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
%>
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px">
<tr>
<%for j=1 to rs.PageSize
%>
<td height="160"><table border="0" align="center" cellpadding="0" cellspacing="0" width="170">
<tr>
<td align="center" valign="middle" style="background:url(image/movebg.jpg) no-repeat; width:152px; height:152px"><a href="ProductShow.asp?ID=<%= RS("ID") %>" target="_blank"><img src='<%= RS("DefaultPicUrl") %>' border=0 alt='产品展示' width="130" height="130"></a></td>
</tr>
<tr>
<td height="23" ><br>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="Images/chanpin.jpg">
<tr>
<td align="center"><a href="ProductShow.asp?ID=<%= RS("ID") %>" target="_blank"><strong><font color="#2C6995"><%=RS("title") %></font></strong></a></td>
</tr>
</table></td>
</tr>
</table>
<br></td>
<% i=i+1
if i mod 4=0 then
response.Write("</tr>")
end if
%>
<%
rs.movenext
if rs.eof then exit for
next
%>
</table></td>
</tr>
<tr valign="bottom">
<td height="50" colspan="2" align="center" ><form method=Post action="product.asp">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=1>首页</a> "
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table></td>
<td width="6%"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="9"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="9">
<tr>
<td width="8" style="background: url(image/bleft.jpg) no-repeat"></td>
<td style="background: url(image/bbg.jpg) repeat-x"> </td>
<td width="8" style="background: url(image/bright.jpg) no-repeat"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</BODY></HTML>
<%bigid=request("bigid")
smallid=request("smallid")
if bigid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from bigclass where bigclassid="&bigid&"",conn,1,1
bigclassname=rs("bigclassname")
rs.close
end if
if smallid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from smallclass where smallclassid="&smallid&"",conn,1,1
smallclassname=rs("smallclassname")
rs.close
end if
%>
<%
'请勿改动下面这二行代码
MaxPerPage=MaxPerPage_Default
strFileName="Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName
%>
<table width="962" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="491" ><table width="948" border="0" align="center" cellpadding="0" cellspacing="0" height="491">
<tr>
<td width="236" valign="top"><!--#include file ="leftp.asp"--></td>
<td width="720" valign="top" align="right"><table width="99%" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px">
<tr>
<td valign="top"><table width="100%" height="315" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36"><table width="100%" height="36" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="25"><img src="image/productleft.jpg" width="25" height="36"></td>
<td width="490" class="productbg">产品展示</td>
<td width="162" class="more">当前位置: <A href="/english/index.htm">首页</A> - 产品展示</td>
<td width="20"><img src="image/productright.jpg" width="19" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="pic" style="padding:10px" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%"> </td>
<td width="90%" align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" style="border:dotted 1px #999; padding:3px"><% call ShowProductTotal() %> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
set rsbigp = server.CreateObject ("adodb.recordset")
sqlp="select * from BigClass"
rsbigp.open sqlp,conn,1,1
if rsbigp.eof and rsbigp.bof then
Response.Write "暂无记录……"
else
i=1
do while not rsbigp.eof
%>
<td id="foot">→ <a href='Product.asp?Bigid=<%=rsbigp("BigClassid")%>'><%=rsbigp("BigClassName")%></a><% call ShowPTotal(rsbigp("BigClassName")) %></td>
<%
if i mod 4=0 then
response.Write("</tr><tr>")
end if
i=i+1
rsbigp.movenext
loop
rsbigp.close
set rsbigp=nothing
end if%>
</tr>
</table>
</td>
</tr>
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from Products where Passed=True "
if BigClassName<>"" then
sql=sql & " and BigClassName='" & BigClassName & "' "
end if
if SmallClassName<>"" then
sql=sql & " and SmallClassName='" & SmallClassName & "'"
end if
sql=sql &"order by id asc"
rs.open sql,conn,1,1
i=0
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=12
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
%>
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px">
<tr>
<%for j=1 to rs.PageSize
%>
<td height="160"><table border="0" align="center" cellpadding="0" cellspacing="0" width="170">
<tr>
<td align="center" valign="middle" style="background:url(image/movebg.jpg) no-repeat; width:152px; height:152px"><a href="ProductShow.asp?ID=<%= RS("ID") %>" target="_blank"><img src='<%= RS("DefaultPicUrl") %>' border=0 alt='产品展示' width="130" height="130"></a></td>
</tr>
<tr>
<td height="23" ><br>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="Images/chanpin.jpg">
<tr>
<td align="center"><a href="ProductShow.asp?ID=<%= RS("ID") %>" target="_blank"><strong><font color="#2C6995"><%=RS("title") %></font></strong></a></td>
</tr>
</table></td>
</tr>
</table>
<br></td>
<% i=i+1
if i mod 4=0 then
response.Write("</tr>")
end if
%>
<%
rs.movenext
if rs.eof then exit for
next
%>
</table></td>
</tr>
<tr valign="bottom">
<td height="50" colspan="2" align="center" ><form method=Post action="product.asp">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=1>首页</a> "
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=product.asp?Bigid="&Bigid&"&smallid="&smallid&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table></td>
<td width="6%"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="9"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="9">
<tr>
<td width="8" style="background: url(image/bleft.jpg) no-repeat"></td>
<td style="background: url(image/bbg.jpg) repeat-x"> </td>
<td width="8" style="background: url(image/bright.jpg) no-repeat"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</BODY></HTML>