<!--#include file="Inc/Conn.asp"-->
<!--#include file="Inc/eshopcode.asp"-->
<!--#include file="Inc/Code.asp"-->
<!--#include file="Head.asp"-->
<%
Dim titid
titid = Request("titid")
If Isnumeric(titid)=false Then
Response.Redirect "Honor.asp"
End if
If titid="" Then 
If Request.Form("cndok")="Go" Then Response.Redirect "Honor.asp?page="&Trim(Request.Form("pp"))
Else
If Request.Form("cndok")="Go" Then Response.Redirect "Honor.asp?titid=" &titid& "&page="&Trim(Request.Form("pp"))
End if
Set rs=Server.CreateObject("ADODB.RecordSet")
sqlstr = " Select * From [Honor_Img] "
If titid = "" or titid=1 Then
sqlstr = sqlstr & " Where [Type_Honor]=true and [Type_Img]=false Order By id desc"
Else
If titid=2 Then
sqlstr = sqlstr & " Where [Type_Honor]=false and [Type_Img]=true Order By id desc"
End if
End if
rs.Open sqlstr,conn,1,1
dim MaxPerPage
MaxPerPage=4

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 Honlei()
Dim hoht
Set rsl=Server.CreateObject("ADODB.RecordSet") 
sql="Select * From [BigClassHonor] "
rsl.Open sql,conn,1,1
If rsl.Eof Then
hoht = hoht & "没有分类!"
Else
Do While Not rsl.Eof
hoht = hoht & "<a href=Honor.asp?titid=" &rsl("ID")& ">" & rsl("HonotTitel") & "</a><br>"
rsl.MoveNext
Loop
End if
rsl.Close
Set rsl=Nothing
Honlei=hoht
End Function

Function Isite()
Dim IsHt
If titid="" Then
Set tit = Conn.Execute("Select * From [BigClassHonor]")
IsHt = IsHt & tit("HonotTitel")
Else
Set tit = Conn.Execute("Select * From [BigClassHonor] Where ID="&Cint(titid))
IsHt = IsHt & tit("HonotTitel")
End if
Isite = IsHt
End Function

Function ShowHo()
Dim SHon
if not rs.eof then i=0
Do While Not rs.Eof
SHon = SHon & "<table width=90% border=0 cellspacing=3 cellpadding=0>"
SHon = SHon & "<tr>" 
SHon = SHon & "<td><div align=center>" 
SHon = SHon & "<table width=1% border=0 cellpadding=3 cellspacing=1 bgcolor=#CCCCCC>"
SHon = SHon & "<tr>"
SHon = SHon & "<td bgcolor=#FFFFFF><img src="&rs("Image")&"></td>"
SHon = SHon & "</tr>"
SHon = SHon & "</table>"
SHon = SHon & "</div></td>"
SHon = SHon & "</tr><tr>" 
SHon = SHon & "<td><div align=center>"&rs("Titel")&"</div></td>"
SHon = SHon & "</tr></table>"
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext 
Loop
ShowHo = SHon
End Function
Dim HoYe
HoYe = HoYe & "共 <font color='#ff0000'>" & Cstr(Rs.RecordCount) & "</font> 条信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
HoYe = HoYe & "第 " & Cstr(CurrentPage) & "/" & Cstr(rs.pagecount) & "&nbsp;"
If currentpage > 1 Then
If titid="" Then 
HoYe = HoYe & "<a href='Honor.asp?page="+cstr(1)+"'>首页 </a>&nbsp;"
HoYe = HoYe & "<a href='Honor.asp?page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
Else
HoYe = HoYe & "<a href='Honor.asp?tit=" &titid& "&page="+cstr(1)+"'>首页 </a>&nbsp;"
HoYe = HoYe & "<a href='Honor.asp?tit=" &titid& "&page="+Cstr(currentpage-1)+"'> 上一页 </a>&nbsp;"
End if
Else
HoYe = HoYe & " 上一页 "
End if
If currentpage < Rs.PageCount Then
If Request.QueryString("tit")="" Then 
HoYe = HoYe & "<a href='Honor.asp?page="+Cstr(currentPage+1)+"'> 下一页</a>&nbsp;"
HoYe = HoYe & "<a href='Honor.asp?page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
Else
HoYe = HoYe & "<a href='Honor.asp?tit=" &titid& "&page="+Cstr(currentPage+1)+"'> 下一页 </a>&nbsp;"
HoYe = HoYe & "<a href='Honor.asp?tit=" &titid& "&page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
End if
Else
HoYe = HoYe & "下一页&nbsp;&nbsp;"
End if
HoYe = HoYe & "</td><td align='right'>"
HoYe = HoYe & "转到：<input type='text' name='pp' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
HoYe = HoYe & "<input type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"
Dim HonHtml
HonHtml = application("JaHonor")
HonHtml = Replace(HonHtml,"{用户登陆}",UserLogin())
HonHtml=replace(HonHtml,"{新闻信息}",TopNews("News_ID"))
HonHtml = Replace(HonHtml,"{用户投票}",ShowVote())
HonHtml = Replace(HonHtml,"{用户搜索}",FindProd())
HonHtml = Replace(HonHtml,"{栏目分类}",Honlei())
HonHtml = Replace(HonHtml,"{用户位置}",Isite())
HonHtml = Replace(HonHtml,"{企业荣誉}",ShowHo())
HonHtml = Replace(HonHtml,"{用户分页}",HoYe)
Response.Write HonHtml
rs.Close
Set rs=Nothing
%>
<!--#Include File="bottom.Asp"-->