<!--#include file="../include/config.asp"-->
<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>
<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
select case request("action")
 case "add"
   call classadd() 
 case "save"
   call saveclass()
 case "delLarclass"
   call del()
 case "edit"
   call classedit()
 case "editsave"
   call editsave()
end select
%>


<script language=javascript src=../include/mouse.js></script>

<BODY bgcolor="#D9EAFC">
<%
sub classadd()
%>
<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 width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">&nbsp;商品分类管理</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30></TD>
    </TR>
  </TBODY>
</TABLE>
		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
<form   method=post action="sclass.asp" name=addlarclass>
<tr bgcolor="#FFFFFF"><td height=18 colspan=2 class=td>添加三级分类</td></tr>
<tr bgcolor="#FFFFFF"><td width=20% height=25 align=center>三级分类名称</td><td><INPUT TYPE='text' NAME='newclass' size=20 maxlength=20 value=''>[请勿输入<font color=red>% &quot; ' &amp; + = \</font>等禁用字符]</td></tr><input type="hidden" name="parentid" value="<%=request("classcode")%>">
<tr bgcolor="#FFFFFF"><td colspan=2><INPUT TYPE='hidden' name=action value='save'><INPUT TYPE='submit' value='保存设置'>
</td></tr>
</form>
</table>
<%
end sub
%>
<%
sub saveclass()
  set rs=server.CreateObject("adodb.recordset")
  sql="select top 1 * from sclass"
  rs.open sql,conn,1,3


  rs.addnew
  rs("parentid")=request("parentid")
  rs("classname")=request("newclass")
  rs("order")=0
  rs.update
  rs.close

  set rs=nothing
  conn.close
  set con=nothing
  response.Redirect "prod0.asp"
  'response.End()
end sub
sub del()
    conn.execute("delete from sclass where id="&request("classcode"))
	conn.close
	set conn=nothing
	response.Redirect "prod0.asp"
end sub
%>
<%
sub classedit()
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from sclass where id="&request("classcode")
rs.open sql,conn,1,1

%>
<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 width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">&nbsp;商品分类管理</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30></TD>
    </TR>
  </TBODY>
</TABLE>
		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
<form   method=post action="sclass.asp" name=addlarclass>
<tr bgcolor="#FFFFFF">
  <td height=18 colspan=2 class=td>修改三级分类</td>
</tr>
<tr bgcolor="#FFFFFF"><td width=20% height=25 align=center>三级分类名称</td><td><INPUT TYPE='text' NAME='newclass'  value="<%=rs("classname")%>" size=20 maxlength=20  >[请勿输入<font color=red>% &quot; ' &amp; + = \</font>等禁用字符]</td></tr>
<tr bgcolor="#FFFFFF">
  <td width=20% height=25 align=center>三级分类排序</td>
  <td><INPUT TYPE='text' NAME='order'  value="<%=rs("order")%>" size=20 maxlength=20  >[请勿输入<font color=red>% &quot; ' &amp; + = \</font>等禁用字符]</td></tr>
<input type="hidden" name="parentid" value="<%=rs("parentid")%>"><input type="hidden" name="classid" value="<%=rs("id")%>">
<tr bgcolor="#FFFFFF"><td colspan=2><INPUT TYPE='hidden' name=action value='editsave'><INPUT TYPE='submit' value='保存设置'>
</td></tr>
</form>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
sub editsave()
  set rs=server.CreateObject("adodb.recordset")
  sql="select top 1 * from sclass where id="&request("classid")
  rs.open sql,conn,1,3

  rs("parentid")=request("parentid")
  rs("classname")=request("newclass")
  rs("order")=request("order")
  rs.update
  rs.close

  set rs=nothing
  conn.close
  set con=nothing
  response.Redirect "prod0.asp"
  'response.End()
end sub
%>

<body>
</body>
</html>
