<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

'定义结束。


     id=Replace_Text(Request("id"))     '接受xmlhttp对象传过来的值
     If id<>"" Then
	    '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 		Set rs=Server.CreateObject("adodb.recordset")
		rs.Open ("select corporation_sort from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1
	      If Not rs.Eof Then
 	      pencat=rs("corporation_sort")        
	      End If
   		 Set rs=Server.CreateObject("adodb.recordset")
	    	rs.Open ("SELECT sortid,sort 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
 		'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        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/trade_2.asp><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>" 
	HOPE_type=HOPE_type&"<div id='yabock'><div class='mulur'><a href='"&HOPE_InstallDir&"index.html' class='la'>网站首页</a> &gt; <a href='"&HOPE_InstallDir&"corporation/index.html' class='la'>公司信息</a> > "&sortname&"</div>  <div class='fenli'><div class='yoleft'><img src='#HOPE_InstallDir#images/indexpoint.gif' width='5' height='9' /> 按<strong>分类</strong>筛选：</div><div class='yorift'><table width='600' 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
		
 		'处理二级类别的下级类别有多少
		 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=' color:#000000'>("&thirrs("thircount")&")</font>"
		  End If
		  thirrs.close    
		  End If
		  
		  		'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
				
  			HOPE_type=HOPE_type&" <td height=10 valign=top>"
			HOPE_type=HOPE_type&"<A href="""&sortid&"-"&rstype("typeid")&".html"" class=M onclick='AjaxSearchtr("&rstype("typeid")&")'>"&rstype("typename")&"</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&"</tr></table></div></div></div>"

   '获取该类下的信息内容^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      msg_per_page=15
 	   Set rs=Server.createobject("adodb.recordset")
     rs.Open ("select * from Websen_corporation where  Websen_corporation.sortid="&sortid&" and  flag=1 order by trust_score desc,id desc"),conn,1,1
    If not rs.Eof Then
	 totalrec=RS.RecordCount    '总记录条数
     rs.Pagesize=msg_per_page   '每页数
     mpage2=rs.Pagecount        '总页数
	 rowcount=msg_per_page
    End If
%>
     <!--#include file="../inc/headpage_html.asp"-->
<%
 	'HOPE_body用于显示页面的主题分类信息^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	 

     If rs.Eof Then
		HOPE_body=HOPE_body&"<br><br><div align='center' class='s'>此类暂无公司信息</div><br>"
     Else
	
	 i=1
	HOPE_body=HOPE_body&"<script type='text/javascript' src='"&HOPE_InstallDir&"autokind/showmsgrole.js'></script><script   language='vbscript'>sub AjaxSearchmsg() end  sub </script><input type='text' id='installurlmsg'  style='display:none; width:12;height:1'  value='"&HOPE_InstallDir&"autokind/showmsgrole.asp'/> "
     do while not rs.Eof and rowcount > 0
		
		HOPE_body=HOPE_body&" <TABLE width='100%' height=105 border=0 align=center cellPadding=0 cellSpacing=0>"&vbCrlf
		HOPE_body=HOPE_body&"<TBODY>"&vbCrlf
		HOPE_body=HOPE_body&"<TR"
     If icolor=0 Then 
		HOPE_body=HOPE_body&" bgColor=#ffffff" 
     Else 
		HOPE_body=HOPE_body&" bgColor=#f6f6f6" 
     End If
		HOPE_body=HOPE_body&">"&vbCrlf
		HOPE_body=HOPE_body&"<td width='1%' class='peyen'>&nbsp;</td>"&VbCrLf
		HOPE_body=HOPE_body&"<td width='60%' valign='top' class='peyen'>"&vbCrlf
'--是否使用的名片页------------------------------------------------------------
	   set rsmp=server.CreateObject("adodb.recordset")
	   sqlmp="select * from Websen_vipgrade where roleid="&rs("gradeid")
	   rsmp.open sqlmp,conn,1,1
	   if not rsmp.eof  then
	   if instr(rsmp("rolelist"),"qw")>0 then		
     If is2weburl=1 Then'二级域名'''''''''''''''''''''''''''''''''''''''''''''''''''
		
		HOPE_body=HOPE_body&"<a href='http://"&rs("user")&"."&weburl1&"' target=_blank class=b>"&rs("qymc")&"</A>"&vbCrlf 
     Else
		HOPE_body=HOPE_body&"<A href='"&HOPE_InstallDir&"vipcom/"&rs("user")&"' target=_blank class=b>"&rs("qymc")&"</A>"&vbCrlf 
		
     End If          
			
      Else
		HOPE_body=HOPE_body&"<A href="""&HOPE_InstallDir&"Ptcom/"&rs("user")&".html"" target=""_blank"" class=b>"&rs("qymc")&"</A>"&vbCrlf
     End If
	 rsmp.close
	 end if
	 
		 HOPE_body=HOPE_body&" <FONT color=#666666>"
		c="select title from Websen_cor_format where id="&rs("p_z_Z_LegalStatus")&""
     Set rsc=Server.CreateObject("ADODB.Recordset")
	 rsc.Open c,conn,1,1 
     If not rsc.Eof Then
			HOPE_body=HOPE_body&"（"&rsc("title")&"）"
     End If
		rsc.Close
     Set rsc=Nothing
	 
		HOPE_body=HOPE_body&"</FONT><BR>[摘要]"&vbCrlf
 		HOPE_body=HOPE_body&""&Left(RemoveHTML(rs("qyjj")),55)&"……<br>"&vbCrlf
		
		'--是否使用的名片页------------------------------------------------------------
	   set rsmp1=server.CreateObject("adodb.recordset")
	   sqlmp1="select * from Websen_vipgrade where roleid="&rs("gradeid")
	   rsmp1.open sqlmp1,conn,1,1
	   FileFlag=rsmp1("FileFlag")
	   if not rsmp1.eof  then
	   if instr(rsmp1("rolelist"),"qw")>0 then	 	
	          If is2weburl=1 Then
		HOPE_body=HOPE_body&"<a href='http://"&rs("user")&"."&weburl1&"/Cusmsg.htm' target=""_blank""><img src='#HOPE_InstallDir#images/wansen_jy.gif' width='69' height='21' border='0' /></a>&nbsp; <a href='http://"&rs("user")&"."&weburl1&"/Contact.htm' target=""_blank""><img src='#HOPE_InstallDir#images/wansen_lx.gif' width='69' height='21' border='0' /></a>"
     Else
		HOPE_body=HOPE_body&" <a href='"&HOPE_InstallDir&"vipcom/"&rs("user")&"/Cusmsg.htm' target=""_blank""><img src='#HOPE_InstallDir#images/wansen_jy.gif' width='69' height='21' border='0' /></a>&nbsp; <a href='"&HOPE_InstallDir&"vipcom/"&rs("user")&"/Contact.htm' target=""_blank""><img src='#HOPE_InstallDir#images/wansen_lx.gif' width='69' height='21' border='0' /></a>"
     End If
      End If
	  
	  
		HOPE_body=HOPE_body&"</TD>"&vbCrlf
		HOPE_body=HOPE_body&"<td width='3%' class='peyen'>&nbsp;</td>"&VbCrLf
		HOPE_body=HOPE_body&"<TD width=""14%"" style=' text-align: center' class='peyen'><img border=""0"" src=""../../UploadFile/vipgrade/"&rsmp1("FileFlag")&""" width=20></td>"
 		HOPE_body=HOPE_body&"<TD width=""13%"" style=' padding-left: 15px' class='peyen'>"&vbCrlf
		HOPE_body=HOPE_body&"<img src=""../../images/trust.gif"" width=22 height=14 border=0><br>"&rs("trust_score")&"<br> "
		HOPE_body=HOPE_body&"</TD>"&vbCrlf
		HOPE_body=HOPE_body&"<TD width=""10%"" class='peyen'>"&vbCrlf
		
			  rsmp1.close
	  end if
     If rs("country")="中国" Then
		HOPE_body=HOPE_body&rs("Sf")&"-"&rs("City")
      Else
		HOPE_body=HOPE_body&rs("country")
     End If
     If rs("tm")<>"" then	
HOPE_body=HOPE_body&"<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin="&rs("tm")&"Site=www.websen.net&Menu=yes><img border=0 SRC=#HOPE_InstallDir#images/anlineqt.gif alt=点击这里给我发消息></a>"
     End if
	
		 HOPE_body=HOPE_body&"</TD>"&vbCrlf
		 HOPE_body=HOPE_body&"<TD width=""15%""class=S align=center class='peyen'><input type='checkbox'   style='display:none;'    name='msgid' checked  value='"&i&",'/>"&vbCrlf
  		HOPE_body=HOPE_body&"</TD>"&vbCrlf
		HOPE_body=HOPE_body&"</TR>"&vbCrlf
		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&"<TABLE cellSpacing=0 cellPadding=0 width='100%' height='30' border=0 class='zheyen'>"&vbCrlf
			HOPE_body=HOPE_body&"<TBODY>"&vbCrlf
			HOPE_body=HOPE_body&"<TR>"&vbCrlf
			HOPE_body=HOPE_body&"<TD  align='right' class='bgeyen'>"&vbCrlf
		If not (rs.Eof and rs.Bof) Then
			gopage=currentpage2
			totalpage=mpage2
			blockPage=Int((gopage-1)/10)*10+1
			 HOPE_body=HOPE_body&"&nbsp;&nbsp;共 "&totalrec&" 条信息，每页 "&msg_per_page&" 条信息，共 "&mpage2&" 页，浏览&nbsp;"
		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 
			
		   i=1
	    Do Until i > 10 or blockPage > mpage2
		If blockPage=Int(gopage) Then
		   HOPE_body=HOPE_body&"<font color=#FF0000>"&blockPage&"</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
			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&" 页"
			
		Else
			
		
		   i=1
		Do Until i > 10 OR blockPage > mpage2
		If blockPage=int(gopage) Then
		    HOPE_body=HOPE_body&"<font color=#ff0000>"&blockPage&"</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
			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&" 页"
			
		End If
			
			'Startinfo=((gopage-1)*msg_per_page)+1
			'Endinfo=gopage*msg_per_page
		'If Endinfo>totalrec Then Endinfo=totalrec
		   
		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>"&vbCrlf
			HOPE_body=HOPE_body&"<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/com_1_page.asp' />"&vbCrlf
			
  	'企业推荐榜：属于该行业的网盛通企业(显示5个作为网盛通指数最高的)^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		HOPE_Cor=HOPE_Cor&"<table width=""100%"" align=center  border=""1"" bordercolor=#F0F0F0  cellpadding=""0"" cellspacing='1'>"&VbCrLf
		sql="select top 5 id,qymc,[user],sf,city from Websen_corporation where sortid="&sortid&" and flag=1 order by trust_score desc,id desc"
		Set rs= Server.CreateObject("ADODB.RecordSet") 
		rs.Open sql,conn,1,1
			If rs.Eof Then
	     HOPE_Cor=HOPE_Cor&"<tr><td height='23' class=""s"" align=""center""><input name=""postOffer"" type=""button"" value=""立即注册抢占此推荐位！"" onclick=location.href="""&HOPE_InstallDir&"login/register.asp""></td></tr>"&VbCrLf
			Else
			comi=1
			Do While Not rs.Eof
			
			If is2weburl=1 Then
	     HOPE_Cor=HOPE_Cor&"<tr><td height='23' class=""lh13""><b>·<a href='http://"&rs("user")&"."&weburl1&"'  target='_blank'>"&rs("qymc")&"</a></b><br>&nbsp;&nbsp;<font color='#666666' class='S'>所属区域："&rs("sf")&""&rs("city")&"</font></td></tr>"&VbCrLf

			Else
			
		 HOPE_Cor=HOPE_Cor&"<tr><td height='23' class=""lh13""><b>·<a href='"&HOPE_InstallDir&"vipcom/"&rs("user")&"/'  target='_blank'>"&rs("qymc")&"</a></b><br>&nbsp;&nbsp;<font color='#666666' class='S'>所属区域："&rs("sf")&"-"&rs("city")&"</font></td></tr>"&VbCrLf

			End If
			
 		 HOPE_Cor=HOPE_Cor&"<tr><td height='5'></td></tr>"&VbCrLf
			
			If comi=5 Then  exit do 
			
			comi=comi+1
			rs.Movenext
			Loop
			End If
		HOPE_Cor=HOPE_Cor&"</table>"&VbCrLf
 	 
		  If totalrec="" Then 
		  totalrec=0
		  End If
		  HOPE_TotalCor="<font color=red>"&totalrec&"</font>"      '此类公司数统计
  		  HOPE_DH=totalrec
		  rs.Close
 		 
		  HOPE_Title=sortname '页面标题
 	 
    '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  end  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      
      Dim fso,fmodify
 	  Set fso = YXFSO
       If fso.FileExists(Server.MapPath(HOPE_InstallDir&"corporation/trade/"&id&".html"))  Then
	     If kindtime<>"0" then 
 	   '如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        Set fmodify = fso.GetFile(Server.MapPath(HOPE_InstallDir&"corporation/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&"corporation/trade/"&sortid&".html"))
         '说明：加入js脚本是用于更新页面
 		 sort_savem.Write pencat&"<script src="&HOPE_InstallDir&"autokind/com_1.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&"corporation/trade/"&sortid&".html"))
        '说明：加入js脚本是用于更新页面
 		sort_save.Write pencat&"<script src="&HOPE_InstallDir&"autokind/com_1.asp?id="&id&"></script>"
		sort_save.Close
		'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 	   End If
  	 Set fso = Nothing
     conn.Close
     Set conn=Nothing
	 End If
  %>