<%
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	dir="no"
	numid="no"
%>
<!--#include file="../../conn/conn.asp"-->
<%
'取得返回参数(参数必须数字，如果不为数字且不能强制转换，则不会显示)
dim ispic,picwidth,picheight,typeid,num,leftstr,isnew,brnum,timed
ispic=Cint(trim(request("ispic")))
picwidth=Cint(trim(request("picwidth")))
picheight=Cint(trim(request("picheight")))
typeid=Cint(trim(request("typeid")))
num=Cint(trim(request("num")))
leftstr=Cint(trim(request("leftstr")))
isnew=Cint(trim(request("isnew")))
brnum=Cint(trim(request("brnum")))
timed=Cint(trim(request("timed")))
'--------------------------在JS调用时打印--------------------------------	
response.write("document.write("""+ HOPE_Product(ispic,picwidth,picheight,typeid,num,leftstr,isnew,brnum,timed) +""")")
'------------------------------------------------------------------------






'---------------------------------------------------------------------------------------------------------
'动态调用产品信息   参数说明如下：

'HOPE_Product(ispic,picwidth,picheight,typeid,num,leftstr,isnew,brnum,timed) 一共9个参数
' ispic--(1为图片形式，2为文字形式)
'[picwidth---（图片宽度）、picheight为高度,只有当ispic为1时生效]
'typeid--（信息大类id）
'num--(显示条数)
'leftstr--(显示字数)
'isnew----(0为全部，1为推荐，2为会员,3产品报价)
'brnum---(几条信息换行)
'timed--(1为显示时间，0为不显示)
'--------------------------------------------------------------------------------------------------------- 
Function HOPE_Product(ispic,picwidth,picheight,typeid,num,leftstr,isnew,brnum,timed)			
			strs=""
 			If brnum<=0 Then
			   brnum=1 
			 End If 
 			 If typeid<=0  Then
				typestr="" 
			 Else
				typestr="  and SortID="&typeid
			  End If
 			 If isnew=1 Then
				kindstr="and Zsbz like '%0%' "
			 Else 
				kindstr=""
			 End If
  			 Set rsh=Server.CreateObject("ADODB.Recordset")
			 hsql="select top "&num&"  * from  yixiang_productshow where id<>0 and flag=1  "&kindstr&typestr
			 if isnew=3 then '加入产品报价 
			 hsql=hsql&" and iscpbj=1 "
			 end if 
 			 hsql=hsql&" order by id desc"
			 rsh.open hsql,conn,1,1
			  If rsh.Eof Then
				strs="暂无信息"
			  Else
				ee=1
				ff=0
				strs="<table border=0 cellpadding=0 cellspacing=0 width='100%'><tr>"
	 If isnew=3 Then   
  		   Do While Not rsh.Eof 
 				set rshv=Server.CreateObject("ADODB.Recordset")
				hvsql="select * from yixiang_corporation where flag=1 and   ID="&rsh("GsID")
				rshv.open hvsql,conn,1,1
				 If Not rshv.Eof Then
				   If rshv("flag")=1   Then
					ff=ff+1
  				   If ispic=1 Then
					 picstr="<img src="&HOPE_InstallDir&"vipcom/"&rshv("user")&"/"&rsh("Picture")&" width="&picwidth&" height="&picheight&" border=0  ><br>"
				   Else
					 picstr="·"
				   End If
 			  strs=strs&"<td height='line-height:160%'><a href="&HOPE_InstallDir&"productshow/offerdetail/"&rsh("SortID")&"-"&rsh("TypeID")&"-"&rsh("typeid_2")&"-"&rsh("ID")&".html  target=_blank>"&picstr&left(rsh("Cpmc"),leftstr)&"&nbsp;<font color=red>产品报价:"&rsh("proprice")&"元</font></a>"
 				  If timed=0 Then
					 strs=strs&""
				  Else
			  strs=strs&"("&month(rsh("idate"))&"-"&day(rsh("idate"))&")"
				 End If
 			  strs=strs&"&nbsp;</td><td width=2></td>"
				 End If  
 				End If 
 				If ff Mod brnum =0 Then
				   strs=strs&"</tr><tr>"
				End If
 			  rsh.Movenext 
			  Loop  
			  If ff=0 Then
				 strs=strs&"<td height=25>暂无产品信息</td>"   
			  End If
			  strs=strs&"</tr></table>"
			  rsh.Close
			  Set rsh=Nothing
			 End If
			 
			 
 		If isnew=2 Then  '处理会员会员情况
  		   Do While Not rsh.Eof 
 				set rshv=Server.CreateObject("ADODB.Recordset")
				hvsql="select * from yixiang_corporation where flag=1 and  ID="&rsh("GsID")
				rshv.open hvsql,conn,1,1
				 If Not rshv.Eof Then
				   If rshv("flag")=1   Then
					ff=ff+1
  				   If ispic=1 Then
					 picstr="<img src="&HOPE_InstallDir&"vipcom/"&rshv("user")&"/"&rsh("Picture")&" width="&picwidth&" height="&picheight&" border=0  ><br>"
				   Else
					 picstr="·"
				   End If
 			  strs=strs&"<td height='line-height:160%'><a href="&HOPE_InstallDir&"productshow/offerdetail/"&rsh("SortID")&"-"&rsh("TypeID")&"-"&rsh("typeid_2")&"-"&rsh("ID")&".html  target=_blank>"&picstr&left(rsh("Cpmc"),leftstr)&"</a>"
 				  If timed=0 Then
					 strs=strs&""
				  Else
			  strs=strs&"("&month(rsh("idate"))&"-"&day(rsh("idate"))&")"
				 End If
 			  strs=strs&"&nbsp;</td><td width=2></td>"
				 End If  
 				End If 
 				If ff Mod brnum =0 Then
				   strs=strs&"</tr><tr>"
				End If
 			  rsh.Movenext 
			  Loop  
			  If ff=0 Then
				 strs=strs&"<td height=25>暂无产品信息</td>"   
			  End If
			  strs=strs&"</tr></table>"
			  rsh.Close
			  Set rsh=Nothing
			 End If
  		If isnew=0 or isnew=1  Then
		  picv=""
			Do While Not rsh.Eof 
 			 Set rshv=Server.CreateObject("ADODB.Recordset")
				hvsql="select * from yixiang_corporation where flag=1 and  ID="&rsh("GsID")
				rshv.open hvsql,conn,1,1
				 If Not rshv.Eof Then
 					picv=rshv("user")
					set rshv=Nothing
				 End If
  			  If ispic=1 Then
				 picstr="<img src="&HOPE_InstallDir&"vipcom/"&picv&"/"&rsh("Picture")&" width="&picwidth&" height="&picheight&" border=0  align=center vspace=4 hspace=4 ><br>"
			  Else
				picstr="·"
			  End If
 			  strs=strs&"<td style='line-height:150%'><a href="&HOPE_InstallDir&"productshow/offerdetail/"&rsh("SortID")&"-"&rsh("TypeID")&"-"&rsh("typeid_2")&"-"&rsh("ID")&".html  target=_blank>"&picstr&left(rsh("Cpmc"),leftstr)&"</a>"
 			  If timed=0 Then
				 strs=strs&""
			  Else
				 strs=strs&"("&year(rsh("idate"))&"-"&month(rsh("idate"))&"-"&day(rsh("idate"))&")"
			  End If
 			  strs=strs&"&nbsp;</td><td width=2></td>"
 			  If ee Mod brnum =0 Then
				 strs=strs&"</tr><tr>"
			  End If
 			  rsh.Movenext 
			  ee=ee+1
			  Loop  
			  strs=strs&"</tr></table>"
			  rsh.Close
			  Set rsh=Nothing
			 End If
			End If
 	HOPE_Product=strs
End Function 
%>