<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="../Include/Lebi_config.asp"-->
<%
'**************************************
'* 最后更新 2013-06-26 by 56770.kingdge
'* Copyright www.56770.com
'**************************************
include "lang/"& LangFilePath &"/lang_product.inc"
include "lang/"& LangFilePath &"/lang_order.inc"
include "lang/"& LangFilePath &"/lang_news.inc"
Select Case request.querystring("action")
	   Case "ProductNum" ProductNum()
	   Case "NewEvent" NewEvent()
	   Case "search" search()
	   Case "getDeliverArea2" : getDeliverArea2()
	   Case "getDeliverList" : getDeliverList()
	   Case "news" : news()
	   Case "selectvalue" : selectvalue()
	   Case "getspecification" : getspecification()
	   Case "getspecificationpic" : getspecificationpic()
	   Case "search_suggest" : search_suggest()
	   Case "getspinfo" : getspinfo()
	   Case "getspinfoorder" : getspinfoorder()
	   Case "getorderpaylog" : getorderpaylog()
	   Case Else
			NewItem()
End Select

Sub NewEvent()
		Dim DataNum(6)
		DataNum(0) = conn.execute("select count(id) from [Lebi_orders] where order_number>'' and orderzt like '%0%'")(0)
		If DataNum(0) = "" Or Not IsNumeric(DataNum(0)) Then DataNum(0) = 0
		DataNum(1) = conn.execute("select count(l_id) from [Lebi_pay_log] where l_virify = 0")(0)
		If DataNum(1) = "" Or Not IsNumeric(DataNum(1)) Then DataNum(1) = 0
		DataNum(2) = conn.execute("select count(id) from [Lebi_payment_inform] where payment_state = 0")(0)
		If DataNum(2) = "" Or Not IsNumeric(DataNum(2)) Then DataNum(2) = 0
		DataNum(3) = conn.execute("select count(id) from [Lebi_Dvote] where show = 0")(0)
		If DataNum(3) = "" Or Not IsNumeric(DataNum(3)) Then DataNum(3) = 0
		DataNum(4) = conn.execute("select count(id) from [guestbook] where show = 0")(0)
		If DataNum(4) = "" Or Not IsNumeric(DataNum(4)) Then DataNum(4) = 0
		DataNum(5) = conn.execute("select count(id) from [Lebi_message] where (to_user = '管理员' or to_user = 'Admin') and ifview = 0")(0)
		If DataNum(5) = "" Or Not IsNumeric(DataNum(5)) Then DataNum(5) = 0
		DataNum(6) = conn.execute("select count(id) from [Lebi_orders] where paymenttype like '%支付宝_申请退款%'")(0)
		If DataNum(6) = "" Or Not IsNumeric(DataNum(6)) Then DataNum(6) = 0
		response.write DataNum(0)&"|"&DataNum(1)&"|"&DataNum(2)&"|"&DataNum(3)&"|"&DataNum(4)&"|"&DataNum(5)&"|"&DataNum(6)
End Sub

Sub NewItem()
		Dim DataNum(2)
		DataNum(0) = conn.execute("select count(e_id) from [Lebi_Event] where e_type = 0")(0)
		If DataNum(0) = "" Or Not IsNumeric(DataNum(0)) Then DataNum(0) = 0
		DataNum(1) = conn.execute("select count(e_id) from [Lebi_Event] where e_type = 1")(0)
		If DataNum(1) = "" Or Not IsNumeric(DataNum(1)) Then DataNum(1) = 0
		response.write DataNum(0)&"|"&DataNum(1)
End Sub

Sub ProductNum()
		sort_id = checknum(request.querystring("sort_id"),0)
		sql = "Select Min(ID) as MinID from [Lebi_Product] where 1=1"
		If sort_id<>"0" And IsSqlDataBase = 1 Then sql=sql + " and charindex(',"&sort_id&",',categoryid)>0"
		If sort_id<>"0" And IsSqlDataBase = 0 Then sql=sql + " and instr(categoryid,',"&sort_id&",')>0"
		Set Rs=conn.Execute(sql)
		If Not Rs.Eof Then
				MinNum=Rs(0)
		End If
		Rs.Close:set rs=Nothing
		sql = "Select Max(ID) as MaxId from [Lebi_Product] where 1=1"
		If sort_id<>"0" And IsSqlDataBase = 1 Then sql=sql + " and charindex(',"&sort_id&",',categoryid)>0"
		If sort_id<>"0" And IsSqlDataBase = 0 Then sql=sql + " and instr(categoryid,',"&sort_id&",')>0"
		Set Rs=conn.Execute(sql)
		If Not Rs.Eof Then
				MaxNum=Rs(0)
		End If
		Rs.Close:set rs=nothing
		Response.Write checknum(MinNum,0)&"|"&checknum(MaxNum,0)
