<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="Class_Checkuser.asp"-->
<!--#INCLUDE FILE="Class_Top.asp" -->
<!--#INCLUDE FILE="inc/Md5.asp" -->
<!--#INCLUDE FILE="inc/validate.asp" -->
<!--#INCLUDE FILE="inc/HTMLEncode.asp" -->
<%
locat="删除友情链接信息"
Call top(1,1)
dim ID,Action,FoundErr,ErrMsg
ID=trim(request("ID"))
Action=trim(request("Action"))
if ID="" then
	call EndConnection()
	response.redirect "FriendSite.asp"
end if
dim sqlLink,rsLink
sqlLink="select * from FriendSite where ID=" & CLng(ID)
set rsLink=Server.CreateObject("Adodb.RecordSet")
rsLink.open sqlLink,conn,1,3
if rsLink.bof and rsLink.eof then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>找不到站点！</li>"
else
  	if Action="Del" then
		dim OldSitePassword
		OldSitePassword=trim(request("OldSitePassword"))
		if OldSitePassword="" then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>旧网站密码不能为空！</li>"
		end if
		if md5(OldSitePassword)<>rsLink("SitePassword") then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>你输入的旧网站密码不对，没有权限删除！</li>"
		end if
		if FoundErr<>True then
			rsLink.delete
			rsLink.update
			rsLink.close
			set rsLink=nothing
			call EndConnection()
			Response.Redirect "FriendSite.asp"
		end if
	end if
end if
if FoundErr=True then
	Call Error("Information",ErrMsg)
else
%>
<script LANGUAGE="javascript">
<!--
function Check() {
if (document.AddLink.OldSitePassword.value=="")
	{
	  alert("请输入旧网站密码！")
	  document.AddLink.OldSitePassword.focus()
	  return false
	 }
}

//-->
</script>
<form method="post" name="AddLink" onsubmit="return Check()" action="FriendSiteDel.asp">
  <table border="0" cellpadding="2" cellspacing="1" align="center" width="90%">
    <tr> 
      <th height="22" colspan="2"><strong>删除友情链接信息</strong></th>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">链接类型：</td>
      <td width="580" height="25">
	  <%
	  if rsLink("LinkType")=1 then
	  	response.write "Logo链接"
	  else
	  	response.write "文字链接"
	  end if
	  %></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">网站名称：</td>
      <td height="25"><%=rsLink("SiteName")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">网站地址：</td>
      <td height="25"><%=rsLink("SiteUrl")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">网站Logo：</td>
      <td height="25"><%=rsLink("LogoUrl")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">站长姓名：</td>
      <td height="25"><%=rsLink("SiteAdmin")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">电子邮件：</td>
      <td height="25"><%=rsLink("Email")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" align="right">网站简介：</td>
      <td valign="middle"><%=rsLink("SiteIntro")%></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td width="312" height="25" align="right">原网站密码：</td>
      <td height="25"><input name="OldSitePassword" type="password" id="OldSitePassword" size="20" maxlength="20"> 
        <font color="#FF0000">* 必须输入</font></td>
    </tr>
    <tr bgcolor=#ecf2fc> 
      <td height="40" colspan="2" align="center"><input name="ID" type="hidden" id="ID" value="<%=rsLink("ID")%>"> 
        <input name="Action" type="hidden" id="Action" value="Del"> <input type="submit" value=" 确 定 " name="cmdOk"> 
      </td>
    </tr>
  </table>
  </form>
<%
end if
rsLink.close
set rsLink=nothing
call footer()
%>