<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<TABLE WIDTH="100%" ALIGN="center" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<%
sort(CaID)
dim ii
ii=0
sub sort(selec)
	sql="select categoryid,category from category where ParentID = "&selec&" order by categoryorder"
	Set Rs1=Conn.Execute(sql)
	do while not rs1.eof
	
	
		
%>
<tr height=20>
<td>กค<%=string(ii*2,"กก")%> <a href=b2b_cplist.asp?catid=<% = rs1("categoryid") %>> <%=rs1("category")%></a></td>
</tr>
<%
ii=ii+1
	sort rs1("categoryid")
ii=ii-1
	rs1.movenext
	loop
rs1.close
Set Rs1 = Nothing
end sub
%>
   </TABLE>
<%
sorts(CatID)
sub sorts(selec)
	sql="select categoryid from category where ParentID = "&selec&" order by categoryorder"
	Set Rs1=Conn.Execute(sql)
	do while not rs1.eof
		IntCat =  rs1("categoryid")
	 	If Len(CatList) = 0 Then
      		CatList =catid
   		ElseIf InStr( CatList, IntCat ) <= 0 Then
      		CatList = CatList&", "&IntCat &""
   		End If
	sorts rs1("categoryid")
	rs1.movenext
	loop
rs1.close
Set Rs1 = Nothing
end sub
%>