<!--#include file="../../inc/config.asp"-->
<!--#include file="../../inc/conn.asp"-->
<!-- #include file="../inc/Session.asp" -->
<HTML><HEAD><TITLE>获得某类下的所有子类标签</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<SCRIPT event=onclick for=Ok language=JavaScript>
  window.returnValue='getchildlist('+classid.value+',"'+sepChar.value+'","'+linkStyle.value+'")';
 // window.returnValue='aaa';
  window.close();
</SCRIPT>
<%
dim first,classid
classid=0
dim i
set rs=server.CreateObject("adodb.recordset")
sql="select * from catalogs where parentid="&classid&" order by id asc"
rs.open sql,conn,3,1
first=rs.GetRows()
rs.close
set rs=nothing
'response.Write("bigclass-----------------------"&ubound(first,2)&"----------------<br>")

'获得所有par_id=<>的类别------主类：par_id=0
if(ubound(first,2)<0) then
response.Write("暂时没有分类")
end if
Function getcatalogs(parentid,str)
	Dim Sql,rstemp,TemptempStr,tempStr	
	tempStr=str&"&nbsp;"
	sql="select * from catalogs where parentid="&parentid
	Set rstemp = Conn.Execute(Sql)
	do while Not rstemp.Eof
		getcatalogs = getcatalogs &"<option value="&rstemp("id")&">│"&tempStr&"└"&rstemp("title")&"</option>"&Chr(10)
		getcatalogs = getcatalogs & getcatalogs(rstemp("id"),tempStr)
		rstemp.MoveNext
	loop
	rstemp.close
	Set rstemp = Nothing
End Function
%>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<link href="cs.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgColor=menu>
<fieldset style="text-align:center; ">
<legend>某类下的所有子类</legend>
<table width="400" border="0" align="center" cellpadding="1" cellspacing="5">
  <tr>
    <td width="131">类别：</td>
    <td width="250">
      <select name="classid" id="classid" size="1">
	  <option value="0">根目录</option>   
  	<%
  	for i=0 to ubound(first,2)
		response.Write("<option value="&first(0,i)&">├"&first(2,i)&"</option>"&Chr(10))	
    	response.Write(getcatalogs(first(0,i),""))		
	next	
	%>       
    
      </select></td>
  </tr>
  <tr>
    <td>间隔字符：</td>
    <td><INPUT name="sepChar" id="sepChar" size=7 value="|">
    默认：|(类之间以&quot;|&quot;隔开)</td>
  </tr>
  <tr>
    <td>链接样式：</td>
    <td><INPUT name="linkStyle" id="linkStyle" size=7>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <div align="center">
        <input  id="Ok" type="submit" value="确定">
        &nbsp;
        <input type="button"  onclick="window.close();" value="取消">
    &nbsp;</div></td>
  </tr>   
</table>

</fieldset>
  </CENTER></DIV>
  <div align="center"></div>
</BODY></HTML>
<%
call connclose()
%>