 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="71"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/filesystem.asp"--> 
  <!--#include file="../rolecheck.asp"-->
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成网站行业分类JS文件</title>
</head>

<body>
<%
 
	Dim classall
	classall = classall & "var topCatArr = new Array();"&vbCrlf
	classall = classall & "var topCat;"&vbCrlf
	classall = classall & "var sCat;"&vbCrlf
'查出种类的一级分类：^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from Yixiang_class_1"
	rs.open sql,conn,1,1
	if not rs.eof then
	i=1
	do while not rs.eof
	 
	classall = classall & "topCat = new TopCategory('"&rs("sortid")&"','"&rs("sort")&"');"&vbCrlf
	classall = classall & ""&vbCrlf
	classall = classall & "topCatArr = topCatArr.concat(topCat);"&vbCrlf
	classall = classall & ""&vbCrlf

'查出种类的二级分类：=============================================================
		set rs3=server.CreateObject("adodb.recordset")
		sql3="select * from Yixiang_class_2 where sortid="&rs("sortid")
		rs3.open sql3,conn,1,1
		if not rs3.eof then
		do while not rs3.eof
			classall=classall&"sCat = new Category(topCat, '"&rs3(0)&"', '"&rs3("typename")&"')"&vbCrlf
'查出种类的三级分类：三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三
			set rs4=server.CreateObject("adodb.recordset")
			sql4="select * from Yixiang_class_3 where typeid="&rs3("typeid")
			rs4.open sql4,conn,1,1
			if not rs4.eof then
				do while not rs4.eof
					classall = classall & "new LeafCat(sCat, '"&rs4(0)&"', '"&rs4("typename_2")&"')"&vbCrlf
				rs4.movenext
				loop
			rs4.close
			set rs4=nothing

'三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三

	end if
	rs3.movenext
	loop
	rs3.close
	set rs3=nothing
	end if

'===================================================================================

	rs.movenext
	 loop
	rs.close
	set rs=nothing
	end if

 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'生成js文件以便添加修改信息时调用
	filename=HOPE_InstallDir&"js/allCategorys.js"
	set fso = YXFSO
	set fout = fso.CreateTextFile(server.mappath(""&filename&""),true)
	fout.write classall
	fout.close
	set fout=nothing
	set fso=nothing
	response.write"<SCRIPT language=JavaScript>alert('生成行业分类JS成功！');"
	response.write"javascript:history.back(-1)</script> "
	response.end
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
%>
</body>
</html>
