<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<!--#include file="include/coding.asp "-->
<script src="http://count1.ftaobao.com/QQcf.asp?user_name=ruikeeadmin"></script>
<%
'取得传递的 QueryString 和 Form 参数

Function Rst( psvaluename )
dim stemp
stemp = Trim(request.querystring("" & psvaluename))
if len(trim(stemp)) = 0 then
stemp = Trim(request.form("" & psvaluename))
end if
rst = stemp
End Function

'显示商品分类
sub ShowIndexClass()
ClassSql="select lbid,lbname from lb where cang=0 order by px desc,lbid"
set rsClass=server.createobject("adodb.recordset")
rsClass.open ClassSql,conn,1,1
strleft=strleft & "<div class=""Col2Left"">"& vbcrlf
strright=strright &" <div class=""Col2Right"">"& vbcrlf
isleft=true
do while not rsClass.eof

	if isleft then
	 strleft=strleft & "<h3 ><a href=""ProductList.asp?lbid="&rsClass("lbid")&""" >" & rsClass("lbname")&"</a></h3>"& vbcrlf
     strleft=strleft & "<ul class=""CategoryListInlineSepLevel1"">"& vbcrlf
	else
	 strright=strright & "<h3 ><a  href=""ProductList.asp?lbid="&rsClass("lbid")&""" >" & rsClass("lbname")&"</a></h3>"& vbcrlf
     strright=strright & "<ul class=""CategoryListInlineSepLevel1"">"& vbcrlf
	end if
	set rsClassFirt = conn.execute("select top 4 xlbid,xlbname from xlb where lbid="&rsClass("lbid")&" and cang=0 order by px desc,xlbid")
	lefti=0
	righti=0
	do while not rsClassFirt.eof
	
	if isleft then
	 strleft=strleft &"<li><a href=""ProductList.asp?lbid="&rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></li>"& vbcrlf
	else
	 strright=strright &"<li><a href=""ProductList.asp?lbid="&rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></li>"& vbcrlf
	end if
	
	rsClassFirt.movenext
	
	loop
	if isleft then
	    strleft=strleft & " </ul>"& vbcrlf
	    strleft=strleft & "<div class=""HackBox""></div>"& vbcrlf
    else'
	   strright=strright & " </ul>"& vbcrlf
	   strright=strright & "<div class=""HackBox""></div>"& vbcrlf
	end if
	rsClassFirt.close
	set rsClassFirt=nothing
	if isleft then
	    isleft=false
    else
	    isleft=true
	end if
rsClass.movenext
loop
    strleft=strleft & "</div>"
    strright=strright &" <h3 class=""CategoryListAll""><a href=""sort.asp"">所有商品分类>></a></h3> "& vbcrlf
	strright=strright &"</div>"
rsClass.close
set rsClass=nothing
Response.Write strleft
Response.write strright
end sub
'------------------------------------------------
'首页调用商城最新商品,以图片加文字显示,
sub ShowIndexNewProduct(ShowNum)
strNewProduct=strNewProduct & "<div id=""ChannelPicks"">" & vbcrlf
set rsNewProduct = conn.execute("select top "&ShowNum&" id,mc,xt from chanpin where xt<>'xt.gif' and cang=0 and tuijian=1 order by id desc")
if not rsNewProduct.eof then
  do while not rsNewProduct.eof
    strNewProduct=strNewProduct & "<div>" & vbcrlf
    strNewProduct=strNewProduct & "<a href=""merchandise.asp?id="&encode( rsNewProduct("id"))&"""><img src=""user/images/Rikeeupimages/"&rsNewProduct("xt")&""" width=""75"" height=""75"" />" & vbcrlf
    strNewProduct=strNewProduct & InterceptString(rsNewProduct("mc"),12)&"</a>" & vbcrlf
    strNewProduct=strNewProduct & "</div>"
	rsNewProduct.movenext
    loop
else
    strNewProduct=strNewProduct & "<div>" & vbcrlf
    strNewProduct=strNewProduct & "<img src=""image/xt_bj.gif"" width=""75"" height=""75"" />" & vbcrlf
    strNewProduct=strNewProduct & "还没有商品！"
    strNewProduct=strNewProduct & "</div>"
