<!-- #include file="conn.asp" -->
<!-- #include file="admin/check_master.asp" -->
<%
flag=Trim(Request.QueryString("flag"))
user=request.Cookies("links")
id=Trim(Request.QueryString("id"))

if flag="1" then 
conn.execute("update links set ftbbs_pass='Y' where id="&id)
elseif flag="2" then
conn.execute("update links set ftbbs_pass='N' where id="&id)
elseif flag="3" then
conn.execute("delete from links where id="&id)
elseif flag="4" then
   set rs=conn.execute("select * from links where ftbbs_pass='Y' order by id desc")
   nlstr=""
   piclink=""
   br=""
   while not rs.eof
   if rs("ftbbs_class")=2 then
     piclink=piclink&"<a style=""line-height: 20px;"" href="&rs("ftbbs_url")&" target=""_blank""><img src="&rs("ftbbs_logo")&" border=0 width=88 height=31 alt="&rs("ftbbs_name")&"></a>&nbsp;"
   else
     nlstr=nlstr&"<a style=""line-height: 20px;"" href="&rs("ftbbs_url")&" target=""_blank"">"&rs("ftbbs_name")&"</a>&nbsp;"
   end if

   all=all&"<a style=""line-height: 20px;"" href="&server.HTMLEncode(rs(1))&" target=""_blank""><img src="&server.HTMLEncode(rs(0))&" border=0 width=88 height=31></a>  "
   rs.movenext
   wend
   rs.close
   if piclink<>"" then
      br="<br>"
   end if
   adnl="友情链接:&nbsp;"&nlstr&br&piclink&"&nbsp;<a class=map href=""sqlink.asp"">申请链接</a>"
   all="document.write('"&adnl&"');"
	   
'all="document.write('友情链接:"&all&"<a style=""line-height: 20px;"" href=""index.htm"">申请链接</a>');"
   path=Server.MapPath("ftlink.js")
   Set fso = Server.CreateObject("Scripting.FileSystemObject")
   set file1=fso.CreateTextFile(path,true)
   file1.writeline(all)
   file1.close
   set fso=nothing
   ttt="<font color=red>已经生成文件</font>"
end if
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from links order by ftbbs_pass, id desc"
rs.open sql,conn,1,1
if not rs.eof then
ars=rs.GetRows(-1)
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>友情链接管理后台</title>
<link href="css/xmwuye.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="2">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" bgcolor="#f6f6f6"> 
      <div align="center"><a href="?flag=4">生成JS文件</a> <a href="sqlink.htm">申请链接</a>&nbsp;<%=ttt %>以下是调用代码，放到网页中显示友情链接的位置 
      </div></td>
  </tr>
</table>


<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="1"><div align="center"></div></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" bgcolor="#f6f6f6"> 
      <div align="center">&lt;script language=&quot;JavaScript&quot; src=&quot;ftlink.js&quot;&gt;&lt;/script&gt;</div></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="1"><div align="center"></div></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td bgcolor="#f6f6f6"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><br>
            <% 
for i=0 to ubound(ars,2)
txt=""
if ars(1,i)="1" then
t="文字链接"
else
t="LOGO链接"
end if
if ars(9,i)="N" then
tt="<font color=red>审核中</font>"
elseif ars(9,i)="Y" then 
tt="已认证"
end if
txt="链接类型："&t&"<BR>网站名称："&server.HTMLEncode(ars(2,i))&"<BR>网站地址："&server.HTMLEncode(ars(3,i))&"<BR>LOGO地址："&server.HTMLEncode(ars(4,i))&"<BR>QQ 号码："&server.HTMLEncode(ars(5,i))&"<BR>邮箱地址："&server.HTMLEncode(ars(6,i))&"<BR>留 言："&server.HTMLEncode(ars(7,i))&"<BR>申请时间："&ars(8,i)&"<BR>状  态："&tt&"------<a href=?flag=1&id="&ars(0,i)&">通过</a> - <a href=?flag=2&id="&ars(0,i)&">未通过</a> - <a href=?flag=3&id="&ars(0,i)&">删除</a>"&chr(13)

Response.Write("<p>"&txt&"</p><HR size=1 color=ffffff>")
next
 %>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>