<!--#include file="../include/hf_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%call checkmanage("02")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">

<%
action=request("ok")
piaofu=request("piaofu")
if action="" then 
Set rs = conn.Execute("select * from adv") 
if piaofu="" then piaofu=rs("piaofu")
%>


	<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
	<form action=adv6.asp method=post name=adv>
	
	<tr class=backs><td colspan=2 class=td height=18>飘浮广告设置</td></tr>


    <tr>
      <td width=20% align=right height="18">是否启动飘浮广告</td><td>
      <input type="radio" value="0" <%if piaofu=0 then %> checked<% end if%> name="piaofu"  onclick="javascript:location.href='adv6.asp?piaofu=0';">否 &nbsp; <input type="radio" value="1" <%if piaofu=1 then %> checked<% end if%>  name="piaofu"  onclick="javascript:location.href='adv6.asp?piaofu=1';">是</td>
    </tr>
<%
if piaofu=1 then
%>
	
    <tr>
      <td width=20% align=right height="18">图片文件名</td><td> <input type=text value="<%=rs("piaofupic")%>" name=piaofupic size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=piao&frmname=piaofupic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
	
    <tr>
      <td width=20% align=right height="18">链接</td><td> <input type=text value="<%=rs("piaofuurl")%>" name=piaofuurl size=40 maxlength=100></td>
    </tr>
	
    <tr>
      <td width=20% align=right height="18">说明</td><td> <input type=text value="<%=rs("piaofutit")%>" name=piaofutit size=40 maxlength=100></td>
    </tr>
<%
end if
%>

	<tr><td colspan=2>
<INPUT name="ok" TYPE="hidden" value="ok"><INPUT name=action TYPE="submit" value="保存设置"></td></tr>
</form></table>
	<%
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing
end if%>

<%              
if action="ok" then

      if request("piaofu")<>0 then

	if trim(request.form("piaofupic"))="" then
	  response.write "<script language='javascript'>"
	  response.write "alert('填写不完整或者不符合要求，单击“确定”返回上一页！');"
	  response.write "location.href='javascript:history.go(-1)';"
	  response.write "</script>"
	  response.end
	end if

	piaofupic=request.form("piaofupic")
	piaofupic=split(piaofupic,".")
	n=UBound(piaofupic)
	if LCase(piaofupic(n))<>"jpg" and LCase(piaofupic(n))<>"gif"  then
	  response.write "<script language='javascript'>"
	  response.write "alert('您填写的图片格式不正确，单击“确定”返回上一页！');"
	  response.write "location.href='javascript:history.go(-1)';"
	  response.write "</script>"
	  response.end
	end if

      end if

     Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from adv"
	 rs.open sql,conn,1,3

 	 rs("piaofu")=request.form("piaofu")
	if request("piaofu")<>0 then
 	 rs("piaofupic")=trim(request.form("piaofupic"))
 	 rs("piaofutit")=trim(request.form("piaofutit"))
 	 rs("piaofuurl")=trim(request.form("piaofuurl"))
	end if

	rs.update
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing

	response.write "<script language='javascript'>"
	response.write "alert('飘浮广告图片设置成功！');"
	response.write "location.href='adv6.asp';"
	response.write "</script>"
	response.end
end if%>

</body>
</html>