end if
rsNewProduct.close
set rsNewProduct=nothing
strNewProduct=strNewProduct & "</div>"
response.write strNewProduct
end sub
'-------------------------------------------------------
'店铺首页,显示分类
sub ShowShopIndexClass()
i=0
strShowShopIndexclass= strShowShopIndexclass & "<div id=""ShopCategory"">" &vbcrlf
SelectFromTopicSql="select topicname from topic order by orderID Asc"
set rsSelectFromTopic=conn.execute(SelectFromTopicSql)
if not rsSelectFromTopic.eof then
   do while not  rsSelectFromTopic.eof
           select case  rsSelectFromTopic("topicname")
		    case "数码": 
			ShowID="ShopsDigital" 
			case "女人": 
			topic="女人"
			case "男人":
			ShowID="ShopsMan"
			case "爱家": 
			ShowID="ShopsLife"
			case "书籍音像": 
			ShowID="ShopsCulture"
		    case "运动": 
			ShowID="ShopsSports"
			case "游戏": 
			ShowID="ShopsGame"
			case "花鸟市场": 
			ShowID="ShopsCollection"
			case "逛香港": 
			ShowID="ShopsHongkong"
			end select
			if len(rsSelectFromTopic("topicname")) then
			ShowShopIndexclassSql="select * from lb where cang=0 and topic='"& rsSelectFromTopic("topicname") & "'order by px desc,lbid"
			set rsShowShopIndexClass=server.createobject("adodb.recordset")
            rsShowShopIndexClass.open ShowShopIndexclassSql,conn,1,1
			 if not rsShowShopIndexClass.eof then
			      strShowShopIndexclass= strShowShopIndexclass & "<div id=""" & ShowID &""" class=""ShopCateL1"">"&vbcrlf
				  strShowShopIndexclass= strShowShopIndexclass & "<h2>"& rsSelectFromTopic("topicname") &"</h2>" &vbcrlf
				  strShowShopIndexclass= strShowShopIndexclass & "<div><hr /></div>" &vbcrlf
				  strShowShopIndexclass= strShowShopIndexclass & "<ul class=""CategoryListNormalLevel1"">" &vbcrlf
               do while not rsShowShopIndexClass.eof
                  strShowShopIndexclass= strShowShopIndexclass & "<li><a href=""shoplist.asp?s=yes&lx=4&PageType=A&lbid="&rsShowShopIndexClass("lbid") &""">"&rsShowShopIndexClass("lbName") &"</a></li>"&vbcrlf
			      rsShowShopIndexClass.movenext
			      loop
				  strShowShopIndexclass= strShowShopIndexclass & "</ul>" &vbcrlf
				  strShowShopIndexclass= strShowShopIndexclass & "</div>" &vbcrlf
				  i=i+1
			 end if
			end if
			if i=2 then
			 strShowShopIndexclass= strShowShopIndexclass & "<div class=""HackBox""></div>" &vbcrlf
			 i=0
			end if
			rsSelectFromTopic.movenext
         loop
end if

strShowShopIndexclass= strShowShopIndexclass & "</div>" &vbcrlf

response.write  strShowShopIndexclass

rsSelectFromTopic.close
set rsSelectFromTopic=nothing 
rsShowShopIndexclass.close
set rsShowShopIndexclass=nothing 
end sub


Sub ShowAllClass()
classSql="select lbid,cp,lbname from lb where cang=0 order by px desc,lbid"
set rsClass=server.createobject("adodb.recordset")
    rsClass.open ClassSql,conn,1,1
   	isleft=true
do while not rsClass.eof
	if isleft then
	 strleft=strleft &"<table width=""100%"" border=""0""><tr><td width=""19""><img height=""11"" hspace=""4""  src=""images/go.gif"" width=""11""></td>" &vbcrlf
	 strleft=strleft & "<td><nobr><a class=""catlevel0"" href=""ProductList.asp?lbid="& rsClass("lbid")&""">"& rsClass("lbname") & "</a>(<font color=red>"&rsClass("cp")&"</font>)</nobr></td>"& vbcrlf
	 strleft=strleft & "</tr><tr><td width=""19"">&nbsp;</td><td class=""catlevel1"">" & vbcrlf
     else
	 strright=strright &"<table width=""100%"" border=""0""><tr><td width=""19""><img height=""11"" hspace=""4""  src=""images/go.gif"" width=""11""></td>" &vbcrlf
	 strright=strright & "<td><nobr><a class=""catlevel0""href=""ProductList.asp?lbid="& rsClass("lbid")&""">"& rsClass("lbname") & "</a>(<font color=red>"&rsClass("cp")&"</font>)</nobr></td>"& vbcrlf
	 strright=strright & "</tr><tr><td width=""19"">&nbsp;</td><td class=""catlevel1"">" & vbcrlf
	end if
	
	set rsClassFirt = conn.execute("select xlbid,xlbname from xlb where lbid="&rsClass("lbid")&" and cang=0 order by px desc,xlbid")
	do while not rsClassFirt.eof
		if isleft then
		strleft=strleft &"<nobr><a href=""ProductList.asp?lbid="& rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></nobr>"& vbcrlf
		else
		strright=strright &"<nobr><a href=""ProductList.asp?lbid="& rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></nobr>"& vbcrlf
		end if
	rsClassFirt.movenext
	loop
	
	
	if isleft then
	    strleft=strleft & "</td></tr></table>"& vbcrlf
    else
	    strright=strright & "</td></tr></table>"& vbcrlf
	end if
	rsClassFirt.close
	set rsClassFirt=nothing
	if isleft then
	    isleft=false
    else
	    isleft=true
	end if
rsClass.movenext
loop
rsClass.close
set rsClass=nothing
Response.write "<table width=""100%"" border=0>" & vbcrlf
Response.write  "<tr>" & vbcrlf
Response.write "<td valign=""top"" width=""47%"">" & vbcrlf
Response.write  strleft
Response.Write "</td><td width=""6%"">&nbsp;</td>"
Response.write  "<td valign=""top"" width=""47%"">" & vbcrlf
Response.write  strright
Response.write  "</td></tr>" & vbcrlf
Response.write  "</table>"

end sub	

'----------------
'求购列表
'----------------

Sub ShowAllClassqiougou()
classSql="select lbid,qgnum,lbname from lb where cang=0 order by px desc,lbid"
set rsClass=server.createobject("adodb.recordset")
    rsClass.open ClassSql,conn,1,1
   	isleft=true
