<!--#include file="Inc/Conn.asp"-->
<!--#include file="Inc/eshopcode.asp"-->
<!--#include file="Inc/Code.asp"-->
<!--#include file="Head.asp"-->
<%
If Request.QueryString("tit")="" Then 
If Request.Form("cndok")="Go" Then Response.Redirect "DownLoad.asp?page="&Trim(Request.Form("pp"))
Else
If Request.Form("cndok")="Go" Then Response.Redirect "DownLoad.asp?tit=" &Trim(Request.QueryString("tit"))& "&page="&Trim(Request.Form("pp"))
End if
Sql = "Select * From [DownLoad] "
If Request.QueryString("tit")<>"" Then
Sql = Sql & " Where [DownType]='"&checkstr(Request.QueryString("tit"))&"' Order By ID Desc "
Else
Sql = Sql & " Order By ID Desc "
End if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open Sql,Conn,1,1

dim MaxPerPage
MaxPerPage=5

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 Dlist()
Dim Dlhtm
Set big=Conn.Execute("Select * From [BigClassDown]")
If big.Eof Then
Dlhtm = Dlhtm & "没有该类别!"
Else
Do While Not big.Eof
Dlhtm = Dlhtm & "<a href=DownLoad.asp?tit=" &big("DownType")& ">" &big("DownType")& "</a>"
Dlhtm = Dlhtm & "<Br>"
big.MoveNext
Loop
End if
Dlist = DlHtm
End Function



Function ShowDoL()
Dim SiDh
If rs.Eof Then
SiDh = SiDh & "没有产品!"
Else
i=0
Do While Not rs.Eof
con=rs("Content")
If Len(con)>30 Then con=Left(con,30) & "..."
SiDh = SiDh & "<table width=99% border=0 align=center cellpadding=5 cellspacing=1 bgcolor=#d8d8d8>"
SiDh = SiDh & "<tr>"
SiDh = SiDh & "<td width=25% bgcolor=#FFFFFF> <div align=center><a href=ShowDown.asp?id="&rs("ID")&"><img src="&rs("PhotoUrl")&" width=100 height=80 border=0></a></div></td>"
SiDh = SiDh & "<td width=75% bgcolor=#FFFFFF> 文件名称："&rs("Titel")&"<br>"
SiDh = SiDh & "文件大小："&rs("DownSize")&"<br>"
SiDh = SiDh & "发布日期："&rs("InfoTime")&"<br>"
SiDh = SiDh & "下载类别：<a href=DownLoad.asp?tit="&rs("DownType")&">"&rs("DownType")&"</a><br>"
SiDh = SiDh & "文件类型：*"&Right(rs("DownUrl"),4)&"<br>"
SiDh = SiDh & "下载说明：<a href=ShowDown.asp?id="&rs("ID")&">详细介绍</a></td>"
SiDh = SiDh & "</tr>"
SiDh = SiDh & "</table>"
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
Loop
End if
ShowDoL = SiDh
End Function


Dim DFen
DFen = DFen & "共 <font color='#ff0000'>" & Cstr(Rs.RecordCount) & "</font> 条信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
DFen = DFen & "第 " & Cstr(CurrentPage) & "/" & Cstr(rs.pagecount) & "&nbsp;"
If currentpage > 1 Then
If Request.QueryString("tit")="" Then 
DFen = DFen & "<a href='DownLoad.asp?page="+cstr(1)+"'>首页 </a>&nbsp;"
DFen = DFen & "<a href='DownLoad.asp?page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
Else
DFen = DFen & "<a href='DownLoad.asp?tit=" &Trim(Request.QueryString("tit"))& "&page="+cstr(1)+"'>首页 </a>&nbsp;"
DFen = DFen & "<a href='DownLoad.asp?tit=" &Trim(Request.QueryString("tit"))& "&page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
End if
Else
DFen = DFen & " 上一页 "
End if
If currentpage< Rs.PageCount Then
If Request.QueryString("tit")="" Then 
DFen = DFen & "<a href='DownLoad.asp?page="+Cstr(currentPage+1)+"'> 下一页</a>&nbsp;"
DFen = DFen & "<a href='DownLoad.asp?page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
Else
DFen = DFen & "<a href='DownLoad.asp?tit=" &Trim(Request.QueryString("tit"))& "&page="+Cstr(currentPage+1)+"'> 下一页 </a>&nbsp;"
DFen = DFen & "<a href='DownLoad.asp?tit=" &Trim(Request.QueryString("tit"))& "&page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
End if
Else
DFen = DFen & "下一页&nbsp;&nbsp;"
End if
DFen = DFen & "</td><td align='right'>"
DFen = DFen & "转到：<input type='text' name='pp' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
DFen = DFen & "<input type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"


Dim Asa
If Request.QueryString("tit")<>"" Then 
Asa = "→ " & Request.QueryString("tit")
End If
Dim DoHtml
DoHtml = application("JaDownLoad")
DoHtml = Replace(DoHtml,"{用户登陆}",UserLogin())
DoHtml = Replace(DoHtml,"{用户搜索}",FindProd())
DoHtml=replace(DoHtml,"{新闻信息}",TopNews("News_ID"))
DoHtml = Replace(DoHtml,"{产品分类}",Dlist())
DoHtml = Replace(DoHtml,"{用户位置}",Asa)
DoHtml = Replace(DoHtml,"{用户投票}",ShowVote())
DoHtml = Replace(DoHtml,"{下载展示}",ShowDoL())
DoHtml = Replace(DoHtml,"{用户分页}",DFen)
Response.Write DoHtml
rs.Close
Set rs=Nothing
%>
<!--#Include File="bottom.Asp"-->