<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<HTML>
<HEAD>
<TITLE>修改友情链接</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>
<script>
function check(obj){
	if(obj.title.value==""){
		alert('网站名称不能为空!');
		obj.title.focus();
		return false;
	}
	if(obj.siteurl.value==""){
		alert('网站地址不能为空!');
		obj.siteurl.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p08")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim id,act,flag,title,siteurllink,sitepic
id=Clng(request("id"))
act=request.QueryString("act")

if(act="mod") then
	flag=cint(request.Form("flag"))
	title=trim(request.Form("title"))
	siteurllink=trim(request.Form("siteurl"))
	sitepic=request.Form("sitepic")	
	call Addflink()
	response.Write("<p align=""center"">成功修改友情链接~!</p>")
	response.Write("<p align=""center""><br><a href=flink_manage.asp>返回</a></p>")
else
	set rs=server.createobject("adodb.recordset")
	sql="select * from friendlink where id="&id&" order by id desc "
	rs.open sql,conn,3,1
	if not rs.eof then
%>
<FORM method="POST" name="form1" action="flink_modi.asp?act=mod" style="margin:0 0 0 0;" onSubmit="return check(this)">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#F5F5F5">
  <TD height="20" colspan="2" bgcolor="#FF9900"><div align="center" class="style1">修改友情链接</div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="center">链接类型：</div></TD>
  <TD><select name="flag" id="flag">
    <option value="0" <%if(rs("Flag")=0) then response.Write("selected") end if%>>文字链接</option>
    <option value="1" <%if(rs("Flag")=1) then response.Write("selected") end if%>>图片链接</option>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD width="14%"><div align="center">网站标题：</div></TD>
  <TD width="86%"><input name="title" type="text" id="title" size="30" value="<%=rs("Title")%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="center">网站地址：</div></TD>
  <TD><div align="left">
    <input name="siteurl" type="text" id="siteurl" size="50" value="<%=rs("LinkUrl")%>">
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="center">网站图片：</div></TD>
  <TD><div align="left">
    <input name="sitepic" type="text" id="sitepic" size="50" value="<%=rs("Pic")%>">
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
	<input type="hidden" name="id" value="<%=id%>">
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
	rs.close
	set rs=nothing
	end if
end if
sub Addflink
	set rs=server.createobject("adodb.recordset")
	sql="select * from friendlink where id="&id&" order by id desc "
	rs.open sql,conn,3,3	
	rs("Flag")=flag
	rs("Title")=title
	rs("LinkUrl")=siteurllink
	rs("Pic")=sitepic	
	rs.update
	rs.close
	set rs=nothing
end sub
%>
</BODY>
</HTML>
<%
call connclose()
%>