<%
'**************************************
'* 最后更新 2012-09-26 by 56770.kingdge
'* Copyright www.56770.com
'**************************************
Dim id,page,sqlRsPro,RsPro,p_cx_sj,p_stj_sj,p_ytj_sj,ProductInfoItemId,ProductInfoItemName,ProductInfoItemPoint,ProductInfoItemWeight,ProductInfoItemReleaseDate,ProductInfoItemNumber,ProductInfoItemText,ProductInfoItemStock,ProductInfoItemBriefed,ProductInfoItemSpecs,ProductInfoItemPacking,ProductInfoItemBrand,ProductInfoItemCompany,ProductInfoItemOther,ProductInfoItemDetails,ProductInfoItemCategory,arr_category,category_i,categoryid,sql,ProductInfoItemPic,j
ReDim ProductInfoItemText(8)
ReDim ProductInfoItemOther(8)
If show_html = 0 Or InStr(LCase(Request.ServerVariables("URL")),"/product/")>0 Or InStr(LCase(Request.ServerVariables("URL")),"/showproduct")>0 Then
        id = Request("id")
		page = request("page")
End If
id = checknum(id,0)
page = checknum(page,1)
Dim product_type : product_type = ""  ' WangLei 2008-1-21
session("oldUrl") = Eshop_url & PagePath(10) &"?id="&id
sqlRsPro="select product_name"& LangTxt &",p.id,bianhao,sj,enddate,stj,ytj,cx,views,buys,p_jifen,p_tags,p_cx_sj,p_stj_sj,p_ytj_sj,kucun,p_color,p_chima,cpic,p_person,p_gongxiao,p_weight,pro_name"& LangTxt &",pic_size,categoryid,pro_info"& LangTxt &",p_rating,webhead"& LangTxt &",sprice,cprice,brand"& LangTxt &",briefed"& LangTxt &",details"& LangTxt &",s.price as buyprice,pic,p_filename"
for j=1 to UserGroupNumber
		sqlRsPro = sqlRsPro &",(Select top 1 price from [Lebi_product_price] where product_id=p.id and grade_id="&j&") as buyprice_"&j&""
Next
sqlRsPro = sqlRsPro &",(select count(downid) from [lebi_dvote] where downid = p.id) as comentnum,p.P_SpecificationName,p.P_SpecificationValue,p.P_SpecificationPic from [Lebi_product] as p,[Lebi_product_price] as s where p.zhuangtai = 1 and p.id="&id&" and s.product_id=p.id and s.grade_id="&Lebi_UserGrade
Set RsPro = conn.execute(sqlRsPro)
if Not RsPro.eof then
        sort_id = RsPro(24)
        p_cx_sj=datediff("d",Now(),DateAdd("d",rspro(12),rspro(3)),#2000-1-1#)
        p_stj_sj=datediff("d",Now(),DateAdd("d",rspro(13),rspro(3)),#2000-1-1#)
        p_ytj_sj=datediff("d",Now(),DateAdd("d",rspro(14),rspro(3)),#2000-1-1#)
		If Split(RsPro(27),"$$$")(0)<>"" Then
                strwebtitle=Split(RsPro(27),"$$$")(0) &"-"
		Else
                strwebtitle = RsPro(0) & Lebi_showproduct_category(1) &"-"
		End If
		If Split(RsPro(27),"$$$")(1)<>"" Then
                keywords=Split(RsPro(27),"$$$")(1)
		Else
                keywords=Replace(trim(Sys_keywords),chr(13),"") & Lebi_showproduct_category(3)
		End If
		If Split(RsPro(27),"$$$")(2)<>"" Then
                description=Split(RsPro(27),"$$$")(2)
		Else
                description=Replace(trim(Sys_description),chr(13),"") & Lebi_showproduct_category(2)
		End If
	    ProductInfoItemId = rspro(1)
	    ProductInfoItemName = trim(rspro(0))
		EncodeProductInfoItemName = Urlencode(Trim(rspro(0)))
	    ProductInfoItemNumber = trim(rspro(2))
	    ProductInfoItemPoint = rspro(10)
	    ProductInfoItemWeight = rspro(21)
	    ProductInfoItemReleaseDate = FormatDateTime(rspro(3),2)
		ProductInfoItemBriefed = rspro(31)
		Select Case ISAPI_Rewrite
			   Case "0" ProductInfoItemBrand = "<a href="""& Eshop_url & PagePath(4) &"?brand="& Urlencode(rspro(30)) &""" title="""& rspro(30) &""" target=""_blank"">"& rspro(30) &"</a>"
			   Case "1" ProductInfoItemBrand = "<a href="""& Eshop_url & LangPath &"brand-"& Urlencode(rspro(30)) &".html"" title="""& rspro(30) &""" target=""_blank"">"& rspro(30) &"</a>"
		End Select
		ProductInfoItemDetails = rspro(32)
		ProductInfoItemPic = rspro(34)
	    ProductInfoItemStock = rspro(15)
	    ProductInfoItemCategory = Lebi_showproduct_category(0)
		comentnum = rspro("comentnum")
Else
		if show_html = 0 then
				Response.redirect"../"
				response.End
		End If
End If
ShowPath = "<a href='"& Eshop_url & LangPath &"'>"& Lebi_word(0) &"</a> → "
arr_category = Split(sort_id,",")
For category_i = 0 To UBound(arr_category)
	    categoryid = checknum(arr_category(category_i),0)
		Dim Rscategory
	    set Rscategory = conn.execute("select c_id,c_name"& LangTxt &",c_foldername,c_filename from [Lebi_category] where c_id = "& categoryid &" and is_hide = 0")
	    If Not Rscategory.eof Then
				Select Case show_html
					   Case "0"
							Select Case ISAPI_Rewrite
								   Case "0"
										Select Case Config_Lebi_Eshop(16)
											   Case "0" : ShowPath = ShowPath & "<a href="""& Eshop_url & LangPath &"showsort.asp?sort_id="&Rscategory(0)&""">"& Rscategory(1) &"</a> → "
											   Case "1" : ShowPath = ShowPath & "<a href="""& Eshop_url & LangPath &"category/"&Rscategory(2)&"/"">"& Rscategory(1) &"</a> → "
											   Case "2" : ShowPath = ShowPath & "<a href="""& Eshop_url & LangPath &"category/"&Rscategory(2)&"/default.asp"">"& Rscategory(1) &"</a> → "
										End Select
								   Case "1" ShowPath = ShowPath & "<a href="""& Eshop_url & LangPath &"category-"&Rscategory(2)&".html"">"& Rscategory(1) &"</a> → "
							End Select
					   Case "1" : ShowPath = ShowPath & "<a href="""& Eshop_url & LangPath & Folder(2) & Rscategory(3) &".1."& Sys_Ext &""">"& Rscategory(1) &"</a> → "
				End Select
	    End If
	    Rscategory.Close : set Rscategory = nothing
Next
ShowPath = ShowPath & rspro(0)
%>