
<!--#include file="setup.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="top2.asp" -->
<!--#include file="inc/prompt.inc" -->
<%
Response.Expires=0
dim typeid,sql,rs,soonhost,linkrs,state,typehead
typeid=request("typeid")


if typeid <> empty then
	typeid=typeid
	sql= "select * from linktype where trim(typeid)='"&typeid&"'"
	set rs=conn.execute (sql)  
	typehead=rs("type")
	state=rs("type")
   else
	typeid=""
	typehead="双赢设计网自助友情链接系统"
	state="双赢设计网自助友情链接系统"
   end if
call top2()
%>
<body bgcolor="#C0C0C0">

<div align="center">
  <center>

<table width="770" border="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0" height="85" >
  <tr valign="middle">
    <td width="499" bgcolor="#FFFFFF" background="../images/bj.jpg" valign="middle" height="29">
    <a href="http://www.dobwin.com" style="text-decoration: none">
    <font color="#000000">回主页</font></a>&gt;&gt;<a href="index.asp" style="text-decoration: none"><font color="#000000">友情链接</font></a>&gt;&gt;<%=typehead%> 
    网站分类： <font color="#FFFFFF"> 
      <select size="1" name="D1" onChange="MM_goToURL('parent',this.value);return document.MM_returnValue">
          <option>选择分类</option>
          <%
Set rs= Server.CreateObject ("ADODB.RecordSet")
rs.open "select * from linktype ",conn,1,3 
soonhost=0
DO WHILE NOT soonhost = rs.RecordCount %> 
          <option value="<%=filename%>?typeid=<%=rs("typeid")%>">  <%=rs("type")%></option>
          <% soonhost=soonhost+1
             rs.movenext
loop
'_________________________________________________________________________计算友情链接数
Set rs= Server.CreateObject ("ADODB.RecordSet")
sqllink="select * from link"
rs.open (sqllink),conn,1,3
total=rs.RecordCount
'_________________________________________________________________________计算友情链接数
Rs.Close
Set Rs=Nothing
%> 
      </select></font> </td>
    <td  width="280" bgcolor="#FFFFFF" background="../images/bj.jpg" valign="middle" height="29"> 
      <div align="right"> 
        <a href="edit.asp" target="_blank" style="text-decoration: none">
        <font color="#000000">更改信息</font></a>&nbsp; 
        <a href="reg.asp" target="_blank" style="text-decoration: none"> 
        <font color="#000000">友情登陆</font></a>&nbsp; 
        <a href="ad_login.asp" style="text-decoration: none">
        <font color="#000000">管理&nbsp; </font> 
        </a>链接数 <%=total%></div>
    </td>
  </tr>
  <tr>
    <td width="779" height="56" colspan="2">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="52">
      <tr>
        <td width="37%" height="52" bgcolor="#FFFFFF" background="graybg.gif">
        <img border="0" src="logo.gif" width="300" height="75"></td>
        <td width="63%" height="52" valign="middle" bgcolor="#FFFFFF" background="graybg.gif">
        <p style="line-height: 150%"><font color="#588AD3">&nbsp;&nbsp;&nbsp; </font>
        双赢网络平台 http://www.dobwin.com 
        一个综合网络平台：双赢设计网，双赢企业网，双赢婚庆网，双赢教育网，双赢交友网，双赢论坛......双赢平台，创造未来!</td>
      </tr>
    </table>
    </td>
    </tr>
</table>    
    
  </center>
</div>
    
<div align="center">
  <center>
<table border=1 cellpadding=2 cellspacing=0 width=770 bordercolor=#C0C0C0 style="border-collapse: collapse">
  <tr align="center"> 
    <td class=td height=15 width=120 bgcolor="#FFFFFF"><font color="#111111">网站名称</font></td>
    <td class=td height=20 width=92 bgcolor="#FFFFFF"><font 
      color=#111111>图标</font></td>
    <td class=td height=20 width=292 bgcolor="#FFFFFF"><font color="#111111">网站内容</font></td>
    <td class=td height=15 width=65 bgcolor="#FFFFFF"><font 
      color=#111111>站长</font></td>
    <td class=td height=15 width=50 bgcolor="#FFFFFF"><font color="#111111">点击</font></td>
    <td class=td height=15 width=119 bgcolor="#FFFFFF"><font 
      color=#111111>加入日期</font></td>
  </tr>
  <%
