<%
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("06")%>

<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 bconfig") 
	%>
			  <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 bgColor=#f4f5fd height=30>　<B><font color="#FF0000">&nbsp;编辑新闻分类</font></B></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=news2.asp method=post name=setup>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% align=right>新闻分类1 &nbsp;&nbsp;</td>
      <td width="568"> <input type=text value="<%=rs("newstitle1")%>" name="newstitle1" size=30  maxlength="15"> 
        <%if rs("newstitle1")<>"" then %>
        <a href=news1.asp?nclass=1><img alt='浏览该类别的全部文章' border=0 src='../images/admin/goto.gif'></a> 
        <% end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% align=right>新闻分类2 &nbsp;&nbsp;</td>
      <td width="568"> <input type=text value="<%=rs("newstitle2")%>" name="newstitle2" size=30  maxlength="15"> 
        <%if rs("newstitle2")<>"" then %>
        <a href=news1.asp?nclass=2><img alt='浏览该类别的全部文章' border=0 src='../images/admin/goto.gif'></a> 
        <% end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% align=right>新闻分类3 &nbsp;&nbsp;</td>
      <td width="568"> <input type=text value="<%=rs("newstitle3")%>" name="newstitle3" size=30  maxlength="15"> 
        <%if rs("newstitle3")<>"" then %>
        <a href=news1.asp?nclass=3><img alt='浏览该类别的全部文章' border=0 src='../images/admin/goto.gif'></a> 
        <% end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% align=right>新闻分类4 &nbsp;&nbsp;</td>
      <td width="568"> <input type=text value="<%=rs("newstitle4")%>" name="newstitle4" size=30  maxlength="15"> 
        <%if rs("newstitle4")<>"" then %>
        <a href=news1.asp?nclass=4><img alt='浏览该类别的全部文章' border=0 src='../images/admin/goto.gif'></a> 
        <% end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width=20% align=right>新闻分类5 &nbsp;&nbsp;</td>
      <td width="568"> <input type=text value="<%=rs("newstitle5")%>" name="newstitle5" size=30  maxlength="15"> 
        <%if rs("newstitle5")<>"" then %>
        <a href=news1.asp?nclass=5><img alt='浏览该类别的全部文章' border=0 src='../images/admin/goto.gif'></a> 
        <% end if%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan=2 width="568" ><INPUT name="newsmove" TYPE="hidden" value="1"> 
        <INPUT name="news_skin" TYPE="hidden" value="1"> <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("newstitle1"))="" 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 bconfig"
	 rs.open sql,conn,1,3

 	 rs("newstitle1")=trim(request.form("newstitle1"))
 	 rs("newstitle2")=trim(request.form("newstitle2"))
 	 rs("newstitle3")=trim(request.form("newstitle3"))
 	 rs("newstitle4")=trim(request.form("newstitle4"))
 	 rs("newstitle5")=trim(request.form("newstitle5"))
 	 rs("newsmove")=request.form("newsmove")
 	 rs("news_skin")=request.form("news_skin")

        rs.update
	url="news2.asp"
	rs.close	
	set rs=nothing

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