<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file="../inc/function.asp"-->
<%
dim rs,sql,class1,class2,paixu
jle=request("jle")
class1=request("class1")
class2=HtmlEncode(trim(request("class2")))
paixu=trim(request("paixu"))

if jle="hotx" or  jle="hoty"  then
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from class2 where id="&class2&""
rs.open sql,conn,1,3
if jle="hotx" then
rs("hot")=0
else
rs("hot")=1
end if
rs.update
rs.close
response.write "<script language=javascript>alert('设置成功！'); window.close();</script>"
end if


if class1="" then
response.write "<li>错误，类别为空！"
response.write "<meta http-equiv=refresh content=""2;URL=admin_categories.asp"">"
response.end
end if
if class2="" then
response.write "<li>错误，类别为空！"
response.write "<meta http-equiv=refresh content=""2;URL=admin_categories.asp"">"
response.end
end if
if paixu="" then
response.write "<li>错误，类别为空！"
response.write "<meta http-equiv=refresh content=""2;URL=admin_categories.asp"">"
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [class2] where class2='"&class2&"' order by paixu desc" 
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("class1")=class1
rs("class2")=class2
rs("paixu")=paixu
rs.update
response.write "类别添加成功！！<br>"
response.write "<a href=""admin_categories_add.asp?id="&request("id")&""">继续添加</a>"
else
response.write "类别已经存在，请确认你的输入是正确的！"
response.write "<meta http-equiv=refresh content=""2;URL=admin_categories.asp"">"
response.end
end if
rs.close
set rs=nothing
closedb
%>