do while not rsClass.eof
	if isleft then
	 strleft=strleft &"<table width=""100%"" border=""0""><tr><td width=""19""><img height=""11"" hspace=""4""  src=""images/go.gif"" width=""11""></td>" &vbcrlf
	 strleft=strleft & "<td><nobr><a class=""catlevel0"" href=""qiougouList.asp?lbid="& rsClass("lbid")&""">"& rsClass("lbname") & "</a>(<font color=red>"&rsClass("qgnum")&"</font>)</nobr></td>"& vbcrlf
	 strleft=strleft & "</tr><tr><td width=""19"">&nbsp;</td><td class=""catlevel1"">" & vbcrlf
     else
	 strright=strright &"<table width=""100%"" border=""0""><tr><td width=""19""><img height=""11"" hspace=""4""  src=""images/go.gif"" width=""11""></td>" &vbcrlf
	 strright=strright & "<td><nobr><a class=""catlevel0""href=""qiougouList.asp?lbid="& rsClass("lbid")&""">"& rsClass("lbname") & "</a>(<font color=red>"&rsClass("qgnum")&"</font>)</nobr></td>"& vbcrlf
	 strright=strright & "</tr><tr><td width=""19"">&nbsp;</td><td class=""catlevel1"">" & vbcrlf
	end if
	
	set rsClassFirt = conn.execute("select xlbid,xlbname from xlb where lbid="&rsClass("lbid")&" and cang=0 order by px desc,xlbid")
	do while not rsClassFirt.eof
		if isleft then
		strleft=strleft &"<nobr><a href=""qiougouList.asp?lbid="& rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></nobr>"& vbcrlf
		else
		strright=strright &"<nobr><a href=""qiougoulist.asp?lbid="& rsClass("lbid")&"&amp;xlbid="&rsClassFirt("xlbid")&""">"&rsClassFirt("xlbname") &"</a></nobr>"& vbcrlf
		end if
	rsClassFirt.movenext
	loop
	
	
	if isleft then
	    strleft=strleft & "</td></tr></table>"& vbcrlf
    else
	    strright=strright & "</td></tr></table>"& vbcrlf
	end if
	rsClassFirt.close
	set rsClassFirt=nothing
	if isleft then
	    isleft=false
    else
	    isleft=true
	end if
rsClass.movenext
loop
rsClass.close
set rsClass=nothing
Response.write "<table width=""100%"" border=0>" & vbcrlf
Response.write  "<tr>" & vbcrlf
Response.write "<td valign=""top"" width=""47%"">" & vbcrlf
Response.write  strleft
Response.Write "</td><td width=""6%"">&nbsp;</td>"
Response.write  "<td valign=""top"" width=""47%"">" & vbcrlf
Response.write  strright
Response.write  "</td></tr>" & vbcrlf
Response.write  "</table>"

end sub	


'----------------------------
'店铺列表左而栏
'--------------------
sub ShowLeftTopic()
i=0
strShowLeftTopic= strShowLeftTopic & "<div id=""SideShopCategory"" class=""StandardSidePanel"">" &vbcrlf
strShowLeftTopic= strShowLeftTopic & "<div class=""Title""><b>店铺类目</b></div>"&vbcrlf
SelectFromTopicSql="select topicname from topic order by orderID Asc"
set rsSelectFromTopic=conn.execute(SelectFromTopicSql)
if not rsSelectFromTopic.eof then
   do while not  rsSelectFromTopic.eof
           select case  rsSelectFromTopic("topicname")
		    case "数码": 
			ShowID="ShopsDigital" 
			case "女人": 
			topic="女人"
			case "男人":
			ShowID="ShopsMan"
			case "爱家": 
			ShowID="ShopsLife"
			case "书籍音像": 
			ShowID="ShopsCulture"
		    case "运动": 
			ShowID="ShopsSports"
			case "游戏": 
			ShowID="ShopsGame"
			case "花鸟市场": 
			ShowID="ShopsCollection"
			case "逛香港": 
			ShowID="ShopsHongkong"
			end select
			if len(rsSelectFromTopic("topicname")) then
			ShowShopIndexclassSql="select * from lb where cang=0 and topic='"& rsSelectFromTopic("topicname") & "'order by px desc,lbid"
			set rsShowShopIndexClass=server.createobject("adodb.recordset")
            rsShowShopIndexClass.open ShowShopIndexclassSql,conn,1,1
			 if not rsShowShopIndexClass.eof then
			      strShowLeftTopic= strShowLeftTopic & "<div id=""" & ShowID &""" class=""ShopCateL1"">"&vbcrlf
				  strShowLeftTopic= strShowLeftTopic & "<h2>"& rsSelectFromTopic("topicname") &"</h2>" &vbcrlf
               do while not rsShowShopIndexClass.eof
                  strShowLeftTopic= strShowLeftTopic & "<li><a href=""shoplist.asp?s=yes&lx=4&PageType=A&lbid="&rsShowShopIndexClass("lbid") &""">"&rsShowShopIndexClass("lbName") &"</a></li>"&vbcrlf
			      rsShowShopIndexClass.movenext
			      loop
				  strShowLeftTopic= strShowLeftTopic & "</ul>" &vbcrlf

				  i=i+1
			 end if
			end if
			if i=2 then
			 strShowLeftTopic= strShowLeftTopic & "<div class=""HackBox""></div>" &vbcrlf
			 i=0 
			end if
			rsSelectFromTopic.movenext
         loop
end if
strShowLeftTopic= strShowLeftTopic & "<div class=""Bottom""></div>" & vbcrlf
strShowLeftTopic= strShowLeftTopic & "</div>" &vbcrlf
rsShowShopIndexClass.close
set rsShowShopIndexClass =nothing
rsSelectFromTopic.close
Set rsSelectFromTopic=nothing
response.write  strShowLeftTopic
end sub


