<!--#include file="system/conn.asp"--><%

cid = Request.QueryString("cid")
If cid="" Or Not IsNumeric(cid) Then cid=0
If cid<3 Then Conn.Close:Set Conn=Nothing:Response.Redirect "/":Response.End

Set Rs=Server.CreateObject("ADODB.RecordSet")

Rs.Open "SELECT classname FROM class WHERE id="& cid &" AND classstate>0",Conn,1,1
If Rs.Bof And Rs.Eof Then
	Rs.Close:Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.Redirect "/":Response.End
Else
	className=Rs("classname")
End If
Rs.Close

%><!DOCTYPE html>
<html>
<head>
<meta charset=utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="keywords" content="<%=keywords%>" />
<meta name="description" content="<%=description%>" />
<title><%=className & "【" & webname & "】"%></title>
<link rel="stylesheet" type="text/css" href="s/c.css?ver=1030" />
<script type="text/javascript" src="j/js.js"></script>
</head>
<body>
<div id="container">
<%Call subTop()%>
<div class="pt"><%=className%></div>
<ul class="yl"><%

SqlStr = "SELECT id,infotitle,infoimgurl,infocontent FROM info WHERE infostate>0 AND classid="& cid &" ORDER BY infoord DESC,id DESC"
Rs.Open SqlStr,Conn,1,1
If Not Rs.Bof And Not Rs.Eof Then

	Rs.PageSize = 9
	If Page = "" Then Page = 1
	If Page = "end" Then Page = Rs.PageCount
	If Not IsNumeric(Page) Or Page < 1 Then Page = 1
	Page = Cint(Page)
	If Page > Rs.PageCount Then Page = Rs.PageCount
	Rs.AbsolutePage = Page
		For i=1 To Rs.PageSize
			If Rs.Bof Or Rs.Eof Then Exit For
			id=Rs("id"):infotitle=Rs("infotitle"):infoimgurl=Rs("infoimgurl"):infocontent=HTMLUnCode(Rs("infocontent"))
%><li><a href="rd.asp?id=<%=id%>" class="m" title="查看<%=infotitle%>详细介绍"><%=infotitle%></a></li><%

			Rs.MoveNext
		Next
		Set Rs1=Nothing
Else
	Response.Write "<li style=""margin:30px"">暂无内容</li>"
End If
If Rs.PageCount > 1 Then
	liststr=liststr & "<div class=""sp"">"

	PageName = "info.asp?cid="& cid &"&Page="

	Pagelen=3
	If Page>1 Then
		liststr=liststr & "<a href="""&PageName&"1"">首页</a>"
		liststr=liststr & "<a href="""&PageName&Page-1&""">上一页</a>"
	End If

	If Pagelen*2+1 >= Rs.PageCount Then
		StartPage=1:EndPage=Rs.PageCount
	Else
		If Page<=Pagelen+1 Then
			StartPage=1
			EndPage=Pagelen*2+1
		Else
			StartPage=Page-Pagelen
			EndPage=Page+Pagelen
		End If
		If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
	End If

	For i = StartPage To EndPage
		If i = Page Then
			liststr=liststr & "<a class=""current"">"&i&"</a>"
		Else
			liststr=liststr & "<a href="""&PageName&i&""">"&i&"</a>"
		End If
	Next

	If Page<Rs.PageCount Then
		If Rs.PageCount - Page > Pagelen Then liststr=liststr & "<a href="""&PageName&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
		liststr=liststr & "<a href="""&PageName&Page+1&""">下一页</a>"
		liststr=liststr & "<a href="""&PageName&Rs.PageCount&""">尾页</a>"
	End If
	liststr=liststr & "</div>"
End If
Rs.Close

%>
</ul>
<%=liststr%>
<%Call subBottom()%>
</div>
</body>
</html><%Conn.Close:Set Conn=Nothing%>