<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file=cookies1.asp-->
<%
dim rs,sql,i,sjfl,Path,fso,html,o,rs1,sql1,sjfl_1
i=0
set rs=server.createobject("adodb.recordset")
sql="select * from [sjcla1] order by paixu desc"
rs.open sql,conn,1,1
do while not rs.eof
sjfl_1=sjfl_1 + "<option value="&rs("id")&">"&rs("sjcla1")&"</option>"
sjfl=sjfl + "<table cellSpacing=""1"" cellPadding=""0"" width=""98%"" align=""center"" border=""0""  style=""border-bottom:1px #cac8c9 dotted""><tr><td width=""6%""><img src=""../img/kd.gif"">&nbsp;</td><td width=""90%""><a href=""../shop.asp?sc1="&rs("id")&"&jle=1""><font color=""#FF7533""><b>"&rs("sjcla1")&"</b></font></a></td></tr>"
sjfl=sjfl + "<tr><td width=""100%"" colspan=""2"">"
set rs1=server.createobject("adodb.recordset")
sql1 = "select * from sjcla2 where sjcla1="&rs("id")&" and hot=1 order by paixu desc"
rs1.open sql1,conn,1,1
o=0
do while not rs1.eof
sjfl=sjfl + "<a href=""../shop.asp?sc1="&rs("id")&"&sc2="&rs1("id")&"&jle=2""><font style=""font-size: 9pt"">"&rs1("sjcla2")&"</font></a>&nbsp;"
rs1.movenext
o=o+1
if o>=16 then '控制二级分类显示个数如果要全部显示可以删除该判断代码
sjfl=sjfl + "..."
exit do
end if
loop
rs1.close
set rs1=nothing
i=i+1
sjfl=sjfl + "</td></tr>"
rs.movenext 
loop
rs.close
Set rs = nothing

sjfl_1="<select name=sjcla1><option selected value=0>全部类别</option>"&sjfl_1&"</select>"
sjfl=sjfl + "</table>"
sjfl = "" + sjfl + ""
Path = Server.MapPath("../inc")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set html = fso.CreateTextFile(Path& "\shop_categories.html")
html.WriteLine sjfl
Set fso = nothing
html.close

Path = Server.MapPath("../inc")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set html = fso.CreateTextFile(Path& "\shop_categories1.html")
html.WriteLine sjfl_1
Set fso = nothing
html.close

closedb
%>
生成商家分类成功！<br><a href="../inc/shop_categories.html">查看分类文件</a><p><a href="../inc/shop_categories1.html">查看搜索分类文件</a></p>