'----------------------------
'求购商品列表左面栏
'--------------------
sub ShowLeftTopicqiougou(topnum)
i=0
strShowLeftTopic= strShowLeftTopic & "<div id=""SideShopCategory"" class=""StandardSidePanel"">" &vbcrlf
strShowLeftTopic= strShowLeftTopic & "<div class=""Title""><b>求购类目(TOP"&topnum&")</b></div>"&vbcrlf
SelectFromTopicSql="select top "&topnum&" topic,lbid,qgnum,lbname from lb where cang=0 order by qgnum desc,px desc,lbid"
set rsSelectFromTopic=conn.execute(SelectFromTopicSql)
if not rsSelectFromTopic.eof then
   do while not  rsSelectFromTopic.eof
            select case  rsSelectFromTopic("topic")
		    case "数码": 
			ShowID="ShopsDigital" 
			case "女人": 
			topic="女人"
			case "男人":
			ShowID="ShopsMan"
			case "爱家": 
			ShowID="ShopsLife"
			case "书籍音像": 
			ShowID="ShopsCulture"
		    case "运动": 
			ShowID="ShopsSports"
			case "游戏": 
			ShowID="ShopsGame"
			case "花鸟市场": 
			ShowID="ShopsCollection"
			case "逛香港": 
			ShowID="ShopsHongkong"
			end select
			if len(rsSelectFromTopic("lbname")) then
			ShowShopIndexclassSql="select lbid,qgnum,xlbname,xlbid from xlb where lbid="&rsSelectFromTopic("lbid")&" and cang=0 order by px desc,lbid"
			set rsShowShopIndexClass=server.createobject("adodb.recordset")
            rsShowShopIndexClass.open ShowShopIndexclassSql,conn,1,1
			 if not rsShowShopIndexClass.eof then
			      strShowLeftTopic= strShowLeftTopic & "<div id=""" & ShowID &""" class=""ShopCateL1"">"&vbcrlf
				  strShowLeftTopic= strShowLeftTopic & "<h2>"& rsShowShopIndexClass("xlbname") &"</h2>" &vbcrlf
               do while not rsShowShopIndexClass.eof
                  strShowLeftTopic= strShowLeftTopic & "<li><a href=""qiougouList.asp?lbid="& rsShowShopIndexClass("lbid")&"&amp;xlbid="&rsShowShopIndexClass("xlbid")&""">"&rsShowShopIndexClass("xlbName") &"</a>("&rsShowShopIndexClass("qgnum")&")</li>"&vbcrlf
			      rsShowShopIndexClass.movenext
			      loop
				  strShowLeftTopic= strShowLeftTopic & "</ul>" &vbcrlf

				  i=i+1
			 end if
			end if
			if i=2 then
			 strShowLeftTopic= strShowLeftTopic & "<div class=""HackBox""></div>" &vbcrlf
			 i=0 
			end if
			rsSelectFromTopic.movenext
         loop
end if
strShowLeftTopic= strShowLeftTopic & "<div class=""Bottom""></div>" & vbcrlf
strShowLeftTopic= strShowLeftTopic & "</div>" &vbcrlf
rsShowShopIndexClass.close
set rsShowShopIndexClass =nothing
rsSelectFromTopic.close
Set rsSelectFromTopic=nothing
response.write  strShowLeftTopic
end sub




'----------------
'调用24小时人气榜
'--------------------
sub Show24HourHot(ShowNum)
str24HourHot=str24HourHot &"<table width=""100%"" border=""0"" cellpadding=""1"" cellspacing=""1"" bgcolor=""#B4E200"">"& vbcrlf
str24HourHot=str24HourHot &"<tr><td bgcolor=""#ffffff"">"&vbcrlf
str24HourHot=str24HourHot &"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"&vbcrlf	
str24HourHot=str24HourHot &"<tr><td bgcolor=""#B4E200"" height=""4""colspan=""3""></td></tr>"&vbcrlf	
str24HourHot=str24HourHot &"<tr><td bgcolor=""#B4E200"" width=""130""align=center><b>24小时人气榜</b></td>"&vbcrlf		   
str24HourHot=str24HourHot &"<td width=""21""><img src=""images/y_xie2.gif"" width=""21"" height=""19""></td>"&vbcrlf		   
str24HourHot=str24HourHot &"<td bgcolor=""#E9E9E9""><a href="""" target=""_blank""></a></td></tr></table>"&vbcrlf		   
str24HourHot=str24HourHot &"<table width=""98%""  border=""0"" align=""center"" cellpadding=""0"" cellspacing=""3"">"&vbcrlf	

lbid="" 
set rs24HourHot = conn.execute("select top "&ShowNum&" cpid,mc from js where cpid in(select id from chanpin where cang=0 and tui=0) "&lbid&" order by js desc,id desc")
do while not rs24HourHot.eof
 str24HourHot=str24HourHot &"<tr>"&vbcrlf
 str24HourHot=str24HourHot &" <td valign=""top"">·"
 str24HourHot=str24HourHot &"<a href=""merchandise.asp?id=" &encode(rs24HourHot("cpid")) & """title="""& rs24HourHot("mc") &""" target=_blank>"&rs24HourHot("mc")&"</a></td></tr>"
rs24HourHot.movenext
loop
str24HourHot=str24HourHot &"</table>"&vbcrlf	
str24HourHot=str24HourHot &"</td></tr></table>"&vbcrlf	
rs24HourHot.close
set rs24HourHot=nothing
Response.Write str24HourHot
end sub

