<!--#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")
if action="" then 
Set rs = conn.Execute("select * from adv") 
%>

	<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
	<form action=adv1.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">LOGO图片</td><td>
	<input type=text value="<%=rs("logo")%>" name="logo" size=40 maxlength=100>
	<INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=logo&frmname=logo','blank_','scrollbars=yes,resizable=no,width=650,height=450')">
	</td></tr>
	
	<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 trim(request.form("logo"))="" then
	response.write "<script language='javascript'>"
	response.write "alert('请填写Logo图片的有效路径和文件名，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if
	
	logo=request.form("logo")
	logo=split(logo,".")
	n=UBound(logo)
	if LCase(logo(n))<>"gif" and LCase(logo(n))<>"jpg" 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("logo")=trim(request.form("logo"))

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

	response.write "<script language='javascript'>"
	response.write "alert('网站标志设置成功！');"
	response.write "location.href='adv1.asp';"
	response.write "</script>"
	response.end
end if%>

</body>
</html>
