<title>生成品牌一级分类</title>
<!--#include file="inc.asp"-->
  <%
  
  '过滤内容中出现的html代码，引用时用 “RemoveHTML(调用内容)”

Function RemoveHTML(strHTML) 
Dim objRegExp, Match, Matches 
Set objRegExp = New Regexp 
objRegExp.IgnoreCase = True 
objRegExp.Global = True 
'取闭合的<> 
objRegExp.Pattern = "<.+?>" 
'进行匹配 
Set Matches = objRegExp.Execute(strHTML) 
' 遍历匹配集合，并替换掉匹配的项目 
For Each Match in Matches 
strHtml=Replace(strHTML,Match.Value,"") 
Next 
RemoveHTML=strHTML 
Set objRegExp = Nothing 
End Function

'定义结束。


    //  ***************************'接受xmlhttp对象传过来的值*********************************
	pages=split(Replace_Text(request("pages")),",")  
	page=pages(0)
	id=pages(1)
	currentPage2=page
	tttid=page 
	
	//********************************end*****************************************************
	
	
	if  isnumeric(page) and isnumeric(id)  then  
	
	//*************************************读取模板信息***************************************
	
    //取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    
	 Dim fso,fmodify
 	 Set fso = YXFSO
 	 Set rs=Server.CreateObject("adodb.recordset")
	 rs.Open ("select brand_sort from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1
	 if Not rs.Eof Then
 	    pencat=rs("brand_sort")        
	 End If
	 Set rs=Server.CreateObject("adodb.recordset")
		rs.Open ("SELECT * FROM Websen_class_1 where sortid="&id&""),conn,1,1
 	 if not rs.Eof Then
		sortid=rs("sortid")
		sortname=rs("sort")
	 End If
	 rs.Close
	 If sortid="" Then 
	    sortid=0
	 End If
	//*******************************************end******************************************
	
 		
		 MaxPerPage=1
		 

		 		 
   //'#############################返回一级分类下的二级分类^########################################

    HOPE_type=HOPE_type&"<script src='"&HOPE_InstallDir&"autokind/autokind.js'></script><input type='text' id='installurltr'  style='display:none; width:12;height:1'  value="&HOPE_InstallDir&"autokind/seller_2.asp>"
  	HOPE_type=HOPE_type&"<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>" 
	HOPE_type=HOPE_type&"<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"
	sqltype="SELECT * FROM Websen_class_2 WHERE sortid="&sortid
	Set rstype=Server.CreateObject("ADODB.Recordset")
	rstype.Open sqltype,conn,1,1 
	If Not rstype.Eof Then
	   j=1
 	   Do While Not rstype.Eof

		// '^^^^^^^^^^^^^^^^^^^^^^^^^    start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    //'查询出属于第一类的二级分类下的所含小分类的总数
		 
		 Set thirrs=Server.CreateObject("ADODB.Recordset")
		  thirsql="SELECT COUNT(*)AS thircount FROM Websen_Class_3 WHERE typeid="&rstype("typeid")
		  thirrs.Open thirsql,conn,1,1
		  if thirrs.Eof Then
		     seCount_sale=""
		  End If
		  if not thirrs.Eof Then
		     if thirrs("thircount")<=0 Then
		        seCount_sale=""
		     else
		        seCount_sale="<font style='font-size:12px; color:#666666'>("&thirrs("thircount")&")</font>"
		     End If
		     thirrs.close    
		  End If
		 
		// '^^^^^^^^^^^^^^^^^^^^^^^^^     end    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		
		// '^^^^^^^^^^^^^^^^^^^^^^^^^显示第一类的所有的二级分类^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		  
  			 HOPE_type=HOPE_type&" <td height=10 valign=top>"
			 HOPE_type=HOPE_type&"&nbsp;<A href="""&sortid&"-"&rstype("typeid")&".html"" class=M  onclick='AjaxSearchtr("&rstype("typeid")&")'><span style=' font-size:12px; color:#003278'>"&rstype("typename")&"</span></A> "&seCount_sale&"  "
 		    HOPE_type=HOPE_type&" </td> " 
		  if j MOD 5 = 0 Then 
			 HOPE_type=HOPE_type&"</TR><tr>" 
		  End If 
	      rstype.Movenext
		  j=j+1
	    Loop
        Set rstype=Nothing
     End If
     HOPE_type=HOPE_type&"</TABLE></td></tr></table>"
	 
     //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^end^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	 
    //###########################################end##############################################


    //##########################################获取详细内容######################################

   //'获取替换标签的内容^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    msg_per_page=15
   
	    Set rs=Server.CreateObject("adodb.recordset")
 		rs.Open ("select * from websen_post where type_class1="&sortid),conn,1,1

    if not rs.Eof Then
	   totalrec=RS.RecordCount    //'总记录条数
       rs.Pagesize=msg_per_page   //'每页数
       mpage2=rs.Pagecount        //'总页数
	   rowcount=msg_per_page
       rs.Move  (currentPage2-1)*MaxPerPage
       if mpage2>=currentPage2 Then
         tttid=currentPage2
       End If
     End If		 
		 
		
		 	  
	//^^^^^^^^^^^^^^^^^^^^^^'HOPE_body用于显示页面的主题分类信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	
    HOPE_body=HOPE_body&"<SCRIPT language=javascript>function killErrors(){return true;}window.onerror = killErrors;</SCRIPT>"
	if rs.Eof Then
	   HOPE_body=HOPE_body&"<br><br><div align='center' class='s'>此类暂无品牌信息!</div><br>"
	else
	   HOPE_body=HOPE_body&"<script type='text/javascript' src='"&HOPE_InstallDir&"autokind/showmsgrole.js'></script><script   language='vbscript'>sub   window_onload() AjaxSearchmsg() end  sub </script><input type='text' id='installurlmsg'   style='display:none; width:12;height:1'  value='"&HOPE_InstallDir&"autokind/showmsgrole.asp'/>"
 	   HOPE_body=HOPE_body&"<script type='text/javascript' src='"&HOPE_InstallDir&"autokind/showmsgrole.js'></script><script   language='vbscript'>sub   window_onload() AjaxSearchmsg() end  sub </script><input type='text' id='installurlmsg'   style='display:none; width:12;height:1'  value='"&HOPE_InstallDir&"autokind/showmsgrole.asp'/>"
	   HOPE_body=HOPE_body&"<TABLE width='100%' height=600 border=0 align=center cellPadding=0 cellSpacing=0>"&vbCrlf
	   HOPE_body=HOPE_body&"<TBODY>"&vbCrlf
	   for i=1 to 10
    	   HOPE_body=HOPE_body&"<TR >"  
		 for j=1 to 3  
	        if rs.eof then
			   exit for
			end if
			username=rs("username")
			set rsmp=server.CreateObject("adodb.recordset")
	        sqlmp="select * from Websen_corporation where [User]='"&username&"'"
	        rsmp.open sqlmp,conn,1,1
	        logo=rsmp("C_logo")
			rsmp.close
		    set rsmp=nothing
		    HOPE_body=HOPE_body&"<TD width='33%' valign='top'>"&vbCrlf
		    HOPE_body=HOPE_body&"<table width='170' height='110' border='0' cellpadding='0' cellspacing='1' bgcolor='#B7B7B7'><tr><td height='85' valign='middle' bgcolor='#FFFFFF'>"
		    HOPE_body=HOPE_body&"<A href="&HOPE_InstallDir&"brand/offerdetail/"&rs("type_class1")&"-"&rs("type_class2")&"-"&rs("type_class3")&"-"&rs("id")&".html target=_blank><img src='../../../vipcom/"&logo&"' width='170' height='60'></a>"
            HOPE_body=HOPE_body&"</td></tr><tr><td height='25' bgcolor='#F5F5F5' class='HE'>"
	        HOPE_body=HOPE_body&"<A href="&HOPE_InstallDir&"brand/offerdetail/"&rs("type_class1")&"-"&rs("type_class2")&"-"&rs("type_class3")&"-"&rs("id")&".html target=_blank>"&left(rs("project"),12)&"</a> "  
		    HOPE_body=HOPE_body&"</td></tr></table>"&vbCrlf	
			rs.Movenext 
	      next
		  i=i+1
          HOPE_body=HOPE_body&"</TR>"&vbCrlf
	   next
       HOPE_body=HOPE_body&"</TBODY>"&vbCrlf
	   HOPE_body=HOPE_body&"</TABLE>"&vbCrlf
     End if
		 

	   //  '^^^^^^^^^^^^^^^^^^^^^^^^^^^进行分页处理^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   
			
			HOPE_body=HOPE_body&"<br>"&vbCrlf
			HOPE_body=HOPE_body&"<TABLE width='100%' border=0 align=center cellPadding=1 cellSpacing=0 style='BORDER-TOP: #9C9A9C 1px solid;BORDER-Bottom: #9C9A9C 1px solid'>"&vbCrlf
			HOPE_body=HOPE_body&"<TBODY>"&vbCrlf
			HOPE_body=HOPE_body&"<TR>"&vbCrlf
			HOPE_body=HOPE_body&"<TD>"&vbCrlf
			HOPE_body=HOPE_body&"<TABLE cellSpacing=0 cellPadding=4 width='100%' border=0>"&vbCrlf
			HOPE_body=HOPE_body&"<TBODY>"&vbCrlf
			HOPE_body=HOPE_body&"<TR>"&vbCrlf
			HOPE_body=HOPE_body&"<TD class=M noWrap align=middle>"&vbCrlf
		if not (rs.Eof and rs.Bof) Then
			gopage=currentpage2
			totalpage=mpage2
			blockPage=Int((gopage-1)/10)*10+1
			
		    if LCase(Request.ServerVariables("HTTPS")) = "off" Then 
			   strTemp = "http://" 
		    else 
			   strTemp = "https://" 
		    End If 
			strTemp = strTemp & CheckStr(Request.ServerVariables("SERVER_NAME")) 
		    if Request.ServerVariables("SERVER_PORT") <> 80 Then 
			   strTemp = strTemp & ":" & CheckStr(Request.ServerVariables("SERVER_PORT"))
			End If
			strTemp = strTemp & CheckStr(Request.ServerVariables("URL"))
			lenstrTemp=Len(strTemp)+1	
		    if Instr(Left(linkfile,lenstrTemp),"?")>0 Then 			
		       if blockPage = 1 Then
		          HOPE_body=HOPE_body&"<span disabled>【←前10页</span>&nbsp;"
		       else
		          HOPE_body=HOPE_body&"<span disabled>【</span><a href="&sortid&"-p"&blockPage-10&".html onclick=AjaxSearchtrp("&sortid&","&blockPage-10&")>←前10页</a>&nbsp;"
		       End If
		       i=1
	           Do Until i > 10 or blockPage > mpage2
		          if blockPage=Int(gopage) Then
		             HOPE_body=HOPE_body&"<font color=#FF0000>[<b>"&blockPage&"</b>]</font>"
		          else
		             HOPE_body=HOPE_body&" <a href="&sortid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&sortid&","&blockPage&")>["&blockPage&"]</a> "
		          End If
			      blockPage=blockPage+1
			      i = i + 1
		       Loop
		       if blockPage > totalpage Then
		          HOPE_body=HOPE_body&"&nbsp;<span disabled>后10页→】"
		       else
		          HOPE_body=HOPE_body&"&nbsp;<a href="&sortid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&sortid&","&blockPage&")>后10页→</a><span disabled>】"
		       End If 
			   HOPE_body=HOPE_body&" 直接到第 "
			   HOPE_body=HOPE_body&"<select onchange=if(this.options[this.selectedIndex].value!=''){AjaxSearchtrp("&sortid&",this.options[this.selectedIndex].index+1);location.href=this.options[this.selectedIndex].value;}>"
		       for i=1 to totalpage
			       HOPE_body=HOPE_body&"<option value="&sortid&"-p" & i & ".html"
		           if i=gopage Then HOPE_body=HOPE_body&"   selected"
			       HOPE_body=HOPE_body&">"&i&"</option>"
		       next
			   HOPE_body=HOPE_body&"</select>"
			   HOPE_body=HOPE_body&" 页<Br><Br>"
		    else
		       if blockPage = 1 Then
		          HOPE_body=HOPE_body&"<span disabled>【←前10页</span>&nbsp;"
		       else
		          HOPE_body=HOPE_body&"<span disabled>【</span><a href="&sortid&"-p"&blockPage-10&".html onclick=AjaxSearchtrp("&sortid&","&blockPage-10&")>←前10页</a>&nbsp;"
		       End If
		       i=1
		       Do Until i > 10 OR blockPage > mpage2
		          if blockPage=int(gopage) Then
		             HOPE_body=HOPE_body&"<font color=#FF0000>[<b>"&blockPage&"</b>]</font>"
		          else
		             HOPE_body=HOPE_body&" <a href="&sortid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&sortid&","&blockPage&")>["&blockPage&"]</a> "
		          End If
			      blockPage=blockPage+1
			      i = i + 1
		       Loop
		       if blockPage > totalpage Then
		          HOPE_body=HOPE_body&"&nbsp;<span disabled>后10页→】"
		       else
		          HOPE_body=HOPE_body&"&nbsp;<a href="&sortid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&sortid&","&blockPage&")>后10页→</a><span disabled>】"
		       End If 
			   HOPE_body=HOPE_body&" 直接到第 "
			   HOPE_body=HOPE_body&"<select onchange=if(this.options[this.selectedIndex].value!=''){AjaxSearchtrp("&sortid&",this.options[this.selectedIndex].index+1);location.href=this.options[this.selectedIndex].value;}>"
		       for i=1 to totalpage
			      HOPE_body=HOPE_body&"<option value="&sortid&"-p" & i & ".html"
		          if i=gopage Then HOPE_body=HOPE_body&"   selected"
			         HOPE_body=HOPE_body&">"&i&"</option>"
		       next
			   HOPE_body=HOPE_body&"</select>"
			   HOPE_body=HOPE_body&" 页<Br><Br>"			
		    End If			
			Startinfo=((gopage-1)*msg_per_page)+1
			Endinfo=gopage*msg_per_page
		    If Endinfo>totalrec Then Endinfo=totalrec
		    HOPE_body=HOPE_body&"&nbsp;&nbsp;共 "&totalrec&" 条信息 当前显示第 "&Startinfo&" - "&Endinfo&" 条 每页 "&msg_per_page&" 条信息 共 "&mpage2&" 页"
		End If		
			HOPE_body=HOPE_body&"</TD>"&vbCrlf
			HOPE_body=HOPE_body&"</TR>"&vbCrlf
			HOPE_body=HOPE_body&"</TBODY>"&vbCrlf
			HOPE_body=HOPE_body&"</TABLE></TD>"&vbCrlf
			HOPE_body=HOPE_body&"</TR>"&vbCrlf
			HOPE_body=HOPE_body&"</TBODY>"&vbCrlf
			HOPE_body=HOPE_body&"</TABLE><script language='javascript' src="&HOPE_InstallDir&"autokind/autokind_p.js></script><input type='text' id='installurltrp'  style='display:none; width:12;height:1'  value='"&HOPE_InstallDir&"autokind/brand_1_page.asp' />"&vbCrlf		
			
 	 rs.Close
  
//###########################end################################################################## 
 
    
      HOPE_Title=sortname    //  '网页标题头
      pencat=Hope_HtmlResult(pencat)
	

 // '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  end  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      
 	  Set fso = YXFSO
       if fso.FileExists(Server.MapPath(HOPE_InstallDir&"brand/trade/"&id&".html"))  Then
	      if kindtime<>"0" then 
	             // '如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             Set fmodify = fso.GetFile(Server.MapPath(HOPE_InstallDir&"tradeinfo/trade/"&id&".html"))
 		     ShowDateModified = fmodify.DateLastModified
 		     dtime=DateDiff("s",ShowDateModified,Now())
		     mtime=dtime/60
   	         if trim(mtime)>=kindtime Then
	            pencat=Hope_HtmlResult(pencat)
                Set sort_savem = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/trade/"&sortid&"-p"&tttid&".html"))
                // '说明：加入js脚本是用于更新页面
 		         sort_savem.Write pencat&"<script src="&HOPE_InstallDir&"autokind/brand_1_page.asp?id="&id&"></script>"
		        sort_savem.Close
		     End If
		  End If
		// '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	   else
	     //  '如果文件不存在就生成它^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		 pencat=Hope_HtmlResult(pencat)
 		Set sort_save = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"brand/trade/"&sortid&"-p"&tttid&".html"))
       // '说明：加入js脚本是用于更新页面
 		sort_save.Write pencat&"<script src="&HOPE_InstallDir&"autokind/trade_1_page.asp?id="&id&"></script>"
		sort_save.Close
		//'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	   
	   End If
  	   Set fso = Nothing
       conn.Close
       Set conn=Nothing
  End if

%>