'----------------
'求购人气榜
'--------------------
sub qiougouHot(ShowNum)
str24HourHot=str24HourHot &"<table width=""100%"" border=""0"" cellpadding=""1"" cellspacing=""1"" bgcolor=""#B4E200"">"& vbcrlf
str24HourHot=str24HourHot &"<tr><td bgcolor=""#ffffff"">"&vbcrlf
str24HourHot=str24HourHot &"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"&vbcrlf	
str24HourHot=str24HourHot &"<tr><td bgcolor=""#B4E200"" height=""4""colspan=""3""></td></tr>"&vbcrlf		   
str24HourHot=str24HourHot &"<tr><td bgcolor=""#B4E200"" width=""130""align=center><b>求购人气榜</b></td>"&vbcrlf		   
str24HourHot=str24HourHot &"<td width=""21""><img src=""images/y_xie2.gif"" width=""21"" height=""19""></td>"&vbcrlf		   
str24HourHot=str24HourHot &"<td bgcolor=""#E9E9E9""><a href="""" target=""_blank""></a></td></tr></table>"&vbcrlf		   
str24HourHot=str24HourHot &"<table width=""98%""  border=""0"" align=""center"" cellpadding=""0"" cellspacing=""3"">"&vbcrlf	

lbid="" 
set rs24HourHot = conn.execute("select top "&ShowNum&" id,mc from qiugou order by c desc,date desc,id desc")
do while not rs24HourHot.eof
 str24HourHot=str24HourHot &"<tr>"&vbcrlf
 str24HourHot=str24HourHot &" <td valign=""top"">·"
 str24HourHot=str24HourHot &"<a href=user/qiugouinfo.asp?qgid="&rs24HourHot("id")&" title="&rs24HourHot("mc")&" target=_blank>"&rs24HourHot("mc")&"</a></td></tr>"
rs24HourHot.movenext
loop
str24HourHot=str24HourHot &"</table>"&vbcrlf	
str24HourHot=str24HourHot &"</td></tr></table>"&vbcrlf	
rs24HourHot.close
set rs24HourHot=nothing
Response.Write str24HourHot
end sub

'------------
'最新商铺
'--------------------
sub ShowNewShop(ShowNum)
strShowNewShop=strShowNewShop&"<div class=""StandardSidePanel2"">"&vbcrlf
strShowNewShop=strShowNewShop&"<div class=""Title""><b>最新店铺</b></div>"&vbcrlf
strShowNewShop=strShowNewShop&"<ul class=""TipListStyle2"">"&vbcrlf
set rsShowNewShop = conn.execute("select top "&ShowNum&" id,name from shop where zt=2 order by sj2 desc,id desc")
do while not rsShowNewShop.eof
	strShowNewShop=strShowNewShop&"<li><a href=""shop/1/myshop.asp?shopid="&rsShowNewShop("id")&""" target=""_blank"">"
	strShowNewShop=strShowNewShop&rsShowNewShop("name")
	strShowNewShop=strShowNewShop&"</a></li>"&vbcrlf
rsShowNewShop.movenext
loop
strShowNewShop=strShowNewShop&"</ul>"&vbcrlf
strShowNewShop=strShowNewShop&"<div class=""Bottom""></div>"&vbcrlf
strShowNewShop=strShowNewShop&"</div>"&vbcrlf
rsShowNewShop.close
set rsShowNewShop=nothing
response.write strShowNewShop
end sub
'------------
'最新求购商品
'--------------------

sub ShowNewqiougou(ShowNum)
strShowNewShop=strShowNewShop&"<div class=""StandardSidePanel2"">"&vbcrlf
strShowNewShop=strShowNewShop&"<div class=""Title""><b>最新求购</b></div>"&vbcrlf
strShowNewShop=strShowNewShop&"<ul class=""TipListStyle2"">"&vbcrlf
set rsShowNewShop = conn.execute("select top "&ShowNum&" id,mc from qiugou order by date desc")
do while not rsShowNewShop.eof
	strShowNewShop=strShowNewShop&"<li><a href=user/qiugouinfo.asp?qgid="&rsShowNewShop("id")&" title="&rsShowNewShop("mc")&" target=_blank>"
	strShowNewShop=strShowNewShop&rsShowNewShop("mc")
	strShowNewShop=strShowNewShop&"</a></li>"&vbcrlf
rsShowNewShop.movenext
loop
strShowNewShop=strShowNewShop&"</ul>"&vbcrlf
strShowNewShop=strShowNewShop&"<div class=""Bottom""></div>"&vbcrlf
strShowNewShop=strShowNewShop&"</div>"&vbcrlf
rsShowNewShop.close
set rsShowNewShop=nothing
response.write strShowNewShop
end sub