End Sub

Sub search()
		s_keywords = safereplace(request("s_keywords"))
		s_sort_id = CheckNum(request("s_sort_id"),0)
		sql = "select id,product_name from [Lebi_product] where zhuangtai = 1"
		If s_keywords <> "" Then sql = sql &" and product_name like '%"& s_keywords &"%'"
		If s_sort_id<> 0 And IsSqlDataBase = 1 Then sql = sql &" and charindex(',"&s_sort_id&",',categoryid)>0"
		If s_sort_id<> 0 And IsSqlDataBase = 0 Then sql = sql &" and instr(categoryid,',"&s_sort_id&",')>0"
		Set rs = conn.execute(sql)
		response.write("<select multiple size=""10"" id=""temp_product"" name=""temp_product"" style=""width:300px;"">")
		If Not (rs.eof And rs.bof) Then
				Do While Not rs.eof
				response.write("<option value="& rs(0) &">"& rs(1) &"</option>")
				rs.movenext
				Loop
		Else
				response.write("<option value="""">"& Lang_Product(145) &"</option>")
		End If
		response.write("</select>")
		rs.close : Set rs= Nothing
End Sub

rem	<-{ 获得地市级配送地区 2008-3-13 by 56770.WangLei
sub getDeliverArea2()
		Dim parentid,tstr
		parentid= CInt(request("parentid"))
		If parentid = 0 Then response.End
		sql="SELECT id,area_name FROM [Lebi_deliver_area] where parent_id="&parentid&" ORDER BY area_order desc,id asc"
		Set rs= conn.execute(SQL)
		If Not rs.eof Then
				tstr = "<select size=1 name=""area2_id"" onchange=""ajaxSub1(1,'ajax_data.asp?action=getDeliverList&areaid='+this.value+'&parentid="&parentid&"&LangName="& LangName &"');ajaxSub2(1,'Ajax_data.asp?action=getDeliverList&isdefault=1&areaid='+this.value+'&parentid="&parentid&"&LangName="& LangName &"');""><option value=""0"">"&Lebi_pro(15)&"</option>"
				do while not rs.eof
				tstr = tstr & "<option value="""&rs("id")&""">"&rs("area_name")&"</option>"
				rs.movenext
				Loop
				tstr = tstr & "</select>"
		End If
		rs.close:set rs=Nothing
		response.write(tstr)
		response.End
End sub
rem	}->

rem	<-{ 获得配送方式列表 2008-3-13 by 56770.WangLei
sub getDeliverList()
		Dim areaid,parentid,tstr,i
		areaid= checknum(request("areaid"),0)
		parentid= checknum(request("parentid"),0)
		LangTxt = safereplace(request("LangTxt"))
		LangName = safereplace(request("LangName"))
		isdefault= checknum(request("isdefault"),0)
		If parentid <> 0 Then 
			set rs = conn.execute("SELECT parent_id FROM [Lebi_deliver_area] WHERE id="& areaid &"")
			If not rs.eof Then 
			parentid = rs(0)
			End If 
			rs.close : set rs = nothing
		End If 
		sql="SELECT a.id,a.deliver_id,a.is_end_pay,a.basic_weight_price,a.basic_weight,a.overstep_price, b.deliver_name"& LangTxt &",b.deliver_info"& LangTxt &",b.deliver_price,a.last_price,a.free_price FROM [Lebi_deliver_list] as a,[Lebi_deliver] as b where a.area_id="&areaid&" and a.deliver_id=b.id ORDER BY a.d_order desc,a.area_id desc"
		Set rs= conn.execute(SQL)
		If Not rs.eof Then 
		If isdefault = 1 Then 
			tstr = tstr & rs(6) &"|"& rs(2) &"|"& rs(4) &"|"& rs(5) &"|"& rs(9) &"|"& rs(10) &"|"
			If CInt(Config_Lebi_Eshop(15)) = 0 Then
				tstr = tstr & rs(8)
			Else
				tstr = tstr & rs(3)
			End If
		Else 
		i = 0
		do while not rs.eof
			tstr = tstr & "<tr><td class=""listright"" colspan=""2""><input type=""radio"" value="""&rs(1)&"""  name=""deliver_id"" onclick=""getDeliverPrice("&i&");"""
			If i = 0 Then tstr = tstr & " checked"
			tstr = tstr & "> "&rs(6)&"</td></tr>"
			tstr = tstr & "<tr><td class=""listright"" colspan=""2"">"&rs(7)&"</td></tr><INPUT TYPE=""hidden"" value="""&rs(2)&""" name=""is_end_pay""><INPUT TYPE=""hidden"" value="""&rs(6)&""" name=""deliver_name""><INPUT TYPE=""hidden"" value="""&rs(4)&""" name=""basic_weight""><INPUT TYPE=""hidden"" value="""&rs(5)&""" name=""overstep_price""><INPUT TYPE=""hidden"" value="""&rs(9)&""" name=""last_price""><INPUT TYPE=""hidden"" value="""&rs(10)&""" name=""free_price"">"
			If CInt(Config_Lebi_Eshop(15)) = 0 Then
				tstr = tstr & "<INPUT TYPE=""hidden"" value="""&rs(8)&""" name=""basic_weight_price"">"
			Else
				tstr = tstr & "<INPUT TYPE=""hidden"" value="""&rs(3)&""" name=""basic_weight_price"">"
			End If
			rs.movenext
			i = i+1
		Loop
		End If 
		End If 
		rs.close:set rs=Nothing
		If tstr = "" And parentid > 0 Then
			sql="SELECT a.id,a.deliver_id,a.is_end_pay,a.basic_weight_price,a.basic_weight,a.overstep_price,b.deliver_name"& LangTxt &",b.deliver_info"& LangTxt &",b.deliver_price,a.last_price,a.free_price FROM [Lebi_deliver_list] as a,[Lebi_deliver] as b where a.area_id="&parentid&" and a.deliver_id=b.id ORDER BY a.d_order desc,a.area_id desc"
			Set rs= conn.execute(SQL)
			If Not rs.eof Then 
			If isdefault = 1 Then 
				tstr = tstr & rs(6) &"|"& rs(2) &"|"& rs(4) &"|"& rs(5) &"|"& rs(9) &"|"& rs(10) &"|"
				If CInt(Config_Lebi_Eshop(15)) = 0 Then
					tstr = tstr & rs(8)
				Else
					tstr = tstr & rs(3)
				End If
			Else 
			i = 0
			do while not rs.eof
				tstr = tstr & "<tr><td class=""listright"" colspan=""2""><input type=""radio"" value="""&rs(1)&"""  name=""deliver_id"" onclick=""getDeliverPrice("&i&");"""
				If i = 0 Then tstr = tstr & " checked"
				tstr = tstr & "> "&rs(6)&"</td></tr>"
				tstr = tstr & "<tr><td class=""listright"" colspan=""2"">"&rs(7)&"</td></tr><INPUT TYPE=""hidden"" value="""&rs(2)&""" name=""is_end_pay""><INPUT TYPE=""hidden"" value="""&rs(6)&""" name=""deliver_name""><INPUT TYPE=""hidden"" value="""&rs(4)&""" name=""basic_weight""><INPUT TYPE=""hidden"" value="""&rs(5)&""" name=""overstep_price""><INPUT TYPE=""hidden"" value="""&rs(9)&""" name=""last_price""><INPUT TYPE=""hidden"" value="""&rs(10)&""" name=""free_price"">"
				If CInt(Config_Lebi_Eshop(15)) = 0 Then
					tstr = tstr & "<INPUT TYPE=""hidden"" value="""&rs(8)&""" name=""basic_weight_price"">"
				Else
					tstr = tstr & "<INPUT TYPE=""hidden"" value="""&rs(3)&""" name=""basic_weight_price"">"
				End If
				rs.movenext
				i = i+1
			Loop
			End If 
			End If 
			rs.close:set rs=Nothing
		End If
		response.write(tstr)
		response.End
End sub
rem	}->

Sub news()
		s_keywords = Trim(safereplace(request("s_keywords")))
		s_sort_id = CheckNum(request("s_sort_id"),0)
		response.write("<select multiple size=""10"" id=""temp_product"" name=""temp_product"" style=""width:340px;"">")
		If s_keywords = "" Or s_sort_id = 0 Then
				response.write("<option value="""">"& Lang_News(1) &"</option>")
		Else
				sql = "select id,product_name"& lang &" from [Lebi_product] where zhuangtai = 1"
				If s_keywords <> "" Then sql = sql &" and product_name like '%"& s_keywords &"%'"
				If s_sort_id<> 0 And IsSqlDataBase = 1 Then sql = sql &" and charindex(',"&s_sort_id&",',categoryid)>0"
				If s_sort_id<> 0 And IsSqlDataBase = 0 Then sql = sql &" and instr(categoryid,',"&s_sort_id&",')>0"
				Set rs = conn.execute(sql)
				If Not (rs.eof And rs.bof) Then
						Do While Not rs.eof
						response.write("<option value="& rs(0) &">"& rs(1) &"</option>")
						rs.movenext
						Loop
				Else
						response.write("<option value="""">"& Lang_News(2) &"</option>")
				End If
				rs.close : Set rs= Nothing
		End If
		response.write("</select>")
End Sub

Sub selectvalue()
		On Error Resume Next 
		typeid = CheckNum(request("typeid"),0)
		id = CheckNum(request("id"),0)
		mode = CheckNum(request("mode"),0)
		value = Trim(Replace(request("value"),"|",","))
		lang = safereplace(request("lang"))
		If mode = 2 Then 
				If (value = "" Or value = "@@") And typeid <> 0 Then value = "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
				pro_name = Split(value,"@@")(0)
				If Split(value,"@@")(1) = "" Then 
						pro_info = Split("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$","$$$")
				Else
						pro_info = Split(Split(value,"@@")(1),"$$$")
				End If 
		Else
				If value = "" Then value = "$$$|||||"
		End If 
		If mode = 2 And typeid = 0 Then 
				If UBound(Split(pro_name,"$")) > 0 Then 
				Response.Write("<div id=""getvalue""><table cellspacing=""0"" cellpadding=""0"" width=""100%"" id=""selectvalue"& lang & mode &""">")
				For ii = 0 To UBound(Split(pro_name,"$"))
				Response.Write("<tr class=""classrow""><td width=""15%"" height=""30"" class=""classrow""><input type=""hidden"" name=""p_ProductValueType"& lang &""" id=""p_ProductValueType"& lang &""" value=""0"" /><input type=""text"" name=""p_ProductName"& lang &""" id=""p_ProductName"& lang &""" size=""10"" value="""& Split(pro_name,"$")(ii) &""" class=""form"" />：</td><td height=""30"" colspan=""2"" class=""classrow""><input type=""text"" name=""p_ProductValue_"& ii & lang &""" id=""p_ProductValue_"& ii & lang &""" size=""25"" value="""& pro_info(ii) &""" class=""form"" /></td></tr>")
				Next 
				Response.Write("</table></div>")
				End If 
		End If 
		IsSelectName = 0
		sql = "select s_name"& lang &",s_id,s_type from [Lebi_SelectName] where typeid = "& typeid &" and s_mode = "& mode &" order by s_order desc"
		Set rs = conn.execute(sql)
		If Not rs.eof Then 
			IsSelectName = 1
			DataSelectName = rs.getrows()
		End If 
		rs.close : Set rs = Nothing 
		If IsSelectName = 1 Then 
		Response.Write("<div id=""getvalue""><table cellspacing=""0"" cellpadding=""0"" width=""100%"" id=""selectvalue"& lang & mode &""">")
		For i = 0 To UBound(DataSelectName,2)
'		If i = UBound(DataSelectName,2) Then 
'				SName = SName & Trim(DataSelectName(0,i))
'		Else
'				SName = SName & Trim(DataSelectName(0,i)) &","
'		End If 
		response.write("<tr class=""classrow""><td width=""15%"" height=""30"" class=""classrow"">")
		If mode = 1 Then response.write("<input type=""checkbox"" name=""Hidden_SName"" value="""& DataSelectName(1,i) &"|"& DataSelectName(0,i) &""""& judge(Split(value,"$$$")(0),DataSelectName(1,i))&" /> ")
		response.write(DataSelectName(0,i) &"：</td><td height=""30"" colspan=""2"" class=""classrow"">")
		If mode = 2 Then 
				Response.Write("<input type=""hidden"" name=""p_ProductName"& lang &""" id=""p_ProductName"& lang &""" value="""& DataSelectName(0,i) &""" />")
				If DataSelectName(2,i) = 0 Then 
						Response.Write("<input type=""hidden"" name=""p_ProductValueType"& lang &""" id=""p_ProductValueType"& lang &""" value=""0"" /><select name=""p_ProductValue_"& i & lang &""" id=""p_ProductValue_"& i & lang &"""><option value=""""></option>")
				ElseIf DataSelectName(2,i) = 1 Then 
						Response.Write("<input type=""hidden"" name=""p_ProductValueType"& lang &""" id=""p_ProductValueType"& lang &""" value=""0"" /><input type=""text"" name=""p_ProductValue_"& i & lang &""" id=""p_ProductValue_"& i & lang &""" size=""25"" value="""& pro_info(getN(pro_name,DataSelectName(0,i),"$")) &""" class=""form"" />")
				Else
						Response.Write("<input type=""hidden"" name=""p_ProductValueType"& lang &""" id=""p_ProductValueType"& lang &""" value=""1"" />")
				End If 
		End If 
		IsSelectValue = 0
		sql = "select id,"
		If mode = 2 Then 
				sql = sql &"s_value"& lang
		Else 
				For LangT = 1 To TotalLang
						sql = sql &"s_value"& LanguageTxt(LangT)
						If LangT < TotalLang Then sql = sql &","
				Next 
		End If 
		sql = sql &" from [Lebi_SelectValue] where s_id = "& DataSelectName(1,i) &" order by s_order desc"
		Set rs = conn.execute(sql)
		If Not rs.eof Then 
			IsSelectValue = 1
			DataSelectValue = rs.getrows()
		End If 
		rs.close : Set rs = Nothing 
		If IsSelectValue = 1 Then 
		For ii = 0 To UBound(DataSelectValue,2)
			Select Case mode 
			Case "0" Response.Write("<input type=""checkbox"" name=""ajax_SelectValue"& lang &""" id=""ajax_SelectValue"& lang &""" value="""& DataSelectName(0,i) &"_"& Trim(DataSelectValue(0,ii)) &""" "& judge(value,DataSelectName(0,i) &"_"& Trim(DataSelectValue(0,ii)))&"> "& Trim(DataSelectValue(1,ii)) &"&nbsp;")
			Case "1" 
			Response.Write("<input type=""checkbox"" name=""SValue"& DataSelectName(1,i) &""" value="""& DataSelectValue(0,ii) &"|")
			For LangT = 1 To TotalLang
					Response.Write(Trim(DataSelectValue(LangT,ii)))
					If LangT < TotalLang Then Response.Write("$$$")
			Next 
			Response.Write(""" "& judge(Split(value,"$$$")(1),Trim(DataSelectValue(0,ii)))&"> "& Trim(DataSelectValue(1,ii)) &"&nbsp;")
			Case "2" 
			If DataSelectName(2,i) = 0 Then Response.Write("<option value="""& Trim(DataSelectValue(1,ii)) &""" "& judge2(pro_info(getN(pro_name,DataSelectName(0,i),"$")),Trim(DataSelectValue(1,ii))) &">"& Trim(DataSelectValue(1,ii)) &"</option>")
			If DataSelectName(2,i) = 2 Then Response.Write("<input type=""checkbox"" name=""p_ProductValue_"& i & lang &""" id=""p_ProductValue_"& i & lang &""" value="""& Trim(DataSelectValue(1,ii)) &""" "& judge(pro_info(getN(pro_name,DataSelectName(0,i),"$")),Trim(DataSelectValue(1,ii))) &" /> "& Trim(DataSelectValue(1,ii)) &"")
			End Select 
		Next 
		End If 
		If mode = 2 And DataSelectName(2,i) = 0 Then 
				Response.Write("</select>")
		End If 
		response.write("</td></tr>")
		Next 
		If mode = 1 Then 
		response.write("<tr><td class=""classrow"" colspan=""3""><input type=""button"" name=""btn"" value="""& Lang_Product(237) &""" class=""button"" onclick=""getdiv("& id &");"" />&nbsp;&nbsp;<input type=""button"" name=""btn"" value="""& Lang_Product(238) &""" class=""button"" onclick=""ResetRow("& id &");"" /></td></tr>")
		End If 
		response.write("</table><script>tdshow(""selectvalue"& lang & mode &""");</script></div>")
		End If 
End Sub 

Sub getspecification()
		name = request("name")
		id = checknum(request("id"),0)
		delid = checknum(request("delid"),0)
		list = request("list")
		DataCount = 0
		conn.execute("delete from [Lebi_Product_Stock] where id = "& delid &"")
		Set rs = conn.execute("select p_no,p_stock,p_price,p_cbprice,p_weight,s_value,id from [Lebi_Product_Stock] where p_id = "& id &"")
		If Not rs.eof Then 
				DataCount = 1
				DataValue = rs.getrows()
		End If 
		rs.close : Set rs = Nothing
		If DataCount = 1 Then 
				response.write("<table id=""Table_Specification"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tablelist""><tbody><tr>")
				If InStr(name,",") = 0 Then 
						response.write("<td class='listhead' height='25'>")
						Set rs = conn.execute("select s_name from [Lebi_SelectName] where s_id = "& checknum(name,0) &"")
						If Not rs.eof Then 
								response.write(rs(0))
						End If 
						rs.close : Set rs = Nothing
						response.write("</td>")
				Else
						For n = 0 To UBound(Split(name,","))
						response.write("<td class='listhead' height='25'>")
						Set rs = conn.execute("select s_name from [Lebi_SelectName] where s_id = "& checknum(Split(name,",")(n),0) &"")
						If Not rs.eof Then 
								response.write(rs(0))
						End If 
						rs.close : Set rs = Nothing
						response.write("</td>")
						Next 
				End If 
				response.write("<td width='12%' class='listhead'>"& Lang_Product(102) &"</td><td width='12%' class='listhead'>"& Lang_Product(104) &"</td><td width='12%' class='listhead'>"& Lang_Product(236) &"</td><td width='12%' class='listhead'>"& Lang_Product(103) &"</td><td width='12%' class='listhead'>"& Lang_Product(198) &"</td>")
				If list = 0 Then response.write("<td width='10%' class='listhead'>"& Lang_Product(135) &"</td>")
				response.write("</tr>")
				For i = 0 To UBound(DataValue,2)
						response.write("<tr>")
						If InStr(DataValue(5,i),",") = 0 Then 
								response.write("<td class='listrow' height='20'>"& DataValue(5,i) &"</td>")
						Else
								For n = 0 To UBound(Split(DataValue(5,i),","))
								response.write("<td class='listrow' height='20'>"& Split(DataValue(5,i),",")(n) &"</td>")
								Next 
						End If 
						response.write("<td class='listrow' height='20'>")
						If list = 2 Then 
								response.write(DataValue(0,i))
						Else
								response.write("<input style='width:130px;' class='form' type='text' name='ajax_p_no' id='p_no"& i &"' value='"& DataValue(0,i) &"' /><input type='hidden' name='ajax_s_id' id='s_id"& i &"' value='"& DataValue(6,i) &"' /><input type='hidden' name='ajax_s_value' id='s_value"& i &"' value='"& Replace(DataValue(5,i),",","@") &"' />")
						End If 
						response.write("</td><td class='listrow' height='20'>")
						If list = 2 Then 
								response.write(DataValue(1,i))
						Else
								response.write("<input style='width:40px;' class='form' type='text' name='ajax_p_stock' id='p_stock"& i &"' onblur=""countle('"& UBound(DataValue,2) + 1 &"','"& id &"')"" value='"& DataValue(1,i) &"' />")
						End If 
						response.write("</td><td class='listrow' height='20'>")
						If list = 2 Then 
								response.write(DataValue(2,i))
						Else
								response.write("<input style='width:40px;' class='form' type='text' name='ajax_p_price' id='p_price"& i &"' value='"& DataValue(2,i) &"' />")
						End If 
						response.write("</td><td class='listrow' height='20'>")
						If list = 2 Then 
								response.write(DataValue(3,i))
						Else
								response.write("<input style='width:40px;' class='form' type='text' name='ajax_p_cbprice' id='p_cbprice"& i &"' value='"& DataValue(3,i) &"' />")
						End If 
						response.write("</td><td class='listrow' height='20'>")
						If list = 2 Then 
								response.write(DataValue(4,i))
						Else
								response.write("<input style='width:40px;' class='form' type='text' name='ajax_p_weight' id='p_weight"& i &"' value='"& DataValue(4,i) &"' />")
						End If 
						response.write("</td>")
						If list = 0 Then response.write("<td class='listrow' height='20'><a style='cursor:pointer;' onclick=""delValueRow('"& id &"','"& name &"','"& DataValue(6,i) &"','"& UBound(DataValue,2) &"');"">"& Lang_Product(135) &"</a></td>")
						If list = 0 Then response.write("</tr>")
				Next 
				response.write("</tbody></table>")
		End If 
End Sub 

Sub getspecificationpic()
		name = Replace(request("name"),"|",",")
		id = checknum(request("id"),0)
		pic = request("pic")
		If name <> "" Then 
				If Right(name,1) = "," Then name = cut_Right(name)
				response.write("<table cellpadding=""0"" cellspacing=""0"" class=""tablelist"">")
				If InStr(name,",") = 0 Then 
						response.write("<tr><td>")
						Set rs = conn.execute("select s_value from [Lebi_SelectValue] where id = "& checknum(name,0) &"")
						If Not rs.eof Then 
								response.write(rs(0))
						End If 
						rs.close : Set rs = Nothing
						response.write("</td><td><input type=""text"" name=""SValuePic"" id=""SValuePic0"" size=""20"" value="""& pic &""" class=""form"" /></td><td><IFRAME src=""upfile/upload.asp?u_type=0&filename=SValuePic0"" frameBorder=0 width=""320"" height=""23"" scrolling=no allowtransparency=""true""></IFRAME></td></tr>")
				Else
						If pic = "" Then pic = "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
						For n = 0 To UBound(Split(name,","))
						response.write("<tr><td>")
						Set rs = conn.execute("select s_value from [Lebi_SelectValue] where id = "& checknum(Split(name,",")(n),0) &"")
						If Not rs.eof Then 
								response.write(rs(0))
						End If 
						rs.close : Set rs = Nothing
						response.write("</td><td><input type=""text"" name=""SValuePic"" id=""SValuePic"& n &""" size=""20"" value="""& Split(pic,"|")(n) &""" class=""form"" />")
						If Split(pic,"|")(n) <> "" Then 
							response.write(" <img src='images/img.gif' align='absmiddle' onMouseover=""javascript:ddrivetip('<img src=../"& PicPath &"/"& Split(pic,"|")(n) &" width="& Upload_SPicWidth &">', '#ffffff', '"& Upload_SPicWidth &"')"" onMouseout=""hideddrivetip()"">")
						End If 
						response.write("</td><td><IFRAME src=""upfile/upload.asp?u_type=0&filename=SValuePic"& n &""" frameBorder=0 width=""320"" height=""23"" scrolling=no allowtransparency=""true""></IFRAME></td></tr>")
						Next 
				End If 
				response.write("</table>")
		End If 
End Sub 

Sub getspinfo()
		name = request("name")
		id = checknum(request("id"),0)
		price = checknum(request("price"),0)
		LangTxt = safereplace(request("LangTxt"))
		Set rs = conn.execute("select p_stock,p_price from [Lebi_Product_Stock] where p_id = "& id &" and s_value"& LangTxt &"='"& name &"'")
		If Not rs.eof Then 
				response.write(Lang_Order(34) & rs(0)&"，"& Lang_Product(51) & formatnumber2(price+rs(1)))
		Else
				response.write(Lang_Order(194))
		End If 
		rs.close : Set rs = Nothing
End Sub 

Sub getspinfoorder()
		name = request("name")
		id = checknum(request("id"),0)
		price = checknum(request("price"),0)
		LangTxt = safereplace(request("LangTxt"))
		Set rs = conn.execute("select p_stock,p_price from [Lebi_Product_Stock] where p_id = "& id &" and s_value"& LangTxt &"='"& name &"'")
		If Not rs.eof Then 
				response.write(Lang_Order(34) &""& rs(0)&"，"& Lang_Order(53) &"："&formatnumber2(price+rs(1)) &"|"& price+rs(1))
		Else
				response.write(Lang_Order(194))
		End If 
		rs.close : Set rs = Nothing
End Sub 

Sub search_suggest()
		dim keyword : keyword = ""
		DataCount = 0
		key = safereplace(request("key"))
		lang = safereplace(request("lang"))
		from = LCase(request("from"))
		sqlstr = safereplace(request("sql"))
		Select Case from
		Case "lebi_brand"
			sql = "select top 20 brand"& lang &" from [lebi_brand] where brand"& lang &" like '%"& key &"%'"
		Case "lebi_category"
			sql = "select top 20 c_name"& lang &" from [lebi_category] where c_name"& lang &" like '%"& key &"%'"
		Case "lebi_tags"
			sql = "select top 20 tags_name from [lebi_tags] where tags_name like '%"& key &"%'"
		Case "lebi_user"
			sql = "select top 20 user_id from [lebi_user] where (user_id like '%"& key &"%')$select top 20 user_name from [lebi_user] where (user_name like '%"& key &"%')$select top 20 user_tel from [lebi_user] where (user_tel like '%"& key &"%')$select top 20 user_adds from [lebi_user] where (user_adds like '%"& key &"%')"
		Case "lebi_user_user_name"
			sql = "select top 20 user_name from [lebi_user] where user_name like '%"& key &"%'"
		Case "lebi_packing"
			sql = "select top 20 packing_name"& lang &" from [lebi_packing] where packing_name"& lang &" like '%"& key &"%'"
		Case "lebi_pay_log"
			sql = "select top 20 l_ordernum from [lebi_pay_log] where (l_ordernum like '%"&keyword&"%')$select top 20 l_userid from [lebi_pay_log] where (l_userid like '%"&key&"%')$select top 20 l_username from [lebi_pay_log] where (l_username like '%"&key&"%')"
		Case "lebi_product"
			sql = "select top 20 bianhao from [lebi_product] where (bianhao like '%"& key &"%')$select top 20 product_name"& lang &" from [lebi_product] where (product_name"& lang &" like '%"& key &"%')$select top 20 brand"& lang &" from [lebi_product] where (brand"& lang &" like '%"& key &"%')"
		Case "lebi_orders_product_name"
			sql = "select top 20 product_name from [lebi_basket] where product_name like '%"& key &"%' group by product_name"
		Case "lebi_orders_bianhao"
			sql = "select top 20 bianhao from [lebi_basket] where bianhao like '%"& key &"%' group by bianhao"
		Case "lebi_orders_user_id"
			sql = "select top 20 user_id from [Lebi_orders] where user_id like '%"& key &"%' group by user_id"
		Case "lebi_orders_user_name"
			sql = "select top 20 to_name from [Lebi_orders] where (to_name like '%"& key &"%') group by to_name$select top 20 from_name from [Lebi_orders] where (from_name like '%"& key &"%') group by from_name"
		Case "lebi_orders_user_tel"
			sql = "select top 20 to_tel from [Lebi_orders] where (to_tel like '%"& key &"%') group by to_tel$select top 20 from_tel from [Lebi_orders] where (from_tel like '%"& key &"%') group by from_tel"
		Case "lebi_product_unite"
			sql = "select top 20 bianhao from [lebi_product_unite] where (bianhao like '%"& key &"%')$select top 20 product_name"& lang &" from [lebi_product_unite] where (product_name"& lang &" like '%"& key &"%')"
		Case "lebi_vipproduct"
			sql = "select top 20 product_name"& lang &" from [lebi_vipproduct] where product_name"& lang &" like '%"& key &"%'"
		Case "lebi_orders"
			sql = "select top 20 order_number from [lebi_orders] where (order_number like '%"&key&"%' or paymenttype like '%"&key&"%' or sendtype like '%"&key&"%' or to_name like '%"&key&"%' or user_id like '%"&key&"%')"
		Case "search"
			sql = "select top 20 gjc"& lang &" from [search] where gjc"& lang &" like '%"& key &"%'"
		Case "lebi_selecttype"
			sql = "select top 20 s_name"& lang &" from [lebi_selecttype] where s_name"& lang &" like '%"& key &"%'"
		Case "lebi_selectname"
			sql = "select top 20 s_name"& lang &" from [lebi_selectname] where s_name"& lang &" like '%"& key &"%' and s_mode = "& CLng(sqlstr) &""
		Case "lebi_selectvalue"
			sql = "select top 20 s_value"& lang &" from [lebi_selectvalue] where s_value"& lang &" like '%"& key &"%' and s_id = "& CLng(Split(sqlstr,",")(0)) &" and s_mode = "& CLng(Split(sqlstr,",")(1))
			If CLng(Split(sqlstr,",")(2)) <> "0" Then sql = sql &" and typeid = "& CLng(Split(sqlstr,",")(2))
		Case "lebi_huoban"
			sql = "select top 20 wordlink from [Lebi_huoban] where (wordlink like '%"& keyword &"%')$select top 20 url from [Lebi_huoban] where (url like '%"& keyword &"%')"
		End Select 
		If InStr(sql,"$") = 0 Then 
			set rs = conn.execute(sql) 
			If not rs.eof Then 
					DataValue = rs.getrows()
					DataCount = 1 
			End If 
			rs.close : Set rs = Nothing
			If DataCount = 1 Then 
					For i = 0 To UBound(DataValue,2)
							keyword = keyword & Left(DataValue(0,i),30)
							If i < UBound(DataValue,2) Then keyword = keyword & "|"
					Next 
					keyword = MoveSave(keyword)
					response.Write(keyword) 
			End If 
		Else
			For q = 0 To UBound(Split(sql,"$"))
				set rs = conn.execute(Split(sql,"$")(q)) 
				If not rs.eof Then 
						DataValue = rs.getrows()
						DataCount = 1 
				End If 
				rs.close : Set rs = Nothing
				If DataCount = 1 Then 
						For i = 0 To UBound(DataValue,2)
								keyword = keyword & Left(DataValue(0,i),30)
								If i < UBound(DataValue,2) And UBound(DataValue,2) > 0 Then keyword = keyword & "|"
						Next 
						keyword = MoveSave(keyword)
						response.Write(keyword) 
						Exit Sub 
				End If 
			Next 
		End If 
End Sub 

Sub getorderpaylog()
		id = checknum(request("id"),0)
		PayLogCount = 0
		Set rs = conn.execute("select p_price,p_type,p_content,p_time,admin_name from [Lebi_Orders_Paylog] where oid = "& id &"")
		If Not rs.eof Then 
				PayLogCount = 1
				PayLogData = rs.getrows()
		End If 
		rs.close : Set rs = Nothing 
		If PayLogCount = 1 Then 
		For p = 0 To UBound(PayLogData,2)
				Response.Write(Lang_Order(183) & PayLogData(2,p) &"&nbsp;&nbsp;"& Lang_Order(184))
				Select Case PayLogData(1,p)
				Case "0" Response.Write("<span style=""color:#ff0000"">-"& formatnumber2(PayLogData(0,p)) &"</span>")
				Case "1" Response.Write("<span style=""color:#0000ff"">+"& formatnumber2(PayLogData(0,p)) &"</span>")
				End Select 
				Response.Write("&nbsp;&nbsp;<em>"& PayLogData(3,p) &"</em>")
				If PayLogData(4,p) <> "" And Not IsNull(PayLogData(4,p)) Then Response.Write("&nbsp;&nbsp;<em>"& PayLogData(4,p) &"</em>")
				If p < UBound(PayLogData,2) Then Response.Write("<br/>")
		Next 
		End If 
End Sub 
%>