'__________________________________________________________________________________
set linkrs = Server.CreateObject("ADODB.RecordSet")
linkrs.pagesize=MaxPerPage

if typeid <> "" then

	select case arrange
		case 0
		sql="select * from link where type="&typeid&" order by addtime asc"	
		case 1
		sql="select * from link where type="&typeid&" order by addtime desc"
		case 2
		sql="select * from link where type="&typeid&" order by hit desc"
		case 3
		sql="select * from link where type="&typeid&" order by homepage asc"
	end select

else

	select case arrange
		case 0
		sql="select * from link  order by addtime asc"	
		case 1
		sql="select * from link  order by addtime desc"
		case 2
		sql="select * from link  order by hit desc"
		case 3
		sql="select * from link  order by homepage asc"
	end select
end if

linkrs.open sql,conn,1,3

howmanyfields=linkrs.Fields.Count-1   '字段数

'__________________________________________________________取得当前页
If trim(Request("Page"))<>"" then '如果页数不为空
	CurrentPage= CLng(request("Page")) '指定当前页
	If CurrentPage> linkrs.PageCount then   '
		CurrentPage = linkrs.PageCount 
	End If 
Else 
	CurrentPage= 1 
End If 
'__________________________________________________________

if linkrs.eof then
	response.write "</table>"
	errmsg=errmsg+"<br>"+"<li>还没有记录,请返回!!"
	founderr=true
	call error2()
	response.end
		
else 
	totalPut=linkrs.recordcount
	if CurrentPage<>1 then 
		if (currentPage-1)*MaxPerPage<totalPut then 
			linkrs.move(currentPage-1)*MaxPerPage 
			
		end if 
	end if
end if	
i=0
do while not linkrs.eof and i < maxperpage 

response.write "<td class=td1 align='center' height='20' class=td><a href="&linkrs("url")&" target=_blank>"&linkrs("homepage")&"</a></td>"

logo=linkrs("image")
if logo="http://" or logo="none" then
	logo="image/nologo.gif"                     
end if 
                     
response.write "<td class=td2> <img src=" &logo& " width='88' height='31' ></td>"
response.write "<td  class=td1 height='20' >"&linkrs("message")&"</td>"
response.write "<td class=td2 align='center' height='20' ><a href=mailto:" &linkrs("e_mail")& ">" &linkrs("username")&"</a></td>"
response.write "<td class=td1 align='center' height='20' >" & (linkrs("hit")) & "</td>"
response.write "<td class=td1 align='center' height='20' >" & (linkrs("addtime")) & "</td>"


Response.Write "</TR>"
i=i+1
linkrs.movenext 
loop


'__________________________________________________________________________________

dim n,k
if (totalPut mod MaxPerPage)=0 then  'n表示总页数
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
k=currentPage
%> 
</table>

  </center>
</div>

<center>
<div align="center">
  <center>
<table border="0" cellspacing="0" cellpadding="0" width=770 style="border-collapse: collapse" bordercolor="#ffffff">
  <tr  bgcolor="#ffffff"> 
    <td class=td width="738" bgcolor="#FFFFFF">
      <div align="right">
        <select size="1" name="D2" onChange="MM_goToURL('parent',this.value);return document.MM_returnValue">
          <option>跳转页数</option>
          <%
soonhost=0
DO WHILE NOT soonhost = n %>
          <option value="index.asp?typeid=<%=typeid%>&Page=<% =soonhost+1 %>"><% =soonhost+1 %></option>
          <% soonhost=soonhost+1
loop
%>
        </select> 　 </center>
</div>
<%
'------------------------------------------------------页面跳转

if k<>1 then
response.write "[<b>"+"<a href=" &filename& "?page=1&typeid=" &typeid& "&subtype=" &subtype& ">首页</a></b>] "
response.write "[<b>"+"<a href=" &filename& "?page="+cstr(k-1)+"&typeid=" &typeid& "&subtype=" &subtype& ">上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b>"+"<a href=" &filename& "?page="+cstr(k+1)+"&typeid=" &typeid& "&subtype=" &subtype& ">下一页</a></b>] "
response.write "[<b>"+"<a href=" &filename& "?page="+cstr(n)+"&typeid=" &typeid& "&subtype=" &subtype& ">尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
'------------------------------------------------------页面跳转
linkrs.close
set linkrs=nothing
conn.close
set conn=nothing
response.write "</div></td></tr></table></body></html>"
%><!--#include file="foot.inc" -->