<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx7<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<%
if request("action")="adda" then
classname=trim(request("classname"))
''检验此一级分类是否唯一
sql="select * from shop_zhuanti_class3 where classname='"&classname&"' and classid1="&request("classid1")&" and classid2="&request("classid2")&" order by id desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,2
if not(rs.eof or rs.bof) then
response.write"<SCRIPT language=JavaScript>alert('对不起，此分类名已经存在,请核实！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
rs.addnew
rs("classid1")=request("classid1")
rs("classid2")=request("classid2")
rs("classname")=classname
rs("classname")=classname
rs("classname")=classname
rs("class")=trim(request("class"))
rs("px")=trim(request("px"))
rs("adddate")=now()
rs.update

end if
rs.close
set rs=nothing

response.redirect "zhuanti_xclass.asp?aid="&request("classid1")&"&nclass="&request("classid2")
response.end
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 专题管理 &gt;&gt; 专题三级子类管理 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE1">* 为必添项目</span></td>
      </tr>
      <tr>
        <td height="27" colspan="2" style="font-size:12px;color:#000000"><span style="font-size:14px;color:#ffffff">&nbsp;</span>操作说明：先选择一个专题一级大类，然后在选择该大类下的一个二级小类，然后在当前小类下可进行增加或修改三级子类的操作。</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="28">&nbsp;</td>
    <td height="27" colspan="2" style="font-size:12px;color:#000000"><span style="font-size:12px;color:#000000">
      <%
		  aid=request("aid")
		   nclass=request("nclass")
		  set rs=server.createobject("adodb.recordset")
        rs.open "select * from shop_zhuanti_class order by px",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
&nbsp;&nbsp;<span class="STYLE1">第一步：</span>
<select name="anclassid" size="1" id="anclassid" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}"  class="wenbenkuang">
  <option >先选择一级分类</option>
  <option value="zhuanti_xclass.asp?aid=<%=rs("id")%>&nclass=0" <%if rs("id")=cint(request.QueryString("aid")) then %>selected<%end if%>><%=trim(rs("classname"))%></option>
  <%			         rs.movenext
        do while not rs.eof
%>
  <option value="zhuanti_xclass.asp?aid=<%=rs("id")%>&nclass=0" <%if rs("id")=cint(request.QueryString("aid")) then %>selected<%end if%>><%=trim(rs("classname"))%></option>
  <%
        rs.movenext
        loop
	end if
        rs.close
%>
</select>
<font color="#FF0000">
<select name="Nclassid" class="wenbenkuang" id="Nclassid" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
  <option  >再选择二级分类</option>
  <%set rs=server.createobject("adodb.recordset")
		  if aid="" then
		  aid=0
		  end if
		  if nclass="" then
		  nclass=0
		  end if
		 
		rs.Open "select * from shop_zhuanti_class2 where classid1="&aid&" order by px",conn,1,1
		do while not rs.eof 
		
		%>
  <option value="zhuanti_xclass.asp?aid=<%=aid%>&nclass=<%=rs("id")%>" <%if rs("id")=int(nclass) then %> selected <%end if%>><%=trim(rs("classname"))%></option>
  <%rs.movenext
		loop
		rs.close
		set rs=nothing
		
		%>
</select>
    </span></td>
  </tr>
</table>
<br>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#cccccc">
    <td width="7%">
    <div align="center">排 序</div></td>
    <td width="13%"><div align="center">分类名称</div></td>
    <td width="59%">
    <div align="center">说明</div></td>
    <td colspan="2">
    <div align="center">操作</div></td>
  </tr>
  <%


  set rs=server.CreateObject("adodb.recordset")
 rs.Open "select * from shop_zhuanti_class3 where classid1="&aid&" and classid2="&nclass&"  order by px ",conn,1,1
		  paixu=1
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有分类</font></center>"
		  else
		  do while not rs.EOF
		  %>
  <form name="form12" method="post" action="zhuanti_anclass_save.asp?action=edit3&id=<%=int(rs("id"))%>">
    <tr bgcolor="#F3F3F3">
      <td><div align="center">
        <input name="px" type="text" class="wenbenkuang" id="px" size="4" value="<%=int(rs("px"))%>" onKeyPress="return event.keyCode>=48&&event.keyCode<=57">
        </div></td>
      <td><div align="center">
        <input name="classname" class="wenbenkuang" type="text" id="classname2" size="15" value="<%=trim(rs("classname"))%>">
      </div></td>
      <td>
        <div align="center">
          <textarea name="class" cols="80" rows="1" class="wenbenkuang" id="class"><%=trim(rs("class"))%></textarea>
      </div></td>
      <td width="11%" bgcolor="#F3F3F3">
        <div align="center">
          <input type="submit" name="Submit" value="修改" class="go-wenbenkuang">
      </div>        </td>
      <td width="10%" bgcolor="#F3F3F3"><div align="center"><a href="zhuanti_anclass_save.asp?id=<%=int(rs("id"))%>&id2=<%=request("aid")%>&id3=<%=request("nclass")%>&action=del3" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除</font></a> </div></td>
    </tr>
  </form>
  <%paixu=paixu+1
  rs.MoveNext
          loop          
          end if%>
</table>
<br>
<br>&nbsp;&nbsp;&nbsp;
<span style="font-size:12px;color:#FF0000">
<%if int(nclass)>0 then
			set rsqq=server.createobject("adodb.recordset")			
			rsqq.Open "select * from shop_zhuanti_class2 where id="&nclass,conn,1,1
        response.Write "当前二级分类："&rsqq("classname")
        end if%>
</span><br>
<table border="0" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center" width="95%" class="border">
  <tr bgcolor="#cccccc"> 
    <td height="25" colspan="2" class="title"><div align="center">添加专题子类</div></td>
  </tr>
  <form name="addsort" method="post" action="zhuanti_xclass.asp" onSubmit="return ck()">
    <script language="javascript">
  function ck()
  {
     if(addsort.classid1.value==0)
  {
  alert("请选择大类")
  return false  
  }
   if(addsort.classid2.value==0)
  {
  alert("请选择小类")
  return false  
  }
  if(addsort.classname.value=="")
  {
  alert("请输入分类名")
  addsort.classname.focus()
  return false  
  }
   if(addsort.px.value=="")
  {
  alert("请输入排序")
  addsort.px.focus()
  return false  
  }
 
  }
  </script>
    <tr bgcolor="#F3F3F3"> 
      <td width="14%" align="right" class="tdbg">分类名：</td>
      <td width="86%" class="tdbg"> <input name="classname" type="text" class="wenbenkuang" id="classname">
      　排序： <input name="px" type="text" class="wenbenkuang" id="px" value="<%=paixu%>" size="8"  onkeypress="return event.keyCode>=48&&event.keyCode<=57">
      <input name="classid1" type="hidden" id="classid1" value="<%=aid%>">
      <input name="classid2" type="hidden" id="classid2" value="<%=nclass%>"></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td align="right" bgcolor="#F3F3F3" class="tdbg">说明：</td>
      <td class="tdbg"><textarea name="class" cols="80" rows="8" class="wenbenkuang" id="class"></textarea></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td colspan="2" align="center" class="tdbg"> <input name="Submit3" type="submit" class="go-wenbenkuang" value="添 加"> 
      <input type="hidden" name="action" value="adda"> </td>
    </tr>
  </form>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
