<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<!-- #include file="inc/function.asp" -->
<%
dim rs,genJs,CatalogCache,funjs
genJs="var industry_arr=["
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,title,pid from t_industry order by id asc",conn,3,1
if not rs.eof and not rs.bof then
	CatalogCache=rs.GetRows()
end if
rs.close
set rs=nothing
if isarray(CatalogCache) then
	for i=0 to ubound(CatalogCache,2)
		genJs=genJs&"["""&CatalogCache(0,i)&""","""&CatalogCache(1,i)&""","""&CatalogCache(2,i)&"""]"
		if(i<ubound(CatalogCache,2)) then
			genJs=genJs&","
		end if
	next
end if
genJs=genJs&"];"&Chr(10)
funjs=ReadFromTextFile(server.MapPath("js/industry_func.js"))
genJs=genJs&funjs
call SaveTextFile(server.MapPath("/js/industrys.js"),genJs)
call connclose()
response.Write("<script>alert('成功生成JS文件，保存至：/js/industrys.js');history.back();</script>")
%>