 <% 
	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

'查出种类的一级分类：^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from Websen_class_1 order by orderid"
	rs.open sql,conn,1,1
	 if not rs.eof then
	 i=1
	do while not rs.eof
	 
	classall = classall & "cur = new Category('"&rs("sortid")&"','"&rs("sort")&"');"&vbCrlf
	classall = classall & ""&vbCrlf
	classall = classall & "catArr = catArr.concat(cur);"&vbCrlf
	classall = classall & ""&vbCrlf

'查出种类的二级分类：=============================================================
		set rs3=server.CreateObject("adodb.recordset")
		sql3="select * from Websen_class_2 where sortid="&rs("sortid")
		rs3.open sql3,conn,1,1
		if not rs3.eof then
		do while not rs3.eof

'查出种类的三级分类：三三三三三三三三三三三三三三三三三三三三三三三三三三三三三三
			set rs4=server.CreateObject("adodb.recordset")
			sql4="select * from Websen_class_3 where typeid="&rs3("typeid")
			rs4.open sql4,conn,1,1
			if rs4.eof then
			classall = classall & "cur.addBoard(new Board('"&rs("sortid")&"','"&rs3("typeid")&",0','"&rs3("typename")&"'))"&vbCrlf
			classall = classall & ""&vbCrlf
			end if
			if not rs4.eof then
			do while not rs4.eof
			classall = classall & "cur.addBoard(new Board('"&rs("sortid")&"','"&rs3("typeid")&","&rs4("typeid_2")&"','"&rs3("typename")&"/"&rs4("typename_2")&"'))"&vbCrlf
			classall = classall & ""&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>
