<!--#include file="Inc/Conn.asp"-->
<!--#include file="Inc/eshopcode.asp"-->
<!--#include file="Inc/Code.asp"-->
<!--#include file="Head.asp"-->
<%
If Request.QueryString("spro")="" Then 
If Request.Form("cndok")="Go" Then Response.Redirect "SProduct.asp?page="&Trim(Request.Form("pp"))
Else
If Request.Form("cndok")="Go" Then Response.Redirect "SProduct.asp?spro=" &Trim(Request.QueryString("spro"))& "&page="&Trim(Request.Form("pp"))
End if

Set rs=Server.CreateObject("Adodb.RecordSet")
Sql = "Select * From [Product] Where [SmallClassP] = '"&checkstr(Request.QueryString("spro"))&"' Order By [UpTime] Desc"
rs.Open Sql,Conn,1,1

dim MaxPerPage
MaxPerPage=6
Dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
Function ShowProa()
Dim showH
If rs.Eof Then
showH = showH & "没有项目!"
Else
i=0
Do While Not rs.Eof
con=rs("Content")
mm=rs("Mome")
If Len(con)>30 Then con=Left(con,30) & "..."
If Len(mm)>30 Then mm=Left(mm,30) & "..."
showH = showH & "<table width=100% border=0 align=center cellpadding=5 cellspacing=1 bgcolor=#d8d8d8>"
showH = showH & "<tr><td width=25% bgcolor=#FFFFFF> <div align=center>" 
showH = showH & "<a href=ShowProduct.asp?id="&rs("ID")&"><img src=admin/"&rs("Image")&" border=0 width=100 height=80></a></div></td>"
showH = showH & "<td width=75% bgcolor=#FFFFFF> 项目名称：<a href=ShowProduct.asp?id="&rs("ID")&">"&rs("Name")&"</a><br>"
showH = showH & "项目编号："&rs("guige")&"<br>"
showH = showH & "项目备注："&mm&"<br>"
showH = showH & "项目类别：<a href=SProduct.asp?spro="&rs("SmallClassP")&">"&rs("SmallClassP")&"</a><br>"
showH = showH & "项目信息：<a href=ShowProduct.asp?id="&rs("ID")&">详细信息</a>" 
showH = showH & "<table width=100% border=0 cellspacing=0 cellpadding=0>"
showH = showH & "<tr>" 
showH = showH & "</tr>"
showH = showH & "</table></td>"
showH = showH & "</tr></table>"
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
Loop
End if
ShowProa=showH
End Function
Dim SpHt
SpHt = SpHt &  "共 <font color='#ff0000'>" & Cstr(Rs.RecordCount) & "</font> 条信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
SpHt = SpHt & "第 " & Cstr(CurrentPage) & "/" & Cstr(rs.pagecount) & "&nbsp;"
If currentpage > 1 Then
If Request.QueryString("spro")="" Then 
SpHt = SpHt & "<a href='SProduct.asp?page="+cstr(1)+"'>首页 </a>&nbsp;"
SpHt = SpHt & "<a href='SProduct.asp?page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
Else
SpHt = SpHt & "<a href='SProduct.asp?tit=" &Trim(Request.QueryString("spro"))& "&page="+cstr(1)+"'>首页 </a>&nbsp;"
SpHt = SpHt & "<a href='SProduct.asp?tit=" &Trim(Request.QueryString("spro"))& "&page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
End if
Else
SpHt = SpHt & " 上一页 "
End if
If currentpage < Rs.PageCount Then
If Request.QueryString("spro")="" Then 
SpHt = SpHt & "<a href='SProduct.asp?page="+Cstr(currentPage+1)+"'> 下一页</a>&nbsp;"
SpHt = SpHt & "<a href='SProduct.asp?page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
Else
SpHt = SpHt & "<a href='SProduct.asp?spro=" &Trim(Request.QueryString("spro"))& "&page="+Cstr(currentPage+1)+"'> 下一页 </a>&nbsp;"
SpHt = SpHt & "<a href='SProduct.asp?spro=" &Trim(Request.QueryString("spro"))& "&page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
End if
Else
SpHt = SpHt & "下一页&nbsp;&nbsp;"
End if
SpHt = SpHt & "</td><td align='right'>"
SpHt = SpHt & "转到：<input type='text' name='pp' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
SpHt = SpHt & "<input type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"
Dim SpHtml
SpHtml = application("JaTSProduct")
SpHtml = Replace(SpHtml,"{用户登陆}",UserLogin())
SpHtml=replace(SpHtml,"{新闻信息}",TopNews("News_ID"))
SpHtml = Replace(SpHtml,"{用户搜索}",FindProd())
SpHtml = Replace(SpHtml,"{栏目分类}",PClass())
SpHtml = Replace(SpHtml,"{用户投票}",ShowVote())
SpHtml = Replace(SpHtml,"{大分类}",rs("BigClassP"))
SpHtml = Replace(SpHtml,"{小分类}",rs("SmallClassP"))
SpHtml = Replace(SpHtml,"{产品展示}",ShowProa())
SpHtml = Replace(SpHtml,"{产品分页}",SpHt)
Response.Write SpHtml
rs.Close
Set rs=Nothing
%>
<!--#Include File="bottom.Asp"-->