<%@ Language=VBScript %>
<!--#include file="include/config.asp"-->
<!--#include file="include/common.asp"-->
<!--#include file="include/lib.asp"-->
<%
Dim webTitle:webTitle="代理专区"
dim objHtml,TempID,MainHtml,vserver,listPageNum,listTemp,intPage
set SafeQueryAPI=new SafeQuery: Call SafeQueryAPI.intQuery():set SafeQueryAPI=nothing
const thisPageID="news"
TempID="Temp"
set lib= New libClass
'MainHtml=lib.ReadTemplete("aboutus")


openConn




newsID=Rq("newsID")
if not isNum(newsID) Then
sqlStr=""
if Rq("class")<>"" Then sqlStr=sqlStr & " and t like '"&Rq("class")&"'"
if Rq("title")<>"" Then sqlStr=sqlStr & " and title like '%"&Rq("title")&"%'"
bigClass=Rq("class")
sql="select * From news where 1=1 "&sqlStr&" Order by dat desc"

Set Rs=server.createObject("ADODB.Recordset")
Rs.Open sql,Conn,1,1
	if Not(Rs.Eof And Rs.Bof) Then

MainHtml = MainHtml & "<h3>"&Rq("class")&"</h3><br><br><table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbcrlf & _
"  <tr>" & vbcrlf & _
"    <td height=""30"" align=""center""><strong>编号</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>标题</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>分类</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>日期</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>点击数</strong></td>" & vbcrlf & _
"  </tr>"
	
		Rs.pagesize=20
		Rs.AbsolutePage=toPage()
		intPage=lastnextpage(Rs.pagecount,Rs.recordcount)
		ii=1
		do while not rs.Eof
		
MainHtml = MainHtml & "  <tr>" & vbcrlf & _
"    <td height=""30"" align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("id")&"</td>" & vbcrlf & _
"    <td style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;""><a href=""/news.asp?newsid="&Rs("id")&""">"&Left(Rs("title"),30)&"</a></td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("t")&"</td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("dat")&"</td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("hits")&"</td>" & vbcrlf & _
"  </tr>"		
		
		ii=ii+1
		if ii-20>0 Then exit do		
		Rs.MoveNext
		Loop
		MainHtml = MainHtml & "</table><br><center>" & intPage & "</center>"
	Else
		MainHtml = MainHtml & "暂时没有"&Rq("class")&"文章!"
	End If
Rs.Close
Set Rs=Nothing
Else


sql="select * From news where id="&newsID&" Order by dat desc"

Set Rs=server.createObject("ADODB.Recordset")
Rs.Open sql,Conn,3,3
	if Not(Rs.Eof And Rs.Bof) Then
	Rs("hits")=Rs("hits")+1
	Rs.Update
bigClass=Rs("t")
MainHtml = MainHtml & "<h3 align=""center"">"&Rs("title")&"</h3><br><table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbcrlf & _
"  <tr>" & vbcrlf & _
"    <td height=""30"" align=""center""><strong>编号</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>分类</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>日期</strong></td>" & vbcrlf & _
"    <td align=""center""><strong>点击数</strong></td>" & vbcrlf & _
"  </tr>"
	
content=Rs("content")
MainHtml = MainHtml & "  <tr>" & vbcrlf & _
"    <td height=""30"" align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("id")&"</td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;""><a href=""/news.asp?class="&Rs("t")&""">"&Rs("t")&"</a></td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("dat")&"</td>" & vbcrlf & _
"    <td align=""center"" style=""border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #999;"">"&Rs("hits")&"</td>" & vbcrlf & _
"  </tr><tr><td colspan=""4"" style=""line-height:25px;"">"&content&"</td></tr>"		
		
	
		MainHtml = MainHtml & "</table><br><center>" & intPage & "</center>"
	Else
		MainHtml = MainHtml & "暂时没有"&Rq("class")&"文章!"
	End If
Rs.Close
Set Rs=Nothing

End If
CloseCOnn
objHtml=lib.ReadTemplete(TempID)
objHtml=R(objHtml,"{#新闻分类}",bigClass)
objHtml=R(objHtml,"{#主体模块}",MainHtml)
echo lib.translationHTML(objHtml)
set lib=nothing


%>