<!--#include file="Head.asp"-->

<!--#include file="Config.asp"-->
<!--#include file="admin.asp"-->
<%
dim rs,sql,p,yd,gettxt,act
p=trim(request.querystring("p"))
if p="" or IsNumeric(p)=False then p=1

act=trim(request.querystring("act"))

if act<>"out" then
if p=1 then
             yd="今日链入排行"
             gettxt="where [Active] =0 and del=0 and yd_time>='"&date()&"'"
             elseif p=2 then 
             yd="昨日链入排行"
             gettxt="where [Active] =0 and del=0 and yd_time>='"&date()-1&"'"
             elseif p=3 then 
             yd="本周链入排行"
             gettxt="where [Active] =0 and del=0 and yd_time>='"&date()-7&"'"
             elseif p=4 then 
             yd="月链入排行"
             gettxt="where [Active] =0 and del=0 and yd_time>='"&date()-30&"'"
             else
             yd="总链入排行"
             gettxt="where [Active] =0 and del=0"
             end if
			 call saycardd(""&yd&"")
Response.write"按链入|<a href='top.asp?act=out&amp;p="&p&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>按链出</a><br/>"
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * from [link] "&gettxt&"  order by [YD_in] desc"
else
if p=1 then
             yd="今日链出排行"
             gettxt="where [Active] =0 and del=0 and OUTtime>='"&date()&"'"
             elseif p=2 then 
             yd="昨日链出排行"
             gettxt="where [Active] =0 and del=0 and OUTtime>='"&date()-1&"'"
             elseif p=3 then 
             yd="本周链出排行"
             gettxt="where [Active] =0 and del=0 and OUTtime>='"&date()-7&"'"
             elseif p=4 then 
             yd="月链出排行"
             gettxt="where [Active] =0 and del=0 and OUTtime>='"&date()-30&"'"
             else
             yd="总链出排行"
             gettxt="where [Active] =0 and del=0"
             end if
			 call saycardd(""&yd&"")
Response.write"<a href='top.asp?act=in&amp;p="&p&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>按链入</a>|按链出<br/>"
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * from [link] "&gettxt&"  order by [yd_out] desc"
end if
rs.open sql,conn,1,1 
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=15						
	Dim Count,page,pagecount,gopage			
	gopage="top.asp?act="&act&"&amp;p="&p&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))					
	For i=1 To PageSize     						
	If rs.eof Then Exit For				
Response.write ""&i+(page-1)*PageSize&"."
Response.write "<a href=""Showlink.asp?class="&rs("classid")&"&amp;id="&rs("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&""">"&usb(rs("name"))&"</a>(出"&rs("YD_out")&"/入"&rs("YD_in")&")<br/>"   
	rs.moveNext
 	Next
if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
if pagecount>1 then response.write "<br/>"&page&"/"&pagecount&"页,共"&Count&"条<br/>"
if saytk=1 then
response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳到该页</a><br/>"
end if
Else
Response.write "暂时没有！<br/>"
end if
Response.write "<a href=""top.asp?act="&act&"&amp;p=1&amp;sid="&sid&"&amp;saytk="&saytk&""">今日</a>|" 
Response.write "<a href=""top.asp?act="&act&"&amp;p=2&amp;sid="&sid&"&amp;saytk="&saytk&""">昨日</a>|" 
Response.write "<a href=""top.asp?act="&act&"&amp;p=3&amp;sid="&sid&"&amp;saytk="&saytk&""">本周</a>|" 
Response.write "<a href=""top.asp?act="&act&"&amp;p=4&amp;sid="&sid&"&amp;saytk="&saytk&""">本月</a>|" 
Response.write "<a href=""top.asp?act="&act&"&amp;p=5&amp;sid="&sid&"&amp;saytk="&saytk&""">总排行</a><br/>"%>
<a href="Link_class.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[分类管理]</a><br/>
<a href='Admin_index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>[友链管理]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<%response.write""
call headsay()%>
<%call ALLClose()%>    
