<%
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") 
	%>
<center>
<table width="95%" border="0" bgcolor="#D9EAFC">
  <tr bgcolor="#D9EAFC">
    <td bgcolor="#D9EAFC"><table width="580" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td style="padding:5"><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 bgColor=#f4f5fd height=30>　<B><font color="#FF0000">&nbsp;首页对联广告设置</font></B></TD>
                </TR>
              </TBODY>
          </TABLE></td>
        </tr>
        <tr>
          <td style="padding:5"><table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
              <form action=duilian.asp method=post name=setup>

                <tr bgcolor="#FFFFFF">
                  <td colspan="2"><table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
                    <tr bgcolor="#f4f5fd" class=backs>
                      <td height=18 colspan=2 class=td>第一张对联图片</td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                      <td width=20% height="18" align=right>图片类型</td>
                      <td>                    </tr>
                    <tr bgcolor="#FFFFFF">
                      <td width=20% height="18" align=right>JPG/GIF图片</td>
                      <td><input type=text value="<%=rs("hf41pic")%>" name=hf41pic size=40 maxlength=100>
                          <INPUT name="button" TYPE="button"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner41&frmname=hf41pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')" value="浏览"></td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                      <td width=20% height="18" align=right>链接</td>
                      <td><input type=text value="<%=rs("hf41url")%>" name=hf41url size=40 maxlength=100></td>
                    </tr>
                    <tr bgcolor="#FFFFFF">
                      <td width=20% height="18" align=right>说明</td>
                      <td><input type=text value="<%=rs("hf41tit")%>" name=hf41tit size=40 maxlength=100></td>
                    </tr>
                  </table>
                    <table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
                      <tr bgcolor="#f4f5fd" class=backs>
                        <td height=18 colspan=2 class=td>第二张对联图片</td>
                      </tr>
                      <tr bgcolor="#FFFFFF">
                        <td width=20% height="18" align=right>图片类型</td>
                        <td>                      </tr>
                      <tr bgcolor="#FFFFFF">
                        <td width=20% height="18" align=right>JPG/GIF图片</td>
                        <td><input type=text value="<%=rs("hf42pic")%>" name=hf42pic size=40 maxlength=100>
                            <INPUT name="button2" TYPE="button"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner42&frmname=hf42pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')" value="浏览"></td>
                      </tr>
                      <tr bgcolor="#FFFFFF">
                        <td width=20% height="18" align=right>链接</td>
                        <td><input type=text value="<%=rs("hf42url")%>" name=hf42url size=40 maxlength=100></td>
                      </tr>
                      <tr bgcolor="#FFFFFF">
                        <td width=20% height="18" align=right>说明</td>
                        <td><input type=text value="<%=rs("hf42tit")%>" name=hf42tit size=40 maxlength=100></td>
                      </tr>
                    </table></td>
                  </tr>
                
                <tr bgcolor="#FFFFFF">
                  <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
   Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from adv"
	 rs.open sql,conn,1,3

 	 rs("hf41pic")=trim(request.form("hf41pic"))
	 rs("hf41url")=trim(request.form("hf41url"))
 	 rs("hf41tit")=trim(request.form("hf41tit"))
 	 rs("hf42pic")=trim(request.form("hf42pic"))
	 rs("hf42url")=trim(request.form("hf42url"))
 	 rs("hf42tit")=trim(request.form("hf42tit"))
        rs.update
	url="duilian.asp"
	rs.close	
	set rs=nothing

	response.write "<script language='javascript'>"
	response.write "alert('您的设置已经保存！');"
	response.write "location.href='"&url&"';"			
	response.write "</script>"
end if%></td>
        </tr>
      </table></td>
  </tr>
</table>
</center>
</body>