<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#INCLUDE FILE="config.asp"-->
<%
flag=Trim(Request.QueryString("flag"))
if flag="0" then
if Trim(Request.Form("user"))=mm then
response.Cookies("myoe_links")="http://www.yesitis.cn"
response.Cookies("myoe_links").expires=now()+100
end if
end if
user=request.Cookies("myoe_links")
id=Trim(Request.QueryString("id"))


set conn=server.createobject("ADODB.CONNECTION")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("links.mdb")
conn.open connstr

if flag="1" then 
conn.execute("update myoe_links set myoe_pass='Y' where id="&id)
elseif flag="2" then
conn.execute("update myoe_links set myoe_pass='N' where id="&id)
elseif flag="5" then 
conn.execute("update myoe_links set myoe_class='2' where id="&id)
elseif flag="6" then 
conn.execute("update myoe_links set myoe_class='1' where id="&id)

elseif flag="3" then
conn.execute("delete from myoe_links where id="&id)
elseif flag="4" then
set rs=conn.execute("select myoe_logo,myoe_url from myoe_links where myoe_pass='Y' and myoe_class='2' order by id asc")
while not rs.eof
i=i+1
if i>100 then
i=0
all=all&"<BR>"
end if
all=all&"<a 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
all=all&"<BR>"
set rs=conn.execute("select myoe_name,myoe_url from myoe_links where myoe_pass='Y' and myoe_class='1' order by id asc")
while not rs.eof
all=all&"<a href="&server.HTMLEncode(rs(1))&" target=""_blank"">"&server.HTMLEncode(rs(0))&"</a> | "
rs.movenext
wend
rs.close
all="document.write('"&all&"');"
path=Server.MapPath("links.js")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set file1=fso.CreateTextFile(path,true)
file1.writeline(all)
file1.close
set fso=nothing
ttt="<font color=ff0088>已经生成 JS 文件</font>"
end if
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from myoe_links order by myoe_pass, id desc"
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then
	ars=rs.GetRows(-1)
	Flag="True"
else
	Flag = "False"
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>

<style type="text/css">
<!--
-->
</style>
<link href="../admin/admincss.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE2 {color: #FF0000}
.STYLE3 {color: #FFFFFF}
-->
</style></head>

<body background="*.gif">
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#7B869A">
  <tr>
    <td height="24" align="center"><strong><span class="style4 STYLE3">友情链接管理</span></strong></td>
  </tr>
  <tr>
    <td height="99" valign="top" bgcolor="#FFFFFF"><br>
    <table width="80%" border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td height="25" align="right" background="../admin/images/topbg.gif"><a href="?flag=4">生成 JS 文件</a> <a href="play.htm" target="_blank"></a> <%=ttt %> <a href="index.asp">添加连接</a></td>
      </tr>
    </table>
    <table width="80%" border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td height="25" align="right" background="../admin/images/topbg.gif"><span class="STYLE2"><strong>百尔买特别提醒：请在对友情链接作任何操作后，必须点击“<a href="?flag=4">生成 JS 文件</a>  <%=ttt %>”您的操作才为有效</strong></span></td>
      </tr>
    </table>
    <table width="80%" border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td width="6%" height="25" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>图标</strong></td>
        <td width="6%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>邮箱</strong></td>
        <td width="11%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>状态</strong></td>
        <td width="11%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>状态操作</strong></td>
        <td width="7%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>发布</strong></td>
        <td width="8%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>不发布</strong></td>
        <td width="7%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>删除</strong></td>
        <td width="6%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>修改</strong></td>
        <td width="38%" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>网站名称</strong></td>
      </tr>
	  <%
	  if Flag = "True" then
	  for i=0 to ubound(ars,2)
	  txt=""

if ars(1,i)="1" then
t="<font color=009900>文字连接</font>" 

else
t="<font color=ff8800>图标连接</font>"
end if

if ars(10,i)="N" then
tt="- <font color=ff0088>※ 等待审核中 ※</font>"
elseif ars(10,i)="Y" then 
tt=""
end if

if ars(1,i)="1" then
	  %>
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td height="25" align="center" bgcolor="#FFFFFF"><a href="<%=server.HTMLEncode(ars(4,i))%>" title="<%=server.HTMLEncode(ars(4,i))%>" target="_blank"><img src="../admin/images/linkspic1.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="mailto:<%=server.HTMLEncode(ars(6,i))%>" title="<%=server.HTMLEncode(ars(6,i))%>" target="_blank"><img src="../admin/images/linkspic2.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><%=t%></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=5&id=<%=ars(0,i)%>">改为图标</a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=1&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic3.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=2&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic4.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=3&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic5.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="admin.asp?id=<%=ars(0,i)%>"><img src="../admin/images/linkspic6.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><%response.write "<font color=ff0088>网名：</font><a href="&server.HTMLEncode(ars(3,i))&" target=""_blank"" title="&server.HTMLEncode(ars(3,i))&">"&server.HTMLEncode(ars(2,i))&"</a>  "&tt&" "&chr(13)%></td>
      </tr>
<%else%>	  
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td height="25" align="center" bgcolor="#FFFFFF"><a href="<%=server.HTMLEncode(ars(4,i))%>" title="<%=server.HTMLEncode(ars(4,i))%>" target="_blank"><img src="../admin/images/linkspic1.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="mailto:<%=server.HTMLEncode(ars(6,i))%>" title="<%=server.HTMLEncode(ars(6,i))%>" target="_blank"><img src="../admin/images/linkspic2.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><%=t%></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=6&id=<%=ars(0,i)%>">改为文字</a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=1&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic3.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=2&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic4.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="?flag=3&id=<%=ars(0,i)%>"><img src="../admin/images/linkspic5.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><a href="admin.asp?id=<%=ars(0,i)%>"><img src="../admin/images/linkspic6.gif" width="15" height="16" border="0"></a></td>
        <td align="center" bgcolor="#FFFFFF"><%response.write "<font color=ff0088>网名：</font><a href="&server.HTMLEncode(ars(3,i))&" target=""_blank"" title="&server.HTMLEncode(ars(3,i))&">"&server.HTMLEncode(ars(2,i))&"</a>  "&tt&" "&chr(13)%></td>
      </tr>
<%
end if
next
else
%>
      <tr height="20" bgcolor="#F7F7F7" align="center">
        <td height="25" colspan="9" align="center" background="../admin/images/topbg.gif" bgcolor="#F7F7F7"><strong>暂时没有数据！</strong><strong></strong></td>
        </tr>
<%
end if
%>	  
    </table></td>
  </tr>
</table>
</html>   
