<%@language=VBScript.Encode codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="application.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
IF Trim(Request("action"))="Edit" then
   ID     =Trim(Request("ID"))
   LinkName  =Trim(Request("LinkName"))
   LinkUrl=Trim(Request("LinkUrl"))
   LinkFile=Trim(Request("FileName"))
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from Link where ID="&ID,conn,1,3
   If not rs.eof then
      Rs("LinkName")=LinkName
	  Rs("LinkUrl")=LinkUrl
	  Rs("LinkFile")=LinkFile
   Rs.update
   Rs.close:set Rs=nothing
   Response.Redirect("Link.asp")
   End if
End If

dim rs,ID
dim sql
ID=Trim(Request("ID"))
set rs=server.createobject("adodb.recordset")
sql = "select * from Link where ID="&ID
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
function CheckForm()
{
	if (document.myform.LinkName.value.length == 0) {
		alert("链接名称没有填写.");
		document.myform.LinkName.focus();
		return false;
	}
	return true;    
	if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
    else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

}
</script>
<!-- #include file="Inc/Head.asp" -->

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
   
    <td align="center" valign="top"><table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
      <form method="POST" name="myform" onSubmit="return CheckForm();" action="LinkEdit.asp?action=Edit" target="_self">
        <input type="hidden" value="<%=ID%>" name="ID">
        <tr>
          <td class="back_southidc" height="30" colspan="3" align="center">编辑友情链接</td>
        </tr>
        <tr bgcolor="#ECF5FF">
          <td width="119" height="25" align="right"><font color="#FF0000">*</font>链接名称：</td>
          <td colspan="2"><input name="LinkName" value="<%=rs("LinkName")%>" type="text" class="input" size="30" maxlength="50"></td>
        </tr>
		<tr bgcolor="#ECF5FF"> 
            <td width="125" height="25" align="right"><font color="#FF0000">*</font>链接地址：</td>
            <td colspan="2"><input name="LinkUrl" value="<%=rs("LinkUrl")%>" type="text" class="input" size="30" maxlength="50"></td>
        </tr>
        <tr bgcolor="#ECF5FF">
          <td height="25" align="right"><font color="#FF0000">*</font>链接Logo：</td>
          <td width="218"><input name="FileName" type="text" value="<%=Rs("LinkFile")%>" class="input" size="30">&nbsp;</td>
          <td width="603"><iframe frameborder="0" height="22" name="UpLoad" scrolling="no" src="Upload_Photo.asp"></iframe></td>
        </tr>
        <tr>
          <td height="30" colspan="3" align="center" bgcolor="#ECF5FF"><input type="submit" name="Submit" value="提交" class="input">
            
            <input type="reset" name="Submit" value="重置" class="input">          </td>
        </tr>
      </form>
    </table></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->