<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
else
if request.cookies("timesshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
end if
end if
%>
<title>友情链接管理</title>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6699cc">
  <tr> 
    <td align="center"><font color="#FFFFFF">管理合作伙伴</font></td>
  </tr>
  <tr> 
    <td height="99" valign="top" bgcolor="#FFFFFF"><br> 
      <%set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from links order by linkorder",conn,1,1
		dim i
		i=rs.recordcount%>
      <table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <tr height="20" bgcolor="#FFFFFF" align="center"> 
          <td width="26%">网站名称</td>
          <td width="42%">网站地址</td>
          <td width="9%">排 序</td>
          <td width="23%">操 作</td>
        </tr>
        <%if rs.eof and rs.bof then
		  response.write "还没有数据，请添加！"
		  else
		  do while not rs.eof%>
        <tr height="35" bgcolor="#FFFFFF" align="center"> 
          <form name="form1" method="post" action="savelinks.asp?action=edit&id=<%=rs("linkid")%>">
            <td><input name="linkname" type="text" id="linkname" value="<%=trim(rs("linkname"))%>" size="16"></td>
            <td><input name="linkurl" type="text" id="linkurl" value="<%=trim(rs("linkurl"))%>" size="26"></td>
            <td><input name="linkorder" type="text" id="linkorder" value=<%=rs("linkorder")%> size="3"></td>
            <td><input type="submit" name="Submit" value="修 改">
                &nbsp;&nbsp;<a href=savelinks.asp?action=del&id=<%=rs("linkid")%>><font color="#FF6600">删除</font></a> 
              </td>
          </form>
        </tr>
        <%rs.movenext
		  loop
		  end if
		  rs.close
		  set rs=nothing%>
      </table></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6699cc">
  <tr> 
    <td align="center"><font color="#FFFFFF">添加合作伙伴</font></td>
  </tr>
  <tr> 
    <form name="form2" method="post" action="savelinks.asp?action=add">
      <td height="98" bgcolor="#FFFFFF"> 
	  <table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr height="20" bgcolor="#FFFFFF" align="center"> 
            <td>网站名称</td>
            <td>网站地址</td>
            <td> 排 序</td>
            <td>操 作</td>
          </tr>
          <tr height="20" bgcolor="#FFFFFF" align="center"> 
            <td><input name="linkname1" type="text" id="linkname12" size="16"></td>
            <td><input name="linkurl1" type="text" id="linkurl12" size="26"></td>
            <td><input name="linkorder1" type="text" id="linkorder12" value=<%=i+1%> size="3"></td>
            <td><input type="submit" name="Submit2" value="添 加"></td>
          </tr>
        </table></td>
    </form>
  </tr>
</table>
<br>
<!--#include file="footer.asp"-->