<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
%>
<!--#include file="../include/config.asp"-->

<script language=javascript src=../include/mouse.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")
if action="" then 
Set rs = conn.Execute("select * from adv") 
%><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">　<B><font color="#FF0000">&nbsp;中间4副广告图片（大小：102×102）</font></B></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=adv5.asp method=post name=adv>

    <tr bgcolor="#f4f5fd" class=backs> 
      <td height=18 colspan=2 class=td>第一副广告图片</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% height="18" align=right>JPG/GIF图片</td>
      <td> <input type=text value="<%=rs("hf2pic")%>" name=hf2pic size=40 maxlength=100> 
        <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner2&frmname=hf2pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% height="18" align=right>链接</td>
      <td> <input type=text value="<%=rs("hf2url")%>" name=hf2url size=40 maxlength=100></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% height="18" align=right>说明</td>
      <td> <input type=text value="<%=rs("hf2tit")%>" name=hf2tit size=40 maxlength=100></td>
    </tr>
	<tr bgcolor="#f4f5fd" class=backs>
      <td height=18 colspan=2 class=td>第二副广告图片</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>JPG/GIF图片</td><td> <input type=text value="<%=rs("hf3pic")%>" name=hf3pic size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner3&frmname=hf3pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>链接</td><td> <input type=text value="<%=rs("hf3url")%>" name=hf3url size=40 maxlength=100></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>说明</td><td> <input type=text value="<%=rs("hf3tit")%>" name=hf3tit size=40 maxlength=100></td>
    </tr>
	<tr bgcolor="#f4f5fd" class=backs>
      <td height=18 colspan=2 class=td>第三副广告图片</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>JPG/GIF图片</td><td> <input type=text value="<%=rs("hf4pic")%>" name=hf4pic size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner4&frmname=hf4pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>链接</td><td> <input type=text value="<%=rs("hf4url")%>" name=hf4url size=40 maxlength=100></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>说明</td><td> <input type=text value="<%=rs("hf4tit")%>" name=hf4tit size=40 maxlength=100></td>
    </tr>
	<tr bgcolor="#f4f5fd" class=backs>
      <td height=18 colspan=2 class=td>第四副广告图片</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>JPG/GIF图片</td><td> <input type=text value="<%=rs("hf5pic")%>" name=hf5pic size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner5&frmname=hf5pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>链接</td><td> <input type=text value="<%=rs("hf5url")%>" name=hf5url size=40 maxlength=100></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% height="18" align=right>说明</td><td> <input type=text value="<%=rs("hf5tit")%>" name=hf5tit size=40 maxlength=100></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan=2> <INPUT name="ok" TYPE="hidden" value="ok">
        <INPUT name="flash2" TYPE="hidden" id="flash2" value="0">
        <INPUT name=action TYPE="submit" value="保存设置"></td>
    </tr>
	</form>

</table>
	
<%
	rs.close
	set rs=nothing
end if%>
<%              
if action="ok" then


	if trim(request.form("hf2pic"))="" then er=1

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


	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

     Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from adv"
	 rs.open sql,conn,1,3
	 rs("xuanze4")=request.form("flash2")
 	 rs("hf2pic")=trim(request.form("hf2pic"))
 	 rs("hf2url")=trim(request.form("hf2url"))
 	 rs("hf2tit")=trim(request.form("hf2tit"))
	 rs("hf3pic")=trim(request.form("hf3pic"))
 	 rs("hf3url")=trim(request.form("hf3url"))
 	 rs("hf3tit")=trim(request.form("hf3tit"))
	 rs("hf4pic")=trim(request.form("hf4pic"))
 	 rs("hf4url")=trim(request.form("hf4url"))
 	 rs("hf4tit")=trim(request.form("hf4tit"))
	 rs("hf5pic")=trim(request.form("hf5pic"))
 	 rs("hf5url")=trim(request.form("hf5url"))
 	 rs("hf5tit")=trim(request.form("hf5tit"))
	 rs("hf6pic")=trim(request.form("hf6pic"))
 	 rs("hf6url")=trim(request.form("hf6url"))
 	 rs("hf6tit")=trim(request.form("hf6tit"))
	 rs("hf7pic")=trim(request.form("hf7pic"))
 	 rs("hf7url")=trim(request.form("hf7url"))
 	 rs("hf7tit")=trim(request.form("hf7tit"))
	 rs("hf8pic")=trim(request.form("hf8pic"))
 	 rs("hf8url")=trim(request.form("hf8url"))
 	 rs("hf8tit")=trim(request.form("hf8tit"))
	 rs("hf9pic")=trim(request.form("hf9pic"))
 	 rs("hf9url")=trim(request.form("hf9url"))
 	 rs("hf9tit")=trim(request.form("hf9tit"))

	rs.update
	rs.close
	set rs=nothing

	response.write "<script language='javascript'>"
	response.write "alert('首页四副小广告设置成功！');"
	response.write "location.href='adv5.asp';"
	response.write "</script>"
	response.end
end if%>

</body>
</html>

