<!--#include file="../include/config.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("02")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">

<%
action=request("ok")
flash=request("flash")
if action="" then 
Set rs = conn.Execute("select * from adv") 
if flash="" then flash=rs("flash")
%>
<table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR>
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　</font><font color="#FF0000"><strong>Flash广告设置（大小：294×213）</strong></font><font color="#000000">&nbsp;</font></TD>
      <TD bgColor=#f4f5fd height=30>&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
		  <table height="5"><tr><td></td></tr></table>

	
  <table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
  <form action=adv_flash.asp method=post name=adv>
  <tr bgcolor="#FFFFFF">
      <td width=20% align=right height="18">Flash图片</td>
      <td> <input type=text value="<%=rs("flashurl")%>" name=flashurl size=40 maxlength=100> 
        <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=bannerflash&frmname=flashurl','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
  <tr bgcolor="#FFFFFF">
      <td colspan=2> <INPUT name="ok" TYPE="hidden" value="ok">
        <INPUT name="flash" TYPE="hidden" id="flash" value="1">
        <INPUT name="flashwidth" TYPE="hidden" id="flashwidth" value="294">
        <INPUT name="flashheight" TYPE="hidden" id="flashheight" value="213"> 
        <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 flash=1 then
	if trim(request.form("flashurl"))="" then er=1
	if not isNumeric(request.form("flashwidth")) or not isNumeric(request.form("flashheight")) then er=3

	flashurl=request.form("flashurl")
	flashurl=split(flashurl,".")
	n=UBound(flashurl)
	if LCase(flashurl(n))<>"swf" then er=2

	elseif flash=0 then
	if trim(request.form("hfpic"))="" or trim(request.form("bannerxiaoguo"))="" then er=1

	IF not isNumeric(request.form("bannerxiaoguo_top")) then er=3

	hfpic=request.form("hfpic")
	hfpic=split(hfpic,".")
	n=UBound(hfpic)
	if LCase(hfpic(n))<>"jpg" and LCase(hfpic(n))<>"gif"  then er=2

	end if



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

	if er=2 then
	response.write "<script language='javascript'>"
	response.write "alert('出错了，您填写的图片格式不正确，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if

	if er=3 then
	response.write "<script language='javascript'>"
	response.write "alert('出错了，宽高尺寸、位置等要求填写数字，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if


     Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from adv"
	 rs.open sql,conn,1,3
 	 rs("flash")=request.form("flash")
	if flash=1 then
 	 rs("flashurl")=trim(request.form("flashurl"))
 	 rs("flashwidth")=trim(request.form("flashwidth"))
 	 rs("flashheight")=trim(request.form("flashheight"))
	elseif flash=0 then
 	 rs("hfpic")=trim(request.form("hfpic"))
 	 rs("hfurl")=trim(request.form("hfurl"))
 	 rs("hftit")=trim(request.form("hftit"))
	 rs("bannerxiaoguo")=trim(request.form("bannerxiaoguo"))
	 rs("bannerxiaoguo_top")=trim(request.form("bannerxiaoguo_top"))
	end if

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

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

</body>
</html>

