<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file="../inc/function.asp"-->
<title>修改二级分类</title>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0">
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" class="td" width="323">
    <form action="?classid=<%=request("classid")%>&sj=ok" name="jle" method="POST">
    <tr>
    <td height="25"  class="tdbar"  width="323" colspan="2"><%
if request("sj")="ok" then
dim rs,sql,sjcla1,sjcla2,paixu,classid,leibie
classid=trim(request("classid"))
sjcla1=request("sjcla1")
sjcla2=HtmlEncode(trim(request("sjcla2")))
paixu=trim(request("paixu"))
if sjcla1="" then
response.write "<li>错误，类别为空！"
response.end
end if
if sjcla2="" then
response.write "<li>错误，类别为空！"
response.end
end if
if paixu="" then
response.write "<li>错误，类别为空！"
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [sjcla2] where id="&cstr(classid)
rs.open sql,conn,1,3
leibie=trim(rs("sjcla2"))
if sjcla2=leibie then
rs("paixu")=paixu
rs.update
response.write "排序修改成功！"
end if

if rs.eof then
response.write "参数错误！"
else
rs("sjcla1")=sjcla1
rs("sjcla2")=sjcla2
rs("paixu")=paixu
rs.update
response.write "修改成功！！"
end if
rs.close
set rs=nothing
end if
%></td>
    </tr>
    <tr>
    <td height="25" width="208" align="right">所属大类：
<select name="sjcla1" size="1" style="font-size: 9pt">
<%
sjcla1=request("sjcla1")
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [sjcla1] order by paixu desc" 
rs.open sql,conn,1,1
if rs.eof then
response.write "没有类别请添加！"
response.end
else
Do while not rs.eof
   id=cstr(rs("id"))
   if trim(request("sjcla1"))=id then
      jle="selected"
   else
      jle=""
   end if
   response.write "<option " & jle & " value=" +  Cstr(rs("id")) + ">" + rs("sjcla1") + "</option>"
   rs.MoveNext
Loop
end if
rs.close
set rs=nothing
closedb
%>
      </select>
    </td>
    <td height="25" width="115">
    　</td>
    </tr>
    <tr>
    <td height="25" style="border-bottom-style: none; border-bottom-width: medium" width="208" align="right">分类名称：<input type="text" name="sjcla2" size="19" value="<%=request("sjcla2")%>"></td>
    <td height="50" style="border-bottom-style: none; border-bottom-width: medium" width="115" rowspan="2">

　&nbsp;<input type="submit" value="提交修改" name="B1" style="height: 42; width: 70"></td>
    </tr>
    <tr>
      <td height="25" align="right" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" width="208">排序数字：<input type="text" name="paixu" size="19" value="<%=request("paixu")%>"></td>
    </tr>
    </form>
  </table>
  </center>
</div>