<!--#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 
 	// '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
   If  isnumeric(page) and isnumeric(id)  then
      //'取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
     Dim fso,fmodify
 	 Set fso = YXFSO
 		Set rs=Server.CreateObject("adodb.recordset")
		rs.Open ("select tradeinfo_type from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1
	    If Not rs.Eof Then
 	     pencat=rs("tradeinfo_type")        
	    End If
	 Set rs=Server.CreateObject("adodb.recordset")
		rs.Open ("SELECT * FROM Websen_class_2 where typeID="&id&""),conn,1,1
 	 If not rs.Eof Then
		ttid=rs("typeID")
		 sttid=rs("sortID")
	   End If
	 rs.Close
	If ttid="" Then 
	    ttid=0
	 End If
	 If sttid="" Then
	   sttid=0
	  End If
 		//'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	
	 	        msg_per_page=30
 	// '查出详细信息只属于该二级分类的产品 ^^^^^^^^^^^^^^^^^^^^^
	MaxPerPage=1
   
     If Request("all")="all" or Request("all")="update" Then
	 Set rs=Server.CreateObject("ADODB.Recordset")
     rs.Open ("select * from Websen_post where type_class2="&ttid&" and flag=1 order by id desc"),conn,1,1
     End If
     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

	// '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
	Set rssort1=Server.CreateObject("ADODB.Recordset")
	rssort1.Open ("select * from Websen_class_1 where sortID="&sttid&""),conn,1,1
	
	Set rssort=Server.CreateObject("ADODB.Recordset")
	rssort.Open ("select * from Websen_class_2 where typeID="&ttid&""),conn,1,1
	
	Set rstype=Server.CreateObject("ADODB.Recordset")
	rstype.Open ("select * from Websen_class_3 where typeid="&ttid&""),conn,1,1
	if rstype.Eof Then
	    HOPE_Type=HOPE_Type&""
	else
	    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_3.asp>"
 	    HOPE_Type=HOPE_Type&"<TABLE width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""blackborder"">"
	    HOPE_Type=HOPE_Type&"<TR><TD align=middle>"
	    HOPE_Type=HOPE_Type&"<TABLE cellSpacing=0 cellPadding=0 width=""95%"" border=0>"
	    HOPE_Type=HOPE_Type&"<TR vAlign=top>"
	Do while not rstype.Eof
	    HOPE_Type=HOPE_Type&"<TD vAlign=top width='25%'><a class=c href='"&HOPE_InstallDir&"brand/offerlist/"&rstype("sortid")&"-"&rstype("typeid")&"-"&rstype("typeid_2")&".html'  onclick='AjaxSearchtr("&rstype("typeid_2")&")'><span style=' font-size:12px; color:#003278'>"&rstype("typename_2")&"</font></a>"
	    HOPE_Type=HOPE_Type&"<font class=s> "
	

 // '用于显示属于该第三级分类中的信息总量
	   Set prors=Server.CreateObject("ADODB.Recordset")
	    prosql="select count(id)as CountPro  from Websen_post where type_class2="&rstype("typeid_2")&" flag=1 order by id desc"
	   prors.Open prosql,conn,1,1
	   If prors.Eof Then
	     HOPE_Type=HOPE_Type&""
	   End If
	   If not prors.Eof Then
	   If prors("CountPro")<=0 Then
	     HOPE_Type=HOPE_Type&"" 
	   Else
	     HOPE_Type=HOPE_Type&"<font style='font-size:12px; color:#666666'>("&prors("CountPro")&")</font>"
	   prors.Close
	   End If
	   End If

	    HOPE_Type=HOPE_Type&"</font></td>"
	a=a+1
	If a=4 Then
	    HOPE_Type=HOPE_Type&"</tr>"
	a=0
	End If
	rstype.Movenext
	loop
	rstype.Close
	    HOPE_Type=HOPE_Type&"</TABLE></TD></TR></TABLE>"
	End If

// '--------------------------循环显示品牌信息--------------------------------------------------------------
 	If rs.Eof Then
	    HOPE_body=HOPE_body&"<br><br><div align='center' class='s'>此类暂无招商信息</div><br>"
	Else
		Do while not rs.Eof and rowcount > 0
	    HOPE_body=HOPE_body&"<TABLE width='100%' height=85 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
		 HOPE_body=HOPE_body&"<TD width='33%'>"&vbCrlf
		 HOPE_body=HOPE_body&"<table><tr><td>"
		 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='../../../"&rs("drawalt")& "' width='120' height='60'><a/>"
		 HOPE_body=HOPE_body&"</td></tr><tr><td align='center'>"
	     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></td>"&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
		i=i+1
	icolor=icolor+1
	If icolor>1 Then icolor=0
	rowcount=rowcount-1
	rs.movenext
	loop
	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
  
     //-------------------------------------------------------------------  
     //-------------------------------------分页信息处理----------------------------------------------------------
	 
	 		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")) 
		 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="&sttid&"-"&ttid&"-p"&blockPage-10&".html onclick=AjaxSearchtrp("&ttid&","&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="&sttid&"-"&ttid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&ttid&","&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="&sttid&"-"&ttid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&ttid&","&blockPage&")>后10页→</a><span disabled>】"
		End If 
	        HOPE_body=HOPE_body&" 直接到第 "
	        HOPE_body=HOPE_body&"<select onchange=if(this.options[this.selectedIndex].value!=''){AjaxSearchtrp("&ttid&",this.options[this.selectedIndex].index+1);location=this.options[this.selectedIndex].value;}>"
		for i=1 to totalpage
	        HOPE_body=HOPE_body&"<option value="&sttid&"-"&ttid&"-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="&sttid&"-"&ttid&"-p"&blockPage-10&".html onclick=AjaxSearchtrp("&ttid&","&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="&sttid&"-"&ttid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&ttid&","&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="&sttid&"-"&ttid&"-p"&blockPage&".html onclick=AjaxSearchtrp("&ttid&","&blockPage&")>后10页→</a><span disabled>】"
		End If 
	        HOPE_body=HOPE_body&" 直接到第 "
	        HOPE_body=HOPE_body&"<select onchange=if(this.options[this.selectedIndex].value!=''){AjaxSearchtrp("&ttid&",this.options[this.selectedIndex].index+1);location=this.options[this.selectedIndex].value;}>"
		for i=1 to totalpage
	        HOPE_body=HOPE_body&"<option value="&sttid&"-"&ttid&"-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/seller_2_page.asp' />"&vbCrlf
			HOPE_body=HOPE_body&"</tr></table></td>"&vbCrlf
 
	//************** 读取内容结束 ***************
 
        HOPE_Title=rssort("typename")   //网页标题头


      //'所属大类名称^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  
        HOPE_Sort="<a href='"&HOPE_InstallDir&"brand/trade/"&rssort1("sortid")&".html'>"&rssort1("sort")&"</a>"
	  	
      //'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


      //导航标签#HOPE_TradeGo#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

	   HOPE_TradeGo=""&HOPE_Title&""
	  
	  
	  
	 //'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	   If totalrec="" Then 
		   totalrec=0
		   End If
        HOPE_TotalRec=totalrec '此类求购数统计


     	  
 	  '属于该行业的推荐的网盛通会员的供应信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Set rstjy=Server.CreateObject("ADODB.Recordset")
	 sqltjy="select  top  15   Websen_Info.showname,Websen_Info.Info_ID,Websen_Info.sortid,Websen_Info.typeid,Websen_Info.typeid_2 from Websen_Info,Websen_corporation where Websen_Info.Gsid=Websen_corporation.id and Websen_corporation.Tjbz like '%0%' and Websen_corporation.flag=1  and Websen_Info.sortid="&sttid&" and Websen_Info.typeid="&ttid&" and Websen_Info.typeid_2=0  and Websen_Info.type='卖' order by trust_score desc"
       rstjy.Open sqltjy,conn,1,1
	   If rstjy.Eof Then
	    tjcompany="暂无"
	   End If
	   If Not rstjy.Eof Then 
        tjcompany=""
 	   End If
	   If Not rstjy.Eof Then 
	    tji=1
	    tjcompany=""
	   Do While Not rstjy.Eof 
	    tjcompany=tjcompany&"．<a href='"&HOPE_InstallDir&"tradeinfo/offerdetail/"&rstjy("sortid")&"-"&rstjy("typeid")&"-"&rstjy("typeid_2")&"-"&rstjy("Info_ID")&".html' target=_blank>"&rstjy("showname")&"</a><br>"
	   If tji=15 Then	   Exit Do
  	   tji=tji+1
 	   rstjy.Movenext
	   Loop
	   rstjy.Close
	   End If 

	HOPE_TjCom=tjcompany
	
	//'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^




   rs.Close
   rssort.Close
   rssort1.Close
   
  // '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  end  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  		  If fso.FileExists(server.MapPath(HOPE_InstallDir&"tradeinfo/trade/"&sttid&"-"&ttid&"-p"&tttid&".html")) Then
		  If kindtime<>"0" then 
     		Set fmodify = fso.GetFile(server.MapPath(HOPE_InstallDir&"tradeinfo/trade/"&sttid&"-"&ttid&"-p"&tttid&".html"))
 		    ShowDateModified = fmodify.DateLastModified
 		    dtime=DateDiff("s",ShowDateModified,now())
		    mtime=dtime/60
  			  If trim(mtime)>=kindtime then
  				pencat=Hope_HtmlResult(pencat)
				Set fout = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"tradeinfo/trade/"&sttid&"-"&ttid&"-p"&tttid&".html"))
				//'如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
				fout.Write pencat&"<script src='"&HOPE_InstallDir&"autokind/trade_2_page.asp?pages="&Replace_Text(request("pages"))&"'></script>"
				fout.Close
			  End If
			   End If 
  		  Else
           pencat=Hope_HtmlResult(pencat)
  		   Set foutc = fso.CreateTextFile(Server.Mappath(HOPE_InstallDir&"tradeinfo/trade/"&sttid&"-"&ttid&"-p"&tttid&".html"))
		   //'如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 		   foutc.Write pencat&"<script src='"&HOPE_InstallDir&"autokind/trade_2_page.asp?pages="&Replace_Text(request("pages"))&"'></script>"
		   foutc.Close
 		 End If	
	  Set fso = nothing
      conn.Close
     Set conn=nothing
    End If
%>