<!--#include file="conn.asp"-->

<!--#include file="admin.asp"-->

<%
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * FROM links Order BY id",Conn,1,1

if Request.QueryString("no")="yes" then
id= Trim(Request("id"))
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "DELETE FROM links Where id="&id,Conn,2,3,1

Set Rs= Nothing
Set Conn = Nothing
Response.Redirect "Manage_Link.asp"
end if

if Request.QueryString("mark")="southidc" then
LinkType=request.form("LinkType")
note=request.form("note")
link=request.form("link")
name=request.form("name")
LogoUrl=request.form("LogoUrl")

If name=""  or note="http://"Then
Response.Write("<script language=""JavaScript"">alert(""错误：您没输入网站名称，请返回检查！！"");history.go(-1);</script>")
response.end
end if

If note=""  or note="http://"Then
Response.Write("<script language=""JavaScript"">alert(""错误：您没输入图标连接，请返回检查！！"");history.go(-1);</script>")
response.end
end if

If link="" or link="http://" Then
Response.Write("<script language=""JavaScript"">alert(""错误：您没有输入超连接，请返回检查！！"");history.go(-1);</script>")
response.end
end if

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from links "
rs.open sql,conn,1,3
rs.addnew
rs("LinkType")=LinkType
rs("name")=name
rs("note")=note
rs("link")=link
rs("LogoUrl")=LogoURl

rs.update
Response.Redirect "Manage_Link.asp"
end if
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <strong><br>
      </strong> <table width="560" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <tr> 
          <td height="25" class="back_southidc"> 
            <div align="center"><strong>友情链接管理</strong></div></td>
        </tr>
        <tr> 
          <form method="post" action="Manage_Link.asp?mark=southidc">
            <td> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#ECF5FF">
                
				<tr> 
      <td width="21%" height="22" bgcolor="#A4B6D7"><div align="center">链接类型</div></td>
      <td height="79%"><input name="LinkType" type="radio" value="1" checked>
        Logo链接&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" name="LinkType" value="2">
        文字链接</td>
    </tr>
				
				
				
				<tr> 
                  <td width="21%" height="22" bgcolor="#A4B6D7"> 
                    <div align="center">网站名称</div></td>
                  <td width="79%">
<input type="text" name="name" size="35" maxlength="40">
                  </td>
                </tr>
                <tr> 
                  <td height="22" bgcolor="#A4B6D7">
<div align="center">网站说明</div></td>
                  <td>
<input type="text" name="note" size="50" maxlength="120">
                  </td>
                </tr>
                <tr> 
                  <td height="22" bgcolor="#A4B6D7"> 
                    <div align="center">连接地址</div></td>
                  <td>
<input type="text" name="link" size="40" maxlength="50" value="http://">
                  </td>
                </tr>
				
				<tr> 
                  <td height="22" bgcolor="#A4B6D7"> 
                    <div align="center">网站LOGO</div></td>
                  <td>
                    <input type="text" name="LogoUrl" size="40" maxlength="70" value="http://">
</td>
                </tr>
				
                <tr bgcolor="#A4B6D7"> 
                  <td height="30" colspan="2"> 
                    <div align="center"> 
                      <input type="submit" name="Submit" value="提交">
                      <input type="reset" name="Submit2" value="重置">
                    </div></td>
                </tr>
              </table>
              <br> 
              <table width="100%" border="0" cellspacing="2" cellpadding="3">
                <tr bgcolor="#ECF5FF"> 
                  <td width="22%" height="25"> 
                    <div align="center">网站名称</div></td>
                  <td width="46%" bgcolor="#ECF5FF"> 
                    <div align="center">网站说明</div></td>
                  <td width="14%"> 
                    <div align="center">加入时间</div></td>
                  <td width="9%"> 
                    <div align="center">操作</div></td>
                  <td width="9%"> 
                    <div align="center">操作</div></td>
                </tr>
                <% do while not Rs.eof %>
                <tr bgcolor="#ECF5FF"> 
                  <td height="22"> 
                    <div align="center"><a href="<%=Rs("link")%>" target="_blank"><%=rs("name")%></a></div></td>
                  <td> 
                    <div align="center"><%=Rs("note")%></div></td>
                  <td> 
                    <div align="center"><%= FormatDateTime(rs("time"),2) %></div></td>
                  <td> 
                    <div align="center"><a href="Manage_editlink.asp?id=<%=Rs("id")%>">修改</a></div></td>
                  <td> 
                    <div align="center"><a href="Manage_Link.asp?id=<%=Rs("id")%>&amp;no=yes">删除</a></div></td>
                </tr>
                <%Rs.MoveNext 
loop 
%>
              </table>
<%  
Set Rs = Nothing 
Set Conn = Nothing 
%> </td>
          </form>
        </tr>
        <tr> 
          <td>首页最多可显示10条友情链接</td>
        </tr>
      </table></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->