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

<!--#include file="Config.asp"-->
<!--#include file="admin.asp"-->
<%id=request.Querystring("id")
classs=request.Querystring("class")
dim rs,sql,p
p=request.Querystring("p")
if p="" then p=1
set Rs=Server.CreateObject("ADODB.Recordset")
Sql="select * from [link] Where ID="&ID
Rs.open Sql,conn,2,3%>
<%if p=1 then
call saycardd("友链修改")

if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""Edit_link.asp?sid="&sid&"&amp;class="&classs&"&amp;id="&id&"&amp;p=2&amp;saytk="&saytk&""">"%>
友链名称:<input name="name" value="<%=usb(rs("name"))%>"/><br/>
友链简称:<input name="namt" value="<%=usb(rs("namt"))%>"/><br/>
网站地址:<input name="url" value="<%=usb(rs("url"))%>"/><br/>
网站简介:<input name="jian" value="<%=usb(rs("jian"))%>"/><br/>
网站链入:<input name="brin" value="<%=usb(rs("YD_in"))%>"/><br/>
网站链出:<input name="brout" value="<%=usb(rs("YD_out"))%>"/><br/>
<input type="submit" name="Submit" value="修改友链"></form><br/>
<%else%>
友链名称:<input name="name<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("name"))%>"/><br/>
友链简称:<input name="namt<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("namt"))%>"/><br/>
网站地址:<input name="url<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("url"))%>"/><br/>
网站简介:<input name="jian<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("jian"))%>"/><br/>
网站链入:<input name="brin<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("YD_in"))%>"/><br/>
网站链出:<input name="brout<%=minute(now)%><%=second(now)%>" value="<%=usb(rs("YD_out"))%>"/><br/>
<anchor>修改友链
<go href="Edit_link.asp?sid=<%=sid%>&amp;class=<%=classs%>&amp;id=<%=id%>&amp;p=2&amp;saytk=<%=saytk%>" method="post" accept-charset="utf-8">
<postfield name="name" value="$(name<%=minute(now)%><%=second(now)%>)"/>
<postfield name="namt" value="$(namt<%=minute(now)%><%=second(now)%>)"/>
<postfield name="url" value="$(url<%=minute(now)%><%=second(now)%>)"/>
<postfield name="jian" value="$(jian<%=minute(now)%><%=second(now)%>)"/>
<postfield name="brin" value="$(brin<%=minute(now)%><%=second(now)%>)"/>
<postfield name="brout" value="$(brout<%=minute(now)%><%=second(now)%>)"/>
</go></anchor><br/><%end if%>
<a href="Admin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>&amp;p=2&amp;saytk=<%=saytk%>">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[分类管理]</a><br/>
<a href='Admin_index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>[友链后台]</a><br/>
<a href="../class.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[设计中心]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<% 
call headsay()%>
<%elseif p=2 then
call saycardd("友链修改结果")
dim name,namt,url,jian,brin,brout
name=Request.Form("name")
namt=Request.Form("namt")
URL=Request.Form("URL")
jian=Request.Form("jian")   
brin=Request.Form("brin")  
brout=Request.Form("brout")   
if name=""  then 
  Call Error("网站名称不能为空！")
  end if
  if namt=""  then 
  Call Error("网站简称不能为空！")
  end if
  if len(namt)>2 then
    Call Error("网站简称最多2字！")
  end if
if URL=""  then 
  Call Error("网站地址不能为空！")
  end if

if brin="" or IsNumeric(brin)=False then
  Call Error("链入数无效！")
  end if
if brout="" or IsNumeric(brout)=False then
  Call Error("链出数无效！")
  end if

if not (rs.bof and rs.eof) then
rs("name")=name
rs("namt")=namt
rs("URL")=URL
rs("jian")=jian 
rs("YD_in")=brin
rs("YD_out")=brout                                       
	rs.update()
Response.Write "成功修改友链！<br/>"			
end if	
%>
<a href="Admin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>&amp;saytk=<%=saytk%>">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[分类管理]</a><br/>
<a href='Admin_index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>[友链后台]</a><br/>
<a href="../class.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[设计中心]</a><br/>
<a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">[后台管理]</a>
<%call headsay()%><%END IF%><%call ALLClose()%>
