<!--#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 qx8<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
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">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #000000;
	font-weight: bold;
}
.STYLE2 {color: #FF0000}
-->
</style></head>

<body>
<form id="selform" name="selform" method="post" action="">
  <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="STYLE2">* 为必添项目</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>
          <tr>
            <td height="27" colspan="2" style="font-size:12px;color:#000000"><span style="font-size:12px;color:#ff0000">
              <%
		  aid=request("aid")
		   nclass=request("nclass")
		   if aid="" then
		  aid=0
		  end if
		  if nclass="" then
		  nclass=0
		  end if
		  set rs=server.createobject("adodb.recordset")
        rs.open "select * from shop_infoid order by infoid",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
              &nbsp;<span class="STYLE2">第一步：</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="info_xclass.asp?aid=<%=rs("id")%>&nclass=0" <%if rs("id")=cint(request.QueryString("aid")) then %>selected<%end if%>><%=trim(rs("info"))%></option>
                <%			         rs.movenext
        do while not rs.eof
%>
                <option value="info_xclass.asp?aid=<%=rs("id")%>&nclass=0" <%if rs("id")=cint(request.QueryString("aid")) then %>selected<%end if%>><%=trim(rs("info"))%></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_infoid2 where classid1="&aid&" order by infoid",conn,1,1
		do while not rs.eof 
		
		%>
                <option value="info_xclass.asp?aid=<%=aid%>&nclass=<%=rs("id")%>" <%if rs("id")=int(nclass) then %> selected <%end if%>><%=trim(rs("info"))%></option>
                <%rs.movenext
		loop
		rs.close
		set rs=nothing
		
		%>
              </select>
            </span></td>
          </tr>
      </table></td>
    </tr>
  </table>
  </form>
<br>
<%set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from shop_infoid3  where classid1="&aid&" and classid2="&nclass&" order by infoid",conn,1,1
		dim i
		i=rs.recordcount%>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#cccccc">
    <td width="42%" height="22">
    <div align="center">分类名称</div></td>
    <td width="9%" height="22">
    <div align="center">排 序</div></td>
    <td width="23%" height="22">
    <div align="center">操 作</div></td>
  </tr>
  <%if rs.eof and rs.bof then
		  response.write "No data!"
		  else
		  do while not rs.eof%>
  <tr bgcolor="#F3F3F3">
    <form name="form1" method="post" action="info_save.asp?action=edit3&id=<%=rs("id")%>&classid1=<%=aid%>&classid2=<%=nclass%>">
      <td height="24">
        <div align="center">
          <input name="info" type="text" class="wenbenkuang"  id="info" value="<%=trim(rs("info"))%>" size="30">
      </div></td>
      <td>
        <div align="center">
          <input name="infoid" type="text" class="wenbenkuang"  id="infoid" value=<%=rs("infoid")%> size="3" onKeyPress="return event.keyCode>=48&&event.keyCode<=57" >
      </div></td>
      <td>
        <div align="center">
          <input type="submit" name="Submit" class="go-wenbenkuang"  value="修改">
&nbsp;&nbsp;<a href=info_save.asp?action=del3&id=<%=rs("id")%>&classid1=<%=aid%>&classid2=<%=nclass%>><font color="#FF0000">删除</font></a> </div></td>
    </form>
  </tr>
  <%rs.movenext
		  loop
		  end if
		  rs.close
		  set rs=nothing%>
</table>
<form name="form2" method="post" action="info_save.asp?action=add3&classid1=<%=request("aid")%>&classid2=<%=request("nclass")%>" onSubmit="return ck1()">
  &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_infoid2 where id="&nclass,conn,1,1
        response.Write "当前二级分类："&rsqq("info")
        end if%>
  </span>
<script language="javascript">
</script>
<br>
<script language="javascript">function ck1()
{

if(selform.anclassid.selectedIndex==0)
{
alert("请选择大类")
return false
}
if(selform.Nclassid.selectedIndex==0)
{
alert("请选择小类")
return false
}

if(form2.info1.value=="")
{
alert("请输入名称")
form2.info1.focus()
return false
}


if(form2.infoid1.value=="")
{
alert("请输入排序")
form2.infoid1.focus()
return false
}

}
</script>
        
  <table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
    <tr bgcolor="#cccccc"> 
      <td height="15"> <div align="center">添加供求信息子类名称</div></td>
      <td> <div align="center">排 序</div></td>
      <td> <div align="center">操 作</div></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td height="15"> <div align="center"> 
          <input name="info1" class="wenbenkuang"  type="text" id="info1" size="26">
      </div></td>
      <td> <div align="center"> 
          <input name="infoid1" class="wenbenkuang" type="text" id="infoid1" value=<%=i+1%> size="3" onKeyPress="return event.keyCode>=48&&event.keyCode<=57" >
      </div></td>
      <td> <div align="center"> 
          <input type="submit" name="Submit2" class="go-wenbenkuang"  value="添 加">
      </div></td>
    </tr>
  </table>
</form>
<!--#include file="copyright.asp"-->
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