'----------------------
'推荐店铺
'--------------------
Sub ShowRecommendShop()
strShowRecommendShop=strShowRecommendShop&"<div id=""FamousShops"" class=""StandardSidePanel2"">" &vbcrlf
strShowRecommendShop=strShowRecommendShop&"<div class=""Title""><b>推荐店铺</b></div>" &vbcrlf
strShowRecommendShop=strShowRecommendShop&"<ul>" &vbcrlf
set rsShowRecommendShop = conn.execute("select top "&tuijian_shop&" * from shop where tuijian_shop=1 order by id desc")
do while not rsShowRecommendShop.eof
	strShowRecommendShop=strShowRecommendShop&"<li><a href=""shop/1/myshop.asp?shopid="&rsShowRecommendShop("id") &""" target=""_blank"">"
	strShowRecommendShop=strShowRecommendShop&rsShowRecommendShop("name")&"</a>"
	strShowRecommendShop=strShowRecommendShop&"</li>"&vbcrlf
rsShowRecommendShop.movenext
loop
strShowRecommendShop=strShowRecommendShop&"<div class=""Bottom"">"&vbcrlf
strShowRecommendShop=strShowRecommendShop&"</div></div>"&vbcrlf
rsShowRecommendShop.close
set rsShowRecommendShop=nothing
Response.Write strShowRecommendShop
end sub
'--------------------



'---------------------
sub ShowVisitHistory()
Response.Write "<table width=100% border=0 cellspacing=0 cellpadding=2>"
if IsNumeric(replace((Request.Cookies("shop."&my_url)("cpid")),",","")) and Request.Cookies("shop."&my_url)("cpid")<>"" then
l_sorts=(Request.Cookies("shop."&my_url)("cpid"))
l_bsort=split(l_sorts,",")
if ubound(l_bsort)>9 then l_c=9 else l_c=ubound(l_bsort)
for l_i=0 to l_c
if not IsNumeric(l_bsort(l_i)) then l_cpid="" else l_cpid=clng(l_bsort(l_i)) &","& l_cpid
next
l_cpid=left(l_cpid,len(l_cpid)-1)
Response.Cookies("shop."&my_url)("cpid")=l_cpid
set l_rs = conn.execute("select top 10 id,mc from chanpin where id in ("&l_cpid&")")
do while not l_rs.eof
Response.Write "<tr><td height=22 valign=middle><font color=#10a3d2>·</font><a href=merchandise.asp?id="&encode(l_rs(0))&" title="&l_rs(1)&" target=_blank>"&InterceptString(l_rs(1),26)&"</a></td></tr>"
l_rs.movenext
loop
l_rs.close
set l_rs=nothing
Response.Write "<tr><td height=22 valign=middle align=right><a href=delcookies.asp>清空此浏览记录</a>&nbsp;</td></tr>"
else
Response.Cookies("shop."&my_url)("cpid")=""
Response.Write "<tr><td height=100 align=center valign=middle>还没有浏览过吗?<br>赶快去逛逛吧!</td></tr>"
end if
Response.Write "</table>"
end sub
'-------


sub ShowIndexChlChoice()
strChlChoice=strChlChoice &"<div id=""ChlChoice"">"&vbcrlf
strChlChoice=strChlChoice &""&vbcrlf
i=0
set RsTopicPic=server.createobject("adodb.recordset")
sqlTopic="Select topicname,ChlName,linkpage,ChlImage,Chlfolder From Topic order by orderid"
RsTopicPic.open sqlTopic,conn,1,1
totalnum=RsTopicPic.recordcount
redim topic(totalnum)
redim ChlName(totalnum)
redim ChlImage(totalnum)
redim linkpage(totalnum)
redim Chlfolder(totalnum)
	Do While Not RsTopicPic.Eof
	topic(i)=RsTopicPic("topicname")
	ChlName(i)=RsTopicPic("ChlName")
	linkpage(i)=RsTopicPic("linkpage")
	ChlImage(i)=RsTopicPic("ChlImage")
	ChlFolder(i)=RsTopicPic("Chlfolder")
	i=i+1
	RsTopicPic.MoveNext
	Loop
RsTopicPic.close
set RsTopicPic=nothing
for j=1 to 9
	strChlChoice=strChlChoice &"<div class=""ChlItem"" id="""&ChlName(j)&""">"&vbcrlf
	strChlChoice=strChlChoice &"<div class=""ChlName""></div>"&vbcrlf
	strChlChoice=strChlChoice &"<ul>"&vbcrlf
    set rsSelectFromAllChoice=server.createobject("adodb.recordset")
	sqlSelectFromAllChoice="select top 5 chanpin.id,chanpin.mc from chanpin left join lb on chanpin.lbid =lb.lbid where lb.topic='"& topic(j) &"'order by sj DESC,id desc"
	rsSelectFromAllChoice.open sqlSelectFromAllChoice,conn,1,1
	do while not rsSelectFromAllChoice.eof
	strChlChoice=strChlChoice&"<li>"
	strChlChoice=strChlChoice&"<a href=""merchandise.asp?id="&encode(rsSelectFromAllChoice("id")) &""" target=""_blank"">"&InterceptString(rsSelectFromAllChoice("mc"),12)&"</a>"
	strChlChoice=strChlChoice&"</li>"
	rsSelectFromAllChoice.movenext
	loop
	rsSelectFromAllChoice.close
	set rsSelectFromAllChoice=nothing
	strChlChoice=strChlChoice &"</ul>"&vbcrlf
	strChlChoice=strChlChoice &"<div class=""ChlImage""><a href="""&linkpage(j) &""">"
	Randomize
    FileNum=Int(10 * Rnd + 1)
	strChlChoice=strChlChoice &"<img src=""pics\bao\album\chlpic\"& ChlFolder(j) &"\"&FileNum &".gif""  border=""0"" width=""75""/></a>"&vbcrlf
	strChlChoice=strChlChoice &"</div>"&vbcrlf
	strChlChoice=strChlChoice &"<div class=""ChlMore""><a href="""& linkpage(j) &""">"& topic(j)&"</a></div>"&vbcrlf
	strChlChoice=strChlChoice &"<div class=""HackBox""></div>"&vbcrlf
	strChlChoice=strChlChoice &"</div>"&vbcrlf
	if j=3 or j=6 then
	strChlChoice=strChlChoice &"<div class=""HackBox""></div>"&vbcrlf
	end if
next
strChlChoice=strChlChoice &"</div>"&vbcrlf
response.write strChlChoice
end sub

sub ShowIndexNews()
strNews=strNews&"<div class=""PostCardStyle2"">"&vbcrlf
strNews=strNews&"<div class=""Icon"">"
set banner1= conn.execute("select top 1 * from ad where adtype1=8 and show=1 order by date desc")
if not banner1.eof then
if banner1("adtype")=2 then
strNews=strNews&"<embed src=user/images/gg/"&banner1("imageurl")&" border=0>"&vbcrlf
else
strNews=strNews&"<div align=center><a href=../click.asp?id="&banner1("id")&" target=_blank onFocus=this.blur()><img src=user/images/gg/"&banner1("imageurl")&" border=0 width=""58"" height=""78""></a></div></div>"&vbcrlf
end If
Else
strNews=strNews&"<img src=""pics/bao/album/123/wsdahui4.gif"" border=""0"" alt="""" /></div>"&vbcrlf
end if
banner1.close
set banner1=Nothing
strNews=strNews&"<div class=""Paragraph"">"&vbcrlf
strNews=strNews&"<ul>"&vbcrlf
set rsNews = connbbs.execute("Select top 4 * From [BBSXP_Affiche] Order By ID Desc")
if not rsNews.eof then
     do while not rsNews.eof
	 title=rsNews("title")
