<!--#include file="conn.asp"-->
<%if request.cookies("admin")("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if request.cookies("admin")("flag")>2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if%>
<html>
<head>
<link href="../image/css.css" rel="stylesheet" type="text/css">
</head>
<body class="tdcolor">
<!--
程序开发：青岛慧鼎网络有限公司
开发设计：末路的美
QQ：120416383
拷贝不究，欢迎交流。
 -->
<%'--产品管理页面 --
dim action
action=request.QueryString("action")
select case action
case ""%>
<img src="picR/8.jpg">

<%case "1"%>
<!--选择一级二级分类 -->
<form name="myform" method="post" action="?action=add" onSubmit="checkkk">
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EFF7CE">
<tr> 
<td class="managetop" colspan="4">请按分类级别由高到低从下面的选框中选择商品分类，完成后请点“下一步”</td>
</tr>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_nclass order by nclassidorder",conn,1,1%>
<script language = "JavaScript">
function checkkk()
{
}
var onecount;
onecount=0;
subcat = new Array();
<% count = 0
   do while not rs.eof %>
subcat[<%=count%>] = new Array("<%= trim(rs("nclass"))%>","<%= rs("anclassid")%>","<%= rs("nclassid")%>");
<%      count = count + 1
        rs.movenext
        loop
        rs.close%>
		
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
             document.myform.nclassid.options[document.myform.nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<tr>
<td align="center" class="tdcolor">
<%'//选择一级分类
rs.open "select * from shop_anclass where anclassidorder<1000 order by anclassidorder",conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else%>
<select class="wenbenkuang" name="anclassid" id="anclassid" size=25 style='width:230px' onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
<option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%> -></option>
<%	dim selclass
	selclass=rs("anclassid")
	rs.movenext
	do while not rs.eof%>
<option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%> -></option>
	<%rs.movenext
	loop
	end if
	rs.close%>
</select>
        &gt; 
        <select class=wenbenkuang name="nclassid" id="nclassid" size=25 style='width:230px'>
<%rs.open "select * from shop_nclass where anclassid="&selclass&" order by nclassidorder " ,conn,1,1
	if not(rs.eof and rs.bof) then%>
	<option selected value="<%=rs("nclassid")%>"><%=rs("nclass")%> -></option>
	<% rs.movenext
	do while not rs.eof%>
	<option value="<%=rs("nclassid")%>"><%=rs("nclass")%> -></option>
	<%rs.movenext
	loop
	end if
	rs.close
	set rs = nothing%>
	</select></td>
</tr>
<tr>
<td align="center" class="tdcolor">　
<input class="go-wenbenkuang" type="submit" name="Submit" value="OK,下一步->" onClick='return checkkk();'></td>
</tr>
</table>
</form>


<%case "add"
anclassid=request("anclassid")
nclassid=request("nclassid")%>
<img src="picR/9.jpg">

<%end select%>
</body></html>