<!--#include file="conn.asp"-->
<!--#include file="common.asp"-->
<!--#include file="md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="css.css" type=text/css rel=stylesheet>
<%
if session("S_username")="" or session("S_userid")="" then
	Errmsg = Errmsg+"<li>您没有登录,或登录超时。"
	Call ErrList(Errmsg)
	response.end
end if
%>

<%
if request("Operate")<>"" then
	ID=cint(request("ID"))
	Select case Request("Operate")
		case "3"   ' "禁止"
			sql="update link set Status=1 where ID="&ID
			conn.execute (sql)
			response.write "<script>alert('操作成功!');opener.document.URL=""admin.asp"";</script>"
		case "4"   ' "删除"
			sql="delete from link where ID="&ID
			conn.execute (sql)
			response.write "<script>alert('操作成功!');opener.document.URL=""admin.asp"";window.close();</script>"
			response.end
	end Select
end if

%>

<%
dim ID
ID=cint(request("ID"))
dim username
dim useremail
dim jointime
dim Y_SiteName
dim Y_SiteURL
dim Y_Logo
dim Y_Alt
dim Y_MyLink
dim PR
dim PRDate
dim Alexa
dim AlexaDate

dim goin
dim goinToday
dim goout
dim gooutToday
dim IsVerify
dim Isfixed
dim Status

sql="select * from link where ID="&ID
set rs=conn.execute (sql)
if not rs.eof then
	username=rs("username")
	useremail=rs("email")
	Y_SiteName=rs("Y_SiteName")
	Y_SiteURL=rs("Y_SiteURL")
	Y_Logo=rs("Y_Logo")
	Y_Alt=rs("Y_Alt")
	Y_MyLink=rs("Y_MyLink")
	PR=rs("PR")
	PRDate=rs("PRDate")
	Alexa=rs("Alexa")
	AlexaDate=rs("AlexaDate")
	
	goin=rs("goin")
	goinToday=rs("goinToday")
	goout=rs("goout")
	gooutToday=rs("gooutToday")
	IsVerify=rs("IsVerify")
	Isfixed=rs("Isfixed")
	Status=rs("Status")
	rs.close
end if

'第二步,判断是否已经添加了我站链接代码
url=Y_MyLink
wstr=getHTTPPage(url,"utf-8") 

dim IsTurnOff
if not Instr(lcase(wstr),lcase("<a href=""http://"&request.ServerVariables("HTTP_HOST")&replace(request.ServerVariables("URL"),"check2.asp","linkforward.asp")))>0 then
	IsTurnOff=1
else
	IsTurnOff=0		
end if


dim SiteName
dim SiteURL
dim MasterName
dim Email
dim PageWidth
dim Unit
sql="select * from setting"
set rs=conn.execute (sql)
if not rs.eof then
	SiteName=rs("SiteName")
	SiteURL=rs("SiteURL")
	MasterName=rs("MasterName")
	Email=rs("Email")
	PageWidth=rs("PageWidth")
	Unit=rs("Unit")
	rs.close
end if

function ReWriteUrl(UrlStr,Length)
	if len(UrlStr)>Length and Length>1 then
		dim LeftLength
		dim RightLength
		dim LeftStr
		dim RightStr
		
		LeftLength=Int(Length*3/4)
		if LeftLength=0 then LeftLength=1
		RightLength=Length-LeftLength
		LeftStr=Left(UrlStr,LeftLength)
		if RightLength>0 then
			RightStr=Right(UrlStr,RightLength)
		end if
		ReWriteUrl=LeftStr&"..."&RightStr
	else
		ReWriteUrl=UrlStr
	end if
end function
%>
<script>
function submitform(Num){
	var CurrForm=form1;
	CurrForm.action="check2.asp";
	CurrForm.Operate.value=Num;
	CurrForm.method="post";
	CurrForm.submit();
}
</script>
<title><%response.write SiteName&"-自助友情链接系统 V1.7 - Power By DATA100.NET"%></title>
</head>
<body>
<table  border="0" align="center" cellpadding="0" cellspacing="0" width="<%=PageWidth&Unit%>">
  <tr>
    <td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#698CC3">
  <form id="form1" name="form1" method="post">
    <tr>
      <td bgcolor="#FFFFFF"><table width="100%" height="2"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td></td>
          </tr>
        </table>
          <table width="99%" height="30"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="698cc3" class="title">
            <tr>
              <td><%response.write "&nbsp;<a class=""atitle"" href="""&SiteURL&""" target=_blank>"&SiteName&"</a>-自助友情链接系统 V1.7-检查对方是否单方撤链"%></td>
              <td align="right">&nbsp;</td>
            </tr>
          </table>
          <table width="100%" height="2"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td></td>
            </tr>
          </table>
          <!--显示与隐藏的表格-->
          <table width="99%"  border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="d6e0ef" style="display:" id="Tab3">
            <tr bgcolor="#FFFFFF">
              <td width="30%" height="20">站点名称:</td>
              <td width="70%"><a href="<%=Y_SiteUrl%>" title="<%=Y_SiteUrl%>" target=_blank><%=Y_SiteName%></a></td>
            </tr>
            <tr bgcolor="#FFFFFF">
              <td height="20">站点注册链接:</td>
              <td><a href="<%=Y_SiteUrl%>" target=_blank title="<%=Y_SiteUrl%>"><%=ReWriteUrl(Y_SiteUrl,30)%></a></td>
            </tr>
			  <tr bgcolor="#FFFFFF">
				<td height="20">链接所在页面:</td>
				<td><a href="<%=Y_MyLink%>" target=_blank title="<%=Y_MyLink%>"><%=ReWriteUrl(Y_MyLink,30)%></a></td>
			  </tr>
			  <tr bgcolor="#FFFFFF">
				<td height="20">是否单方撤链:</td>
				<td>
				<%
				if IsTurnOff=1 then response.write "<font color=red>对方<strong>已经</strong>撤消我站链接</font>"
				if IsTurnOff=0 then response.write "<font color=green>对方<strong>未</strong>撤消我站链接,合作愉快</font>"
				%> 
				<input name="ID" type="hidden" id="ID" value="<%=ID%>">
				<input name="Operate" type="hidden" id="Operate"></td>
			  </tr>
			  <tr align="right" bgcolor="#FFFFFF">
              <td height="20" colspan="2">
			  <%if IsTurnOff=1 then %>&nbsp; 
			  <%if Status<>1 then%>
			  <input type="button" name="Submit" value=" 禁 止 " onClick="submitform(3)">&nbsp; 
			  <%end if%>
              <input type="button" name="Submit" value=" 删 除 " onClick="submitform(4)">&nbsp; 
              <%end if%>
	          <input type="button" name="Submit" value=" 关闭窗口 " onClick="window.close()">&nbsp;</td>
            </tr>
          </table>
          
		  <!--显示与隐藏的表格-->
          <table width="100%" height="2"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td></td>
            </tr>
        </table></td>
    </tr>
  </form>
</table>
</td></tr></table>
</body>
</html>