if len(title)>14 then title=Left(""&title&"",10)&"..."
     strNews=strNews&"<li>"&vbcrlf
     strNews=strNews&"<a href=""bbs/Affiche.asp?ID="&Rsnews("ID")&""" target=""_blank"" title="&rsNews("title")&">"&title&"</a>"&vbcrlf
     strNews=strNews&"</li>"&vbcrlf
	 rsNews.movenext
     loop
end if
strNews=strNews&" </ul></div>"&vbcrlf
strNews=strNews&"<div class=""HackBox""></div></div>"&vbcrlf
rsNews.close
set rsNews=nothing
Response.write strNews	  
end Sub
'-----------------------------------------------------
'商城首页推荐产品调用子程序
'-----------------------------------------------------
sub  home_tui_cp(canshu)
Response.Write "<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr>"
set rs = conn.execute("select top "&canshu&" * from chanpin where tuijian=1 order by id desc")
if not rs.eof then
i=1
do while not rs.eof
Response.Write "<td width=25% align=center>"&_
"<TABLE cellSpacing=2 cellPadding=0 width=120 border=0><TBODY><TR><TD height=2></TD></TR>"&_
"<TR><TD width=120 height=80 align=center vAlign=middle><div style='BORDER-RIGHT: #dddddd 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #dddddd 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; BORDER-LEFT: #dddddd 1px solid; WIDTH: 85px; PADDING-TOP: 4px; BORDER-BOTTOM: #dddddd 1px solid'><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" onFocus=this.blur() target=_blank><img border=0 src=user/images/Rikeeupimages/"&rs("xt")&" width=75 height=75></a></div></TD></TR>"&_
"<TR><TD width=120 height=40 align=center valign=middle><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" target=_blank>"&InterceptString(rs("mc"),32)&"</a></TD></TR>"&_
"<TR><TD height=2></TD></TR></TBODY></TABLE></td>"
if i mod 3 = 0 then
Response.Write "</tr>"
end if
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
Response.Write "</table>"
end sub
'-----------------------------------------------------
'商城首页最新产品调用子程序
'-----------------------------------------------------
sub  home_news_cp(canshu)
Dim y
Response.Write "<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr>"
set rs = conn.execute("select top "&canshu&" id,mc,xt from chanpin where id in (select max(id) from chanpin group by userid) and xt<>'xt.gif' and cang=0 and tui=0 order by id desc")
if not rs.eof then
y=1
do while not rs.eof
Response.Write "<td width=25% align=center>"&_
"<TABLE cellSpacing=2 cellPadding=0 width=120 border=0><TBODY><TR><TD height=2></TD></TR>"&_
"<TR><TD width=120 height=80 align=center vAlign=middle><div style='BORDER-RIGHT: #dddddd 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #dddddd 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; BORDER-LEFT: #dddddd 1px solid; WIDTH: 85px; PADDING-TOP: 4px; BORDER-BOTTOM: #dddddd 1px solid'><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" onFocus=this.blur() target=_blank><img border=0 src=user/images/Rikeeupimages/"&rs("xt")&" width=75 height=75></a></div></TD></TR>"&_
"<TR><TD width=120 height=40 align=center valign=middle><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" target=_blank>"&InterceptString(rs("mc"),32)&"</a></TD></TR>"&_
"<TR><TD height=2></TD></TR></TBODY></TABLE></td>"
if y mod 3 = 0 then
Response.Write "</tr>"
end if
rs.movenext
y=yi+1
loop
end if
rs.close
set rs=nothing
Response.Write "</table>"
end sub
'-----------------------------------------------------
'商城热点调用子程序
'-----------------------------------------------------
sub shop_rd(canshu,bg)
set rs = conn.execute("select top "&canshu&" id,bt from kefu where lx=1 or lx=2 order by id desc")
if not rs.eof then
Response.Write "<table width="&bg&" align=center cellpadding=0 cellspacing=0><tr><td height=22 valign=bottom><marquee behavior=scroll align=middle bgcolor=#FFFFFF  width=100% height=20 scrollamount=4  scrolldelay=90 class=p9bk style=color: #000000; font-size: 12 border=0 onMouseOver=this.stop()  onMouseOut=this.start()>"
do while not rs.eof
Response.Write "<a href=support.asp?id="&rs("id")&" class='NOL' target=_blank>"&rs("bt")&"</a>&nbsp;&nbsp;&nbsp;&nbsp;"
rs.movenext
loop
Response.Write "</marquee></td></tr></table>"
end if
rs.close
set rs=nothing
end Sub
'-----------------------------------------------------
'求购调用子程序
'-----------------------------------------------------
sub shop_qg(canshu)
Response.Write "<table cellspacing=0 cellpadding=0 width=96% align=center border=0>"
set rs = conn.execute("select top "&canshu&" id,mc from qiugou order by id desc")
do while not rs.eof
Response.Write "<tr><td width=95% height=24>&nbsp;·&nbsp;<a href=user/qiugouinfo.asp?qgid="&rs("id")&" title="&rs("mc")&" target=_blank>"&InterceptString(rs("mc"),28)&"</a></td></tr>"
rs.movenext
loop
rs.close
set rs=nothing
Response.Write "</table>"
end Sub
'-----------------------------------------------------
'
'-----------------------------------------------------
sub  left_tui_img(canshu,lb)
Dim x
Response.Write "<table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr>"
If lb<>0 then
set rs = conn.execute("select top "&canshu&" * from chanpin where xt<>'xt.gif' and tuijian=1 and lbid="&lb&" order by id desc")
else
set rs = conn.execute("select top "&canshu&" * from chanpin where xt<>'xt.gif' and tuijian=1 order by id desc")
End if
if not rs.eof then
x=1
do while not rs.eof
Response.Write "<td width=25% align=center>"&_
"<TABLE cellSpacing=2 cellPadding=0 width=120 border=0><TBODY><TR><TD height=2></TD></TR>"&_
"<TR><TD width=120 height=80 align=center vAlign=middle><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" onFocus=this.blur() target=_blank><img border=0 src=user/images/Rikeeupimages/"&rs("xt")&" width=75 height=75></a></TD></TR>"&_
"<TR><TD width=120 height=30 align=center valign=middle><a href=merchandise.asp?id="&encode(rs("id"))&" title="&rs("mc")&" target=_blank>"&InterceptString(rs("mc"),32)&"</a></TD></TR>"&_
"<TR><TD height=2></TD></TR></TBODY></TABLE></td>"
if x mod 2 = 0 then
Response.Write "</tr>"
end if
rs.movenext
x=x+1
loop
End if
rs.close
set rs=nothing
Response.Write "</table>"
'if left_tui_lbid="home" and lb<>0 then left_tui_img canshu,0
end Sub
'网页底部统一调用子程序
'-----------------------------------------------------
sub bottomgg()
Response.Write "<table width=760 align=center cellpadding=0 cellspacing=0><tr><td>"
set banner1= conn.execute("select top 1 * from ad where (adtype1=3 or adtype1=4) and show=1 order by date desc")
if not banner1.eof then
if banner1("adtype")=2 then
Response.Write("<embed src=user/images/gg/"&banner1("imageurl")&" border=0>")
else
Response.Write("<div align=center><a href=../click.asp?id="&banner1("id")&" target=_blank onFocus=this.blur()><img src=../../user/images/gg/"&banner1("imageurl")&" border=0></a></div>")
end if
end if
banner1.close
set banner1=nothing
Response.Write "</td></tr></table>"
End Sub

sub dpbottomgg()
Response.Write "<table width=760 HEIGHT=100 align=center cellpadding=0 cellspacing=0><tr><td>"
If shopnet("shopid")<>"" Then 
set banner1= conn.execute("select banner from shop where id="&shopnet("shopid")&"")
if not banner1.eof And banner1("banner")<>"" Then

Response.Write("<div align=center><img src=../user/images/banner/"&banner1("banner")&" border=0></div>")
Else
bottomgg()
end if
banner1.close
set banner1=nothing
Response.Write "</td></tr></table>"
End if
End sub

sub dpbottomgg1()
Response.Write "<table width=760 HEIGHT=100 align=center cellpadding=0 cellspacing=0><tr><td>"
If shopnet("shopid")<>"" Then 
set banner1= conn.execute("select banner from shop where id="&shopnet("shopid")&"")
if not banner1.eof And banner1("banner")<>"" Then

Response.Write("<div align=center><img src=../../user/images/banner/"&banner1("banner")&" border=0></div>")
Else
bottomgg()
end if
banner1.close
set banner1=nothing
Response.Write "</td></tr></table>"
End if
End sub

Sub UserOnline()
		Dim Actcome,SQl,Rs,UserTrueIP,username
        UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR")
		username=Request.Cookies(Rikee)("huiyuan")
		if username="" then
			set rs=server.createobject("adodb.recordset")
			sql="select id from online where userip='"&UserTrueIP&"'"
			rs.open sql,conn,1,3
			if rs.eof Then
				conn.Execute("Insert Into [Online](name,userIp) Values ('游客','" & UserTrueIP & "')")
			else
				conn.Execute("update [Online] set lastdate='"&now()&"' where userip='"&UserTrueIP&"'")
			end if
			rs.close
		else
			set rs=server.createobject("adodb.recordset")
		    sql="select id from online where name='"&username&"'"
			rs.open sql,conn,1,3
			if rs.eof then
				conn.Execute("Insert Into [Online](name,userIp) Values ('"&username&"','" & UserTrueIP & "')")
			else
			conn.Execute("update [Online] set lastdate='"&now()&"' where name='"&username&"'")
			end if
			rs.close
	   end If
	   set rs=server.createobject("adodb.recordset")
        sql="select id from online where userip='"&UserTrueIP&"'"
        rs.open sql,conn,1,3
		If Not rs.eof then
			'SQL = "Delete From [Online] Where Datediff(m,lastdate,getdate()) >120"
			SQL = "Delete From [Online] Where Datediff('m',lastdate,now()) >120"
			Conn.Execute SQL
		End if
	End Sub











%>
