<!--#include file="../conn2.asp"-->
<!--#include file="set.asp"-->



<%Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM link  order by id desc"
rs.open sql, conn, 1, 3
%>

<head>
<LINK 
href="css.css" type=text/css rel=stylesheet>

<title></title>

<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body topmargin="2" leftmargin="2">

<div align="center">
  <center>
    <br>
    <table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
      <tr bgcolor="f1f1f1"> 
        <td height="25" colspan="5" align="center" class="style1">社区友情连接管理</td>
      </tr>
      <tr bgcolor="#FFFFFF"> 
        <td width="15%" height="25" align="center"><b>状态</b></td>
        <td width="30%" height="25" align="center"><b>网站名称</b></td>
        <td width="36%" height="25" align="center"><b>网址</b></td>
        <td width="9%" height="25" align="center"><b>审核</b></td>
        <td width="10%" height="25" align="center"><b>删除</b></td>
      </tr>
      <% 

if rs.eof then
         %>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
     <tr>
       <td align=center><br>
暂无信息!<a href="javascript:history.back(1)">点击返回</a><br>
</td>
     </tr>
   </table>
		 <%
           else 
        rs.PageSize =12 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	For i=0 To x-1
  %>
      <tr bgcolor="#FFFFFF"> 
        <td width="15%" height="25"> 
          <p align="center"> 
            <%if rs("check")=1 then%>
            已审核 
            <%else%>
            未审核 
            <%end if%>
        </td>
        <td width="30%" height="25"> 
        <p align="center"><%=rs("linkname")%></p></td>
        <td width="36%" height="25"> 
        <p align="center"><a href="<%=rs("url")%>" target="_blank"><%=rs("url")%></a></p></td>
        <td width="9%" height="25"> 
        <p align="center"><a href="shenghe.asp?id=<%=rs("id")%>&action=shenghe">通过</a></p></td>
        <td width="10%" height="25"> 
        <p align="center"><a href="shenghe.asp?id=<%=rs("id")%>&action=del" class="C_shenhong">删除</a></p></td>
      </tr>
      <% 
rs.movenext 
next 
%>
    </table>
  </center>
</div>

<center>
<br>

<% 
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
Sub PageControl(iCount,pagecount,page,table_style,font_style,per_page)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
	
    temp=""

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "web_id="&web_id&"&id="&id&"&Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条/每页"&per_page&"条" &  vbCrLf)
    Response.Write(" 转到 " & "<INPUT TYEP=TEXT NAME=page SIZE=4 Maxlength=8 class=wenbenkuang VALUE=" & page & ">" & " 页"  & vbCrLf & "<input name=go type=submit  value=GO class=go-wenbenkuang>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
end if

%> 
 
