<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 productshow_sort from [Websen_worldec_Temp] where yx_selected=1"),conn,1,1
	      If Not rs.Eof Then
 	      pencat=rs("productshow_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_BJ(typeid)#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		 '参数：typeid----1 为横向分单元格显示；0--为纵向分行显示
		 Function  HOPE_BJ(typeid)
			 If typeid<=0 Then 
			 typeid=0
			 Else
			 typeid=1
			 End If
			 strs=""
			 strs="<script type='text/javascript' src='"&HOPE_InstallDir&"compare.js'></script><script language='javascript' >function zhu(str){ if(str.checked){ document.getElementById('searchwordb').value= document.getElementById('searchwordb').value+str.value; }else{ document.getElementById('searchwordb').value=document.getElementById('searchwordb').value.replace(str.value,''); } } </script> <div> <input type='text' id='searchwordb'  style='display:none'  value=''/><input type='text' id='installurlb'  style='display:none; width:12;height:1'  value="&HOPE_InstallDir&" />  <input type='text' id='typeid'  style='display:none; width:12;height:1'  value="&typeid&" /> </div> <div id='search_resultb'></div>"
			   HOPE_BJ=strs
		 End Function
		 
      '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
	  	     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>"
		OPE_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/pro_2.asp>"
		HOPE_Type=HOPE_Type&"<div id='yabock'><div class='mulur'><a href='"&HOPE_InstallDir&"index.html' class='la'>网站首页</a> &gt; <a href='"&HOPE_InstallDir&"productshow/index.html' class='la'>产品中心</a> > "&sortname&"</div>  <div class='fenli'><div class='yoleft'> 按分类筛选：</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
		
         '^^^^^^^^^^^^^^^^^^^^^^^^^    start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		 '查询出属于第一类的二级分类下的所含小分类的总数

		secCount=0
		Set sesers=Server.CreateObject("adodb.recordSet")
		sesesql="select count(*) as totalse from Websen_Class_3 where typeid="&rstype("typeid")
		sesers.Open sesesql,conn,1,1
		If not sesers.Eof Then
		If sesers("totalse")>0 Then
		   secCount="<font color=red>"&sesers("totalse")&"</font>"
		   Else
		   secCount=0
	
		End If
		End If
		 
		 '^^^^^^^^^^^^^^^^^^^^^^^^^     end    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 	
        HOPE_Type=HOPE_Type&"<TD valign=top height=10>"
		HOPE_Type=HOPE_Type&"&nbsp;<A href='"&HOPE_InstallDir&"productshow/trade/"&sortid&"-"&rstype("typeid")&".html' onclick='AjaxSearchtr("&rstype("typeid")&")'><span style=' font-size:12px; color:#003278'>"&rstype("typename")&"</span></A> <font style='font-size:12px; color:#666666'>("&secCount&")</font>"
		HOPE_type=HOPE_type&" </td> " 
		If j mod 5 = 0 Then 
			HOPE_Type=HOPE_Type&"</TR>" 
		End If 
		rstype.movenext
		j=j+1
	loop
		End If
		HOPE_Type=HOPE_Type&"</tr></table></div></div></div>"
		
   '获取该类下的信息内容^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      msg_per_page=15
    Set rs=Server.CreateObject("adodb.recordset")
  	 rs.Open ("select    Websen_productshow.id,Websen_productshow.sortid,Websen_productshow.Cpmc,Websen_productshow.typeid,Websen_productshow.xxsm,Websen_productshow.Cpcd,Websen_productshow.typeid_2,Websen_productshow.idate,Websen_productshow.picture,Websen_corporation.qymc,Websen_corporation.[user],Websen_corporation.flag as cflag,Websen_corporation.Address,Websen_corporation.msn,Websen_corporation.gradeid,Websen_corporation.tm,Websen_corporation.Phone,Websen_corporation.mobile,Websen_corporation.trust_score from Websen_productshow,Websen_corporation where Websen_productshow.sortid="&sortid&" and Websen_productshow.flag=1 and Websen_corporation.id=Websen_productshow.gsid   order by Websen_corporation.trust_score desc,Websen_productshow.idate 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
	
		 jjcom=1
		  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
		 jjcom = jjcom + 1
		If jjcom mod 2 =0 Then 
		colors="#FFFFFF"
		Else
		colors="#F6F6F6"
		End If
			HOPE_body=HOPE_body&"<table border=0  width='100%' cellpadding=0 cellspacing=0 ><tr><td><table width=""100%""  border=""0"" cellpadding=""0"" cellspacing=0>"

		HOPE_body=HOPE_body&"<tr bgcolor="&colors&"><TD align=center width='5%' class='peyen'><input type='checkbox' name='id' value='"&rs("id")&",' onclick='zhu(this);' /></td>"
 		
		If rs("picture")<>"../../UploadFile/nopicture.gif" or rs("picture")<>""  Then
			HOPE_body=HOPE_body&"<td class='peyen'><A class=s href='"&HOPE_InstallDir&"productshow/offerdetail/"&rs("sortid")&"-"&rs("typeid")&"-"&rs("typeid_2")&"-"&rs("id")&".html'  target=_blank><IMG src='"&HOPE_InstallDir&"vipcom/"&rs("user")&"/"&rs("picture")&"'  border=0 width=100 height=100> </A></td>"&VbCrLf
 			
		Else
			HOPE_body=HOPE_body&"<div class='bick_photo'>无图</div>"
		End If
		HOPE_body=HOPE_body&"<td width='2%' class='peyen'>&nbsp;</td>"&VbCrLf
 		HOPE_body=HOPE_body&"<td width='50%' valign='top' style=' line-height:160%; padding-top: 5px' class='peyen'>  "&VbCrLf
		HOPE_body=HOPE_body&"<a href='"&HOPE_InstallDir&"productshow/offerdetail/"&rs("sortid")&"-"&rs("typeid")&"-"&rs("typeid_2")&"-"&rs("id")&".html' target=_blank class='b'>"&left(rs("Cpmc"),20)&"</a>&nbsp;<font color=#C5C8C9>["&year(rs("idate"))&"-"&month(rs("idate"))&"-"&day(rs("idate"))&"]</font><br>"&Left(RemoveHTML(rs("xxsm")),40)&"......<br>" 
		
 '--是否使用的名片页------------------------------------------------------------
	   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><b>"&rs("qymc")&"</b></a>"&VbCrLf
		Else
		  HOPE_body=HOPE_body&"   <A href='"&HOPE_InstallDir&"vipcom/"&rs("user")&"/' target=_blank><b>"&rs("qymc")&"</b></a>"&VbCrLf
			End If
			Else
		 HOPE_body=HOPE_body&" <A href='"&HOPE_InstallDir&"Ptcom/"&rs("user")&".html' target=_blank><b>"&rs("qymc")&"</b></a>"&VbCrLf
		End If
 			rsmp.close
		  end if
		   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
	
	rsmp1.close
	end if
		  
	'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       HOPE_body=HOPE_body&"<TD width=""5%"" align=center class='peyen'>&nbsp;</td>"
 		HOPE_body=HOPE_body&"<TD width=""11%"" style=' padding-left: 10px' class='peyen'>"&vbCrlf
		HOPE_body=HOPE_body&"<img border=""0"" src=""../../UploadFile/vipgrade/"&FileFlag&""" width=20>"
		HOPE_body=HOPE_body&"</TD>"&vbCrlf
	    HOPE_body=HOPE_body&"<td  width='12%' align=center style="" padding-right: 10px""  class='peyen'><img src=""../../images/trust.gif"" width=22 height=14 border=0><br>"&rs("trust_score")&"</td><td width='15%' style=' text-align: right' class='peyen'>"
	 
  		 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><br><br>"&rs("Cpcd")&""
    End if
  
 		 HOPE_body=HOPE_body&"</td></TR>" 
         HOPE_body=HOPE_body&"</table></td></tr></table>"

	    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><TABLE width='100%' border=0 align=center cellPadding=1 cellSpacing=0 style='BORDER-TOP: #9C9A9C 1px solid'><tr><td height='5px'></td></tr><tr><td valign=top><img src='#HOPE_InstallDir#images/list_rt_slt_ico_2.gif' width='14' height='16' />&nbsp;<input type='image' onclick='AjaxSearchb();' src='#HOPE_InstallDir#images/dbcp.gif' width=' 69' height='21' value='我要进行产品比较' />&nbsp;请选择要比较的项</td></tr></table><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/pro_1_page.asp' />"&vbCrlf
			
			
	 
  	HOPE_Title=sortname '页面标题
 
  
    HOPE_TradeGo="<a href='"&HOPE_InstallDir&"'>首页</a> > <a href='"&HOPE_InstallDir&"productshow/'>产品库</a> > "&HOPE_Title
 	

    	  
		'属于该行业的推荐的网盛通会员的产品^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		Set rstjy=Server.CreateObject("ADODB.Recordset")
		 sqltjy="select  top  15  Websen_productshow.id,Websen_productshow.sortid,Websen_productshow.typeid,Websen_productshow.typeid_2,Websen_productshow.Cpmc from Websen_productshow,Websen_corporation where Websen_productshow.GsID=Websen_corporation.id and Websen_corporation.Tjbz like '%0%' and Websen_productshow.flag=1  and Websen_productshow.sortid="&sortid&" and  Websen_productshow.typeid=0 and Websen_productshow.typeid_2=0 and Websen_corporation.flag=1  order by Websen_corporation.trust_score desc,Websen_productshow.idate 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&"&nbsp;．<a href='"&HOPE_InstallDir&"productshow/offerdetail/"&rstjy("sortid")&"-"&rstjy("typeid")&"-"&rstjy("typeid_2")&"-"&rstjy("id")&".html'  target=_blank>"&rstjy("cpmc")&"</a><br>"
		   If tji=15 Then	   Exit Do
		   tji=tji+1
		   rstjy.Movenext
		   Loop
		   rstjy.Close
		   End If 
 		HOPE_TjCom=tjcompany
  	 rs.Close
    '取出模版页和对标签赋值^^^^^^^^^^^^^^^^^^^^^^  end  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      
      Dim fso,fmodify
 	  Set fso = YXFSO
       If fso.FileExists(Server.MapPath(HOPE_InstallDir&"productshow/trade/"&id&".html"))  Then
	   If kindtime<>"0" then 
	   '如果文件存在就按时间进行更新^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        Set fmodify = fso.GetFile(Server.MapPath(HOPE_InstallDir&"productshow/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&"productshow/trade/"&sortid&".html"))
         '说明：加入js脚本是用于更新页面
 		 sort_savem.Write pencat&"<script src="&HOPE_InstallDir&"autokind/pro_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&"productshow/trade/"&sortid&".html"))
        '说明：加入js脚本是用于更新页面
 		sort_save.Write pencat&"<script src="&HOPE_InstallDir&"autokind/pro_1.asp?id="&id&"></script>"
		sort_save.Close
		'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 	   End If
  	 Set fso = Nothing
     conn.Close
     Set conn=Nothing
  End if
 %>