makeallclass.asp

来自「全球商务网站系统介绍 GLOBALEC.COM.CN[生成HTML版] 」· ASP 代码 · 共 69 行

ASP
69
字号
<!--#include file="../../conn/conn.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>
<%
if Request.Cookies("globalec")("globalecmaster")="" or Request.Cookies("globalec")("masterflag")="" then
response.write "<script language='javascript'>"
response.write"this.location.href='../login.asp';</SCRIPT>" 
response.end
end if
if instr(Request.Cookies("globalec")("masterflag"),"92")=0 then
response.redirect "../err.asp"
response.end
end if
Dim classall
set rs=conn.execute("select * from class_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=conn.execute("select * from class_2 where sortid="&rs("sortid")&"")
do while not rs3.eof
set rs4=conn.execute("select * from class_3 where typeid="&rs3("typeid")&"")
if rs4.eof then

classall = classall & "cur.addBoard(new Board('"&rs("sortid")&"','"&rs3("typeid")&",0','"&rs3("typename")&"'))"&vbCrlf
classall = classall & ""&vbCrlf

else
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
rs.movenext
loop
rs.close
set rs=nothing

filename="/js/allCategorys.js"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
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>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?