<!--#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>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../image/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%dim action
action=request.QueryString("action")
select case action
case ""%>
<img src="picR/16.jpg">

<%case "add"
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>
<%dim count1
set rs=server.createobject("adodb.recordset")
rs.open "select * from pinpai order by pingpaiorder",conn,1,1%>
<script language = "JavaScript">
function checkkk()
{
}
var onecount1;
onecount1=0;
subcat1 = new Array();
<%count1 = 0
do while not rs.eof%>
subcat1[<%=count1%>] = new Array("<%= trim(rs("pingpainame"))%>","<%= rs("nclassid")%>","<%= rs("ppid")%>");
<%count1 = count1 + 1
rs.movenext
loop
rs.close%>
		
onecount1=<%=count1%>;

function changelocation1(locationid)
    {
    document.myform.ppid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount1; i++)
        {
            if (subcat1[i][1] == locationid)
            { 
             document.myform.ppid.options[document.myform.ppid.length] = new Option(subcat1[i][0], subcat1[i][2]);
            }        
        }
        
    }    
</script>
<form name="myform" method="get" action="?action=addnext" onSubmit="checkkk">
<input name="action" id="action" value="addnext" type="hidden">
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" class="bgcolor">
<tr> 
<td class="managetop" colspan="4">请按分类级别由高到低从下面的选框中选择商品分类，完成后请点“下一步”</td>
</tr>
<tr class="tdcolor">
<td align="center">
<%'//选择一级分类
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
if rs.eof and rs.bof then
request.write "请先添加栏目。"
request.end
else%>
<select class="wenbenkuang" name="anclassid" size=25 style='width:150px' id="anclassid" 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:150px' onChange="changelocation1(document.myform.nclassid.options[document.myform.nclassid.selectedIndex].value)">
<%set rs=server.createobject("adodb.recordset")
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>
<%dim selnclass
selnclass=rs("nclassid")
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>
&gt;
<select class="wenbenkuang" name="ppid" id="ppid" size=25 style='width:150px'>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from pinpai where nclassid="&selnclass&" order by pingpaiorder " ,conn,1,1
if not(rs.eof and rs.bof) then%>
<option selected value="<%=rs("ppid")%>"><%=rs("pingpainame")%> -></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=rs("ppid")%>"><%=rs("pingpainame")%> -></option>
<%rs.movenext
loop
end if
rs.close
set rs = nothing%>
</select></td>
</tr>
<tr class="tdcolor">
<td align="center">　
<input class="go-wenbenkuang" type="submit" name="Submit" value="OK,下一步->" onClick='return checkkk();'></td>
</tr>
</table>
</form>

<%case "addnext"
anclassid=request("anclassid")
nclassid=request("nclassid")
ppid=request("ppid")%>
<img src="picR/17.jpg">

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