<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="../include/config.inc"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_product_add.asp
'* 最后更新 2013-05-04 by 56770.kingdge
'* 历史更新 2008-4-23 by 56770.WangLei
'*****************************************
Dim admin_flag
admin_flag=",2.1,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_product.inc"
include "lang/"& LangFilePath &"/lang_selectvalue.inc"
CurrentId = 1
CurrentUrl = "admin_product_list.asp"
LB_Head()
LB_Menu()
id = checknum(request("id"),0)
%>
<div class="tabmenu mainwidth">
      <ul>
        <li><a href="admin_product_list.asp"><span><%=Lang_Menu(53)%></span></a></li>
        <li><a href="Admin_product_list.asp?zhuangtai=0"><span><%=Lang_Menu(71)%></span></a></li>
		<li><a href="Admin_product_list_simple.asp"><span><%=Lang_Menu(68)%></span></a></li>
        <li class="current"><a href="Admin_product.asp"><span><%
		If id <> 0 Then
			response.write Lang_Product(107)
		Else
			response.write Lang_Menu(52)
		End If 
		%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	    adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
	    Select Case request("action")
		       Case "add" : add()
			   Case Else
			        main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add()
        If OnlyRead = 1 Then OnlyReadMessage()
        bianhao1=Right(Year(date),2) & Month(date) & Day(date)
        bianhao=safereplace(trim(request("bianhao")))
        cx = CheckNum(request("cx"),0)
        stj = CheckNum(request("stj"),0)
        ytj = CheckNum(request("ytj"),0)
		IsNew = CheckNum(request("IsNew"),0)
        product_name=Safereplace(request("product_name"))
        sprice=CheckNum(trim(request("sprice")),0)
        cprice=CheckNum(trim(request("cprice")),0)
        cbprice=CheckNum(trim(request("cbprice")),0)
		users_price = safereplace(trim(request("users_price")))
		users_grade = safereplace(trim(request("users_grade")))
        p_jifen=CheckNum(trim(request("p_jifen")),0)
        '增加颜色和尺码 2005-11-17 By 56770.Kingdge
        c_color=replace(Safereplace(trim(request("c_color")))," ","")
        c_chima=replace(Safereplace(trim(request("c_chima")))," ","")
        '增加功效和适合人群 2006-2-13 by 56770.Kingdge
        g_gongxiao=replace(Safereplace(trim(request("g_gongxiao")))," ","")
        p_person=replace(Safereplace(trim(request("p_person")))," ","")
        pic=Safereplace(trim(request("pic")))
        if pic="" then pic="noimages.gif"
        cpic=Safereplace(trim(request("cpic")))
        if cpic="" then cpic="nonegif.gif"
        zhuangtai=CheckNum(request("zhuangtai"),0)
        '新增推荐时间和特价时间   by kingdge 56770.com  2005-10-17
        p_cx_sj=CheckNum(trim(request("p_cx_sj")),0)
        p_stj_sj=CheckNum(trim(request("p_stj_sj")),0)
        p_ytj_sj=CheckNum(trim(request("p_ytj_sj")),0)
		If bianhao <> "" Then
				bianhao = CheckBianhao(bianhao,id,0,0)
'				Set rs = conn.execute("select top 1 bianhao from [Lebi_product] where bianhao='"&bianhao&"' ")
'				If Not rs.eof Then
'						Call Up_mes(Lang_sys(46),"·"& Lang_Product(10),0,"javascript:history.back()",0,0,2,0)
'						response.End
'				End If
'				rs.close : Set rs = Nothing
		End If
        rem 商品标签Tags  用于匹配相关类型商品 2006-4-3 56770.kingdge
        p_tags=Replace(safereplace(Trim(request("p_tags"))),"，",",")
        If Right(p_tags,1)="," Then p_tags=Left(p_tags,Len(p_tags)-1) '去掉末尾的逗号
        If p_tags<>"" Then
                If InStr(p_tags,",")>0 Then
                        str_tags=Split(p_tags,",")
                        For i = 0 To UBound(str_tags)
		                        Set tags=conn.execute("select tags_name from [Lebi_tags] where tags_name='"&Left(Trim(str_tags(i)),20)&"'")
				                If tags.eof Then
				                        conn.execute("insert into [Lebi_tags](tags_name,tags_num)values('"&Left(Trim(str_tags(i)),20)&"',1)")
				                Else
                                        conn.execute("update [Lebi_tags] set tags_num=tags_num+1 where tags_name='"&Left(Trim(str_tags(i)),20)&"'")
				                End If
				                tags.close:Set tags=Nothing
                        Next
		        Else
						p_tags = Left(p_tags,20)
		                Set tags=conn.execute("select tags_name from [Lebi_tags] where tags_name='"&p_tags&"'")
				        If tags.eof Then
				                conn.execute("insert into [Lebi_tags](tags_name,tags_num)values('"&p_tags&"',1)")
				        Else
                                conn.execute("update [Lebi_tags] set tags_num=tags_num+1 where tags_name='"&p_tags&"'")
				        End If
				        tags.close:Set tags=Nothing
		        End If
        End If
        rem 商品标签Tags  用于匹配相关类型商品 结束
		rem 增加商品重量 用于计算配送费用 2006-5-4 by 56770.kingdge
		p_weight=CheckNum(request("p_weight"),0)
        kucun=CheckNum(request("kucun"& id),0)
		total_kucun=CheckNum(request("total_kucun"& id),0)
	    categoryid = replace(safereplace(request("categoryid"))," ","")
		brand=Safereplace(request("brand"))
		p_order = CheckNum(request("p_order"),0)
        actionkucun=CheckNum(request("actionkucun"),0)
		enddate = safereplace(request("enddate"))
		If enddate = "" Then enddate = "2099-01-01"
		sj = safereplace(request("sj"))
		p_filename = ReplaceFolder(safereplace(request("p_filename")))
		p_remark = safereplace(request("p_remark"))
		p_SelectValue = replace(Replace(Trim(request("p_SelectValue")),"'","&#180;")," ","")
		p_SelectType = checknum(request("SelectType"),0)
		SpecificationCount = checknum(request("SpecificationCount"),0)
		If SpecificationCount > 0 Then 
				kucun = total_kucun
		End If 
		P_SpecificationName = safereplace(request("P_SpecificationName"))
		P_SpecificationValue = safereplace(request("P_SpecificationValue"))
		P_SpecificationPic = safereplace(request("P_SpecificationPic"))
		If P_SpecificationPic <> "" Then 
				If InStr(P_SpecificationPic,"|") > 0 Then 
						Arr_P_SpecificationPic = Split(P_SpecificationPic,"|")
						For i = 0 To UBound(Arr_P_SpecificationPic)
								If InStr(cpic,Arr_P_SpecificationPic(i)) = 0 Then 
										cpic = cpic &"@@"& Arr_P_SpecificationPic(i)
								End If 
						Next 
				Else
						If InStr(cpic,P_SpecificationPic) = 0 Then 
								cpic = cpic &"@@"& P_SpecificationPic
						End If 
				End If 
		End If 
		SameFilename = 0
		If p_filename <> "" Then
				Set rs = conn.execute("select top 1 id from [Lebi_product] where p_filename='"&p_filename&"' ")
				If Not rs.eof Then
						SameFilename = 1
				End If
				rs.close : Set rs = Nothing
		End If
        '结束检验，添加商品
        set rs=server.CreateObject("adodb.recordset")
        rs.open "select * from [Lebi_product] where id is null", conn, 1, 3
        rs.addnew
		For LangT = 1 To TotalLang
				rs("product_name" & LanguageTxt(LangT))=safereplace(request("product_name" & LanguageTxt(LangT)))
				If request("savepic" & LanguageTxt(LangT)) = "1" Then
						FilesPath="../pic/userfiles/image/"
						rs("details" & LanguageTxt(LangT))=ReplaceSaveRemoteFile(Replace(request("details" & LanguageTxt(LangT)),"'","&#180;"),False,True,True,FilesPath,Eshop_url)
				Else
						rs("details" & LanguageTxt(LangT))=Replace(request("details" & LanguageTxt(LangT)),"'","&#180;")
				End If
				rs("wap_details")=Replace(request("wap_details" & LanguageTxt(LangT)),"'","&#180;")
				rs("briefed" & LanguageTxt(LangT))=Left(Replace(request("briefed" & LanguageTxt(LangT)),"'","&#180;"),200)
				rs("pro_name" & LanguageTxt(LangT))=Replace(request("pro_name" & LanguageTxt(LangT)),"'","&#180;")
				rs("pro_info" & LanguageTxt(LangT))=Replace(request("pro_info" & LanguageTxt(LangT)),"'","&#180;")
				rs("webhead" & LanguageTxt(LangT))=safereplace(request("webtitle" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webkeyword" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webdescription" & LanguageTxt(LangT)))
				Set dbrand = conn.execute("select brand"& LanguageTxt(LangT) &" from Lebi_Brand where brand = '"& brand &"'")
				If Not dbrand.eof Then
						rs("brand" & LanguageTxt(LangT)) = dbrand(0)
				Else
						rs("brand" & LanguageTxt(LangT)) = brand
				End If
				dbrand.close : Set dbrand = Nothing
		Next
		If bianhao <>"" Then rs("bianhao")=bianhao
        rs("sprice")=sprice
		rs("cbprice")=cbprice
        rs("cprice")=cprice
        rs("pic")=pic
        rs("cpic")=cpic
		rs("zhuangtai")=zhuangtai
		rs("p_jifen")=p_jifen
		rs("p_tags")=p_tags
		rs("p_cx_sj")=p_cx_sj
		rs("p_stj_sj")=p_stj_sj
		rs("p_ytj_sj")=p_ytj_sj
        rs("p_chima")=","& c_chima &","
        rs("p_color")=","& c_color &","
		rs("p_gongxiao")=","& g_gongxiao &","
		rs("p_person")=","& p_person &","
		rs("kucun")=kucun
		rs("p_weight")=p_weight
		rs("categoryid") = ","& categoryid &","
		rs("sj") = Now()
		rs("cx") = cx
		rs("stj") = stj
		rs("ytj") = ytj
		rs("IsNew") = IsNew
		rs("buys") = 0
		rs("views") = 0
		rs("html") = 0
		rs("p_order") = p_order
		rs("actionkucun") = actionkucun
		rs("enddate") = enddate
		rs("p_filename") = p_filename
		rs("p_remark") = p_remark
		rs("p_SelectValue") = ","& p_SelectValue &","
		rs("p_SelectType") = p_SelectType
		rs("P_SpecificationName") = P_SpecificationName
		rs("P_SpecificationValue") = P_SpecificationValue
		rs("P_SpecificationPic") = P_SpecificationPic
        rs.update
        rs.close
        '取得添加商品ID
        set rs=conn.execute("select top 1 id,p_filename from [Lebi_product] order by id desc")
        id=rs(0)
		p_filename=rs(1)
        rs.close:set rs=Nothing
		If bianhao = "" Then conn.execute ("update [lebi_product] set bianhao='"& bianhao1 & id &"' where id=" & id&"")
		If p_filename = "" Then conn.execute ("update [lebi_product] set p_filename='"& id &"' where id=" & id&"")
		If SameFilename = 1 Then conn.execute ("update [lebi_product] set p_filename='"& p_filename & id &"' where id=" & id&"")
		If users_price = "" Then users_price = checknum(request("u_price"),0)
		If users_grade = "" Then users_grade = 1
		Call insertUsersPrice(id,users_price,users_grade) '将会员组价格插入产品价格表 2008-2-27 WangLei
		If safereplace(request("SP_no")) = "" Then 
				SpecificationCount = 0
		Else 
				If InStr(request("SP_no"),",") = 0 Then 
						SpecificationCount = 1
				Else
						SpecificationCount = UBound(Split(request("SP_no"),","))+1
				End If 
		End If 
		If SpecificationCount > 0 Then 
		If SpecificationCount > 1 Then 
		For i = 0 To SpecificationCount-1
				p_no = safereplace(Split(request("SP_no"),",")(i))
				s_value = Split(request("SP_value"),",")(i)
				p_stock = checknum(Split(request("SP_stock"),",")(i),0)
				p_price = checknum(Split(request("SP_price"),",")(i),0)
				p_cbprice = checknum(Split(request("SP_cbprice"),",")(i),0)
				p_weight = checknum(Split(request("SP_weight"),",")(i),0)
				set rs = server.CreateObject("adodb.recordset")
				rs.open "select * from [Lebi_Product_Stock]", conn, 1, 3
				rs.addnew
				For LangT = 1 To TotalLang
						If InStr(s_value,"@") = 0 Then 
								If InStr(s_value,"$$$") = 0 Then 
										rs("s_value" & LanguageTxt(LangT))=safereplace(s_value)
								Else
										rs("s_value" & LanguageTxt(LangT))=safereplace(Split(s_value,"$$$")(LangT-1))
								End If 
						Else
								tmp_s_value = ""
								For ii = 0 To UBound(Split(s_value,"@"))
										If InStr(Split(s_value,"@")(ii),"$$$") = 0 Then 
												tmp_s_value = tmp_s_value & safereplace(Split(s_value,"@")(ii))
										Else
												tmp_s_value = tmp_s_value & safereplace(Split(Split(s_value,"@")(ii),"$$$")(LangT-1))
										End If 
										If ii < UBound(Split(s_value,"@")) Then tmp_s_value = tmp_s_value & ","
								Next
								rs("s_value" & LanguageTxt(LangT))=tmp_s_value
						End If 
				Next
				rs("p_id") = id
				rs("p_no") = p_no
				rs("p_stock") = p_stock
				rs("p_price") = p_price
				rs("p_cbprice") = p_cbprice
				rs("p_weight") = p_weight
				rs.update 
				rs.close : Set rs = Nothing
		Next 
		Else
				p_no = safereplace(request("SP_no"))
				s_value = request("SP_value")
				p_stock = checknum(request("SP_stock"),0)
				p_price = checknum(request("SP_price"),0)
				p_cbprice = checknum(request("SP_cbprice"),0)
				p_weight = checknum(request("SP_weight"),0)
				set rs = server.CreateObject("adodb.recordset")
				rs.open "select * from [Lebi_Product_Stock]", conn, 1, 3
				rs.addnew
				For LangT = 1 To TotalLang
						If InStr(s_value,"@") = 0 Then 
								If InStr(s_value,"$$$") = 0 Then 
										rs("s_value" & LanguageTxt(LangT))=safereplace(s_value)
								Else
										rs("s_value" & LanguageTxt(LangT))=safereplace(Split(s_value,"$$$")(LangT-1))
								End If 
						Else
								tmp_s_value = ""
								For ii = 0 To UBound(Split(s_value,"@"))
										If InStr(Split(s_value,"@")(ii),"$$$") = 0 Then 
												tmp_s_value = tmp_s_value & safereplace(Split(s_value,"@")(ii))
										Else
												tmp_s_value = tmp_s_value & safereplace(Split(Split(s_value,"@")(ii),"$$$")(LangT-1))
										End If 
										If ii < UBound(Split(s_value,"@")) Then tmp_s_value = tmp_s_value & ","
								Next
								rs("s_value" & LanguageTxt(LangT))=tmp_s_value
						End If 
				Next
				rs("p_id") = id
				rs("p_no") = p_no
				rs("p_stock") = p_stock
				rs("p_price") = p_price
				rs("p_cbprice") = p_cbprice
				rs("p_weight") = p_weight
				rs.update 
				rs.close : Set rs = Nothing
		End If 
		End If 
	    rem 更新分类商品数 2006-4-26 56770.kingdge
	    conn.execute "update [Lebi_category] set c_pronum = c_pronum+1 where c_id in(" & categoryid &")"
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Product(2) &" ["& product_name &"]"
		If show_html = 1 Then
		        html_index="<IFRame name='html_index' frameborder=0 width='350' height=20 scrolling=no src='plugin/Tohtml/_html_default.asp?mes_type=1'></IFrame>"
				html_product="<IFRame name='html_prolist' frameborder=0 width='350' height=20 scrolling=no src='plugin/Tohtml/_html_showproduct.asp?html_id="& id &"'></IFrame>"
			    m_s_z = "·"& Lang_Product(11) & html_index &"<br />·"& Lang_Product(12) & html_product &""
		Else
		        m_s_z = 0
		End If
		Response.cookies(cookiesname)("backtype") = request.Form("backtype")
		Session(cookiesname&"_admin"&"backtype") = request.Form("backtype")
		ref = CheckUrl(request("ref"))
		If ref <> "" Then 
			m_u=ref
		Else
			Select Case request.Form("backtype")
				   Case "1" m_u="Admin_product_add.asp?sort_id=" & categoryid &""
				   Case "2" m_u="Admin_product.asp"
				   Case "3" m_u="Admin_product_list.asp"
			End Select
		End If 
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),m_s_z,m_u,0,0,2,1)
End Sub

Sub main
Randomize
RanNum = Int(90000*rnd)+10000
sort_id = safereplace(request("sort_id"))
backtype = request.cookies(cookiesname)("backtype")
If backtype = "" Then backtype = Session(cookiesname&"_admin"&"backtype")
backtype = checknum(backtype,1)
If id <> 0 Then
        sql = "select bianhao,sprice,cprice,cbprice,p_weight,p_jifen,kucun,categoryid,brand,p_tags,pic,cpic,p_color,p_chima,p_gongxiao,p_person,IsNew,stj,ytj,cx,p_cx_sj,p_stj_sj,p_ytj_sj,actionkucun,enddate,p_SelectValue,P_SpecificationName,P_SpecificationValue,P_SpecificationPic from [Lebi_product] where id = "& id
		set Rs = conn.execute(Sql)
		If not rs.eof Then
				bianhao = rs("bianhao")
				sprice = rs("sprice")
				cprice = rs("cprice")
				cbprice = rs("cbprice")
				p_weight = rs("p_weight")
				p_jifen = rs("p_jifen")
				kucun = rs("kucun")
				sort_id = rs("categoryid")
				brand = rs("brand")
				p_tags = rs("p_tags")
				pic = rs("pic")
				cpic = rs("cpic")
				p_color = rs("p_color")
				p_chima = rs("p_chima")
				p_gongxiao = rs("p_gongxiao")
				p_person = rs("p_person")
				IsNew = RS("IsNew")
				STJ = RS("STJ")
				ytj = rs("ytj")
				cx = rs("cx")
				p_cx_sj = rs("p_cx_sj")
				p_stj_sj = rs("p_stj_sj")
				p_ytj_sj = rs("p_ytj_sj")
				actionkucun = rs("actionkucun")
				enddate = rs("enddate")
				p_SelectValue = rs("p_SelectValue")
				P_SpecificationName = rs("P_SpecificationName")
				P_SpecificationValue = rs("P_SpecificationValue")
				P_SpecificationPic = rs("P_SpecificationPic")
				SpecificationCount = checknum(conn.execute("select count(id) from [Lebi_Product_Stock] where p_id = "& id &"")(0),0)
				setUsersPrice(id)
		End If
		rs.close:set rs=nothing
Else
	    sprice = "0.1"
		price = "0.1"
		cbprice = "0"
		kucun = "100"
		p_jifen = "0"
		p_weight = "0"
		enddate = "2099-9-9"
		setUsersPrice(0)
		SpecificationCount = 0
End If
LastSort_id = sort_id
If InStr(LastSort_id,",") > 0 Then LastSort_id = checknum(Split(LastSort_id,",")(1),0)
IsSelectValue = 0
selecttype = 0
sql = "select top 1 s_id from [Lebi_SelectType] where "
if IsSqlDataBase ="1" then sql = sql &"CharIndex(',"& LastSort_id &",',categoryid)>0"
if IsSqlDataBase ="0" then sql = sql &"instr(categoryid,',"& LastSort_id &",')>0"
sql = sql &" order by s_order desc,s_id desc"
Set rs = conn.execute(sql)
If Not rs.eof Then 
		SelectType = rs(0)
End If 
rs.close : Set rs = Nothing
%>
<script language="javascript">
var Lang_Product = "<%=Lang_Product(102)%>$<%=Lang_Product(104)%>$<%=Lang_Product(236)%>$<%=Lang_Product(103)%>$<%=Lang_Product(198)%>$<%=Lang_Product(135)%>";
</script>
<script language="javascript" type="text/javascript" src="inc/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/tipswindown.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/product.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script>
<script language="vbscript">
function toAsc(str)
	toAsc = hex(asc(str))
end function
</script>
<script language="javascript">
function LebiCopyName(){
	var iscopy = document.getElementById('CopyName');
	if (iscopy.checked){
	document.getElementById('p_filename').value=document.getElementById('product_name').value;
	}
}
function LebiCopyNameToPinYin(){
	var iscopy = document.getElementById('CopyNameToPinYin');
	var product_name = document.getElementById('product_name').value;
	if (iscopy.checked && product_name !=""){
	document.getElementById('p_filename').value=CC2PY(document.getElementById('product_name').value);
	}
}
function CheckForm()
{
	if (CheckEmpty('product_name<%= LanguageTxt(1) %>')){ShowMessage('product_name<%= LanguageTxt(1) %>','<%=Lang_Product(3)%>');return false;}
	if (CheckEmpty('sprice')){ShowMessage('sprice','<%=Lang_Product(4)%>');return false;}
	if (CheckEmpty('cbprice')){ShowMessage('cbprice','<%=Lang_Product(5)%>');return false;}
	/********WangLei 2008-2-23********/
	if (document.forms['addproduct'].elements['u_price'] != undefined)
	{
		var obj = document.forms['addproduct'].elements['u_price'];
		var up = "";
		var ug = "";
		//alert(obj.length);
		for(var i = 0; i < obj.length; i++)
		{
			if (CheckEmpty('u_price_'+i+'')){ShowMessage('u_price_'+i+'','<%=Lang_Product(9)%>');return false;} //请填写'+uGradeArr[i][1]+'！
				up = up + obj[i].value +",";
				ug = ug + uGradeArr[i][0] +",";
		}
		document.forms['addproduct'].elements['users_price'].value = up;
		document.forms['addproduct'].elements['users_grade'].value = ug;
	}
	//if (CheckEmpty('categoryid')){ShowMessage('categoryid','<%=Lang_Product(6)%>');return false;}
	if (CheckEmpty('pic')){ShowMessage('pic','<%=Lang_Product(7)%>');return false;}
	if (CheckEmpty('cpic')){ShowMessage('cpic','<%=Lang_Product(8)%>');return false;}
	getSubmit();
}
function getSubmit()
{
	<%For LangT = 1 To TotalLang%>
	var p_ProductName<%= LanguageTxt(LangT) %> = document.getElementsByName("p_ProductName<%= LanguageTxt(LangT) %>");
	var p_ProductValueType<%= LanguageTxt(LangT) %> = document.getElementsByName("p_ProductValueType<%= LanguageTxt(LangT) %>");
	var p_SelectValue<%= LanguageTxt(LangT) %> = document.getElementsByName("ajax_SelectValue<%= LanguageTxt(LangT) %>");
	var pro_name_tArray<%= LanguageTxt(LangT) %> = new Array();
	var pro_value_type_tArray<%= LanguageTxt(LangT) %> = new Array();
	var p_SelectValue_param<%= LanguageTxt(LangT) %> = new Array();
	for(i=0;i<p_ProductName<%= LanguageTxt(LangT) %>.length;i++){pro_name_tArray<%= LanguageTxt(LangT) %>.push(p_ProductName<%= LanguageTxt(LangT) %>[i].value);}
	document.getElementById("pro_name<%= LanguageTxt(LangT) %>").value=pro_name_tArray<%= LanguageTxt(LangT) %>.join("$");
	for(i=0;i<p_ProductValueType<%= LanguageTxt(LangT) %>.length;i++){pro_value_type_tArray<%= LanguageTxt(LangT) %>.push(p_ProductValueType<%= LanguageTxt(LangT) %>[i].value);}
	var pro_value_type = pro_value_type_tArray<%= LanguageTxt(LangT) %>.join(",");
	for(i=0;i<p_SelectValue<%= LanguageTxt(LangT) %>.length;i++){if (p_SelectValue<%= LanguageTxt(LangT) %>[i].checked){p_SelectValue_param<%= LanguageTxt(LangT) %>+=p_SelectValue<%= LanguageTxt(LangT) %>[i].value +",";}}
	<%if LangT = 1 Then%>
	if (p_SelectValue_param<%= LanguageTxt(LangT) %>.length > 0){document.getElementById("p_SelectValue").value=p_SelectValue_param<%= LanguageTxt(LangT) %>.substring(0,p_SelectValue_param<%= LanguageTxt(LangT) %>.length-1);}else{document.getElementById("p_SelectValue").value="";}
	<%End If%>
	var str<%= LanguageTxt(LangT) %> = "";
	for(i=0;i<p_ProductName<%= LanguageTxt(LangT) %>.length;i++){
		if (pro_value_type.split(',')[i] == 0){str<%= LanguageTxt(LangT) %> += document.getElementById("p_ProductValue_"+i+"<%= LanguageTxt(LangT) %>").value+"$$$";}else{
		var str_list<%= LanguageTxt(LangT) %> = "",list_list<%= LanguageTxt(LangT) %> = document.getElementsByName("p_ProductValue_"+i+"<%= LanguageTxt(LangT) %>");
		for(k=0;k<list_list<%= LanguageTxt(LangT) %>.length;k++){if(list_list<%= LanguageTxt(LangT) %>[k].checked){str_list<%= LanguageTxt(LangT) %>+=list_list<%= LanguageTxt(LangT) %>[k].value+",";}}
		str<%= LanguageTxt(LangT) %> += str_list<%= LanguageTxt(LangT) %>.substring(0,str_list<%= LanguageTxt(LangT) %>.length-1)+"$$$";
		}
	}
	document.getElementById("pro_info<%= LanguageTxt(LangT) %>").value=str<%= LanguageTxt(LangT) %>;
	<%Next%>
	var P_SpecificationPic = document.getElementsByName("SValuePic");
	var P_SpecificationPic_tArray = new Array();
	for(i=0;i<P_SpecificationPic.length;i++){P_SpecificationPic_tArray.push(P_SpecificationPic[i].value);}
	document.getElementById("P_SpecificationPic").value=P_SpecificationPic_tArray.join("|");
	var Temp_SpecificationName = document.getElementsByName("Hidden_SName");
	var Temp_SpecificationName_tArray = new Array();
	var Temp_SpecificationValue_tArray = new Array();
	var Temp_SpecificationName_value = "";
	var Temp_SpecificationValue_value = "";
	var Temp_SpecificationValue;
	var sname = "";
	var svalue = "";
	for(i=0;i<Temp_SpecificationName.length;i++){if(Temp_SpecificationName[i].checked==true){Temp_SpecificationName_tArray.push(Temp_SpecificationName[i].value);   }}
	Temp_SpecificationName_value=Temp_SpecificationName_tArray.join(",");
	if (Temp_SpecificationName_value != "")
	{
		if (Temp_SpecificationName_value.indexOf(",")==-1)
		{
			sname += Temp_SpecificationName_value.split("|")[0];
			Temp_SpecificationValue = document.getElementsByName("SValue"+Temp_SpecificationName_value.split("|")[0]+"");
			for(v=0;v<Temp_SpecificationValue.length;v++){if(Temp_SpecificationValue[v].checked==true){svalue += Temp_SpecificationValue[v].value.split("|")[0] +"|"; }}
			document.getElementById("P_SpecificationName").value=sname;
			document.getElementById("P_SpecificationValue").value=svalue;
		}else{
			for(i=0;i<Temp_SpecificationName_value.split(",").length;i++)
			{
				sname += Temp_SpecificationName_value.split(",")[i].split("|")[0]; 
				Temp_SpecificationValue = document.getElementsByName("SValue"+Temp_SpecificationName_value.split(",")[i].split("|")[0]+"");
				for(s=0;s<Temp_SpecificationValue.length;s++){if(Temp_SpecificationValue[s].checked==true){Temp_SpecificationValue_tArray.push(Temp_SpecificationValue[s].value);   }}
				Temp_SpecificationValue_value=Temp_SpecificationValue_tArray.join(",");
				if (Temp_SpecificationValue_value.indexOf(",")==-1){
					for(v=0;v<Temp_SpecificationValue.length;v++){if(Temp_SpecificationValue[v].checked==true){svalue += Temp_SpecificationValue[v].value.split("|")[0]; if (v<Temp_SpecificationValue.length-1){svalue += ",";}}}
					if (svalue.charAt(svalue.length - 1) == ","){svalue = svalue.substring(0,svalue.length-1);}
				}else{
					for(v=0;v<Temp_SpecificationValue.length;v++){if(Temp_SpecificationValue[v].checked==true){svalue += Temp_SpecificationValue[v].value.split("|")[0]; if (v<Temp_SpecificationValue.length-1){svalue += ",";}}}
					if (svalue.charAt(svalue.length - 1) == ","){svalue = svalue.substring(0,svalue.length-1);}
				}
				if (i<Temp_SpecificationName_value.split(",").length-1){sname += ",";svalue += "|";}
			}
			document.getElementById("P_SpecificationName").value=sname;
			document.getElementById("P_SpecificationValue").value=svalue;
		}
	}
	var SP_id = document.getElementsByName("ajax_s_id");
	var SP_id_value = "";
	var SP_no = document.getElementsByName("ajax_p_no");
	var SP_no_value = "";
	var SP_value = document.getElementsByName("ajax_s_value");
	var SP_value_value = "";
	var SP_stock = document.getElementsByName("ajax_p_stock");
	var SP_stock_value = "";
	var SP_price = document.getElementsByName("ajax_p_price");
	var SP_price_value = "";
	var SP_cbprice = document.getElementsByName("ajax_p_cbprice");
	var SP_cbprice_value = "";
	var SP_weight = document.getElementsByName("ajax_p_weight");
	var SP_weight_value = "";
	for(i=0;i<SP_id.length;i++){SP_id_value += SP_id[i].value; if (i<SP_id.length-1){SP_id_value += ",";}}
	for(i=0;i<SP_no.length;i++){SP_no_value += SP_no[i].value; if (i<SP_no.length-1){SP_no_value += ",";}}
	for(i=0;i<SP_value.length;i++){SP_value_value += SP_value[i].value; if (i<SP_value.length-1){SP_value_value += ",";}}
	for(i=0;i<SP_stock.length;i++){SP_stock_value += SP_stock[i].value; if (i<SP_stock.length-1){SP_stock_value += ",";}}
	for(i=0;i<SP_price.length;i++){SP_price_value += SP_price[i].value; if (i<SP_price.length-1){SP_price_value += ",";}}
	for(i=0;i<SP_cbprice.length;i++){SP_cbprice_value += SP_cbprice[i].value; if (i<SP_cbprice.length-1){SP_cbprice_value += ",";}}
	for(i=0;i<SP_weight.length;i++){SP_weight_value += SP_weight[i].value; if (i<SP_weight.length-1){SP_weight_value += ",";}}
	document.getElementById("SP_id").value = SP_id_value;
	document.getElementById("SP_no").value = SP_no_value;
	document.getElementById("SP_value").value = SP_value_value;
	document.getElementById("SP_stock").value = SP_stock_value;
	document.getElementById("SP_price").value = SP_price_value;
	document.getElementById("SP_cbprice").value = SP_cbprice_value;
	document.getElementById("SP_weight").value = SP_weight_value;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form action="?" method="post" name="addproduct" onSubmit="return CheckForm();">
<tr>
   <td height="30" align="left" class="classhead">
        <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="getSubmitProNameValue();return false;" align="absmiddle">
   </td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
</tr>
<tr>
<td height="30" class="classtop" colspan="2"><%
If id <> 0 Then
	response.write Lang_Product(107)
Else
	response.write Lang_Menu(52)
End If 
%></td>
</tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%For LangT = 1 To TotalLang%>
<%
If id <> 0 Then
		Set rs = conn.execute("select pro_name"&LanguageTxt(LangT)&",pro_info"&LanguageTxt(LangT)&",product_name"&LanguageTxt(LangT)&",briefed"&LanguageTxt(LangT)&",details"&LanguageTxt(LangT)&",webhead"&LanguageTxt(LangT)&",categoryid,p_SelectType,wap_details"&LanguageTxt(LangT)&",webhead"&LanguageTxt(LangT)&" from [Lebi_Product] where id = "& id &"")
		pro_name = rs(0)
		pro_info = rs(1)
		product_name = rs(2)
		briefed = rs(3)
		details = rs(4)
		webhead = rs(5)
		If IsNull(webhead) Or InStr(webhead,"$$$") = 0 Then webhead = "$$$$$$$$$"
		webtitle = Split(webhead,"$$$")(0)
		webkeyword = Split(webhead,"$$$")(1)
		webdescription = Split(webhead,"$$$")(2)
		sort_id = rs(6)
		SelectType = rs(7)
		wap_details = rs(8)
		rs.close()
End If
%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="0" width="100%" border="0" id="add_<%= LangT %>">
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Product(16)%></td>
<td colspan="3" class="classrow"><input type="text" id="product_name<%= LanguageTxt(LangT) %>" name="product_name<%= LanguageTxt(LangT) %>" size="78" class="form" value="<%= product_name %>"> <span id="mes_product_name<%= LanguageTxt(LangT) %>"></span>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_Product(17)%><br /><em>≤ <span id="remLen<%= LanguageTxt(LangT) %>">200</span></em></td>
<td colspan="3" class="classrow"><textarea wrap="physical" name="briefed<%= LanguageTxt(LangT) %>" id="briefed<%= LanguageTxt(LangT) %>" rows="3" cols="60" onKeyDown="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" onKeyUp="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" class="text"><%= briefed %></textarea>
<br /><a href="javascript:u_Size(-5,'briefed<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
<a href="javascript:u_Size(5,'briefed<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
<script type="text/javascript">
var maxLen<%= LanguageTxt(LangT) %> = 200;
var briefed<%= LanguageTxt(LangT) %> = document.getElementById("briefed<%= LanguageTxt(LangT) %>");
function checkMaxInput<%= LanguageTxt(LangT) %>(form) {
if (briefed<%= LanguageTxt(LangT) %>.value.length > maxLen<%= LanguageTxt(LangT) %>)
briefed<%= LanguageTxt(LangT) %>.value = briefed<%= LanguageTxt(LangT) %>.value.substring(0, maxLen<%= LanguageTxt(LangT) %>);
else document.getElementById("remLen<%= LanguageTxt(LangT) %>").innerHTML = maxLen<%= LanguageTxt(LangT) %> - briefed<%= LanguageTxt(LangT) %>.value.length;
}
</script>
</td>
</tr>
    <tr class="classrow">
      <td width="12%" height="30" class="classrow" valign="top"><%=Lang_Product(19)%><div class="autosave"><span id="timemsg<%= LanguageTxt(LangT) %>"></span><br /><span id="msg2<%= LanguageTxt(LangT) %>"></span><br /><span id="msg<%= LanguageTxt(LangT) %>"></span></div><div class="autosave"><input type="checkbox" name="savepic<%= LanguageTxt(LangT) %>" value="1"><%=Lang_sys(71)%></div></td>
<td colspan="3" class="classrow">
<textarea name="details<%= LanguageTxt(LangT) %>" id="details<%= LanguageTxt(LangT) %>" rows="12" cols="80" class="text"><%
If Not IsNull(details) Then 
	Response.write server.htmlencode(details) 
End If 
%>
</textarea>
<span id="btn_showFCK<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="" class="button"></span>
<span id="ReHeightFCK<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'details<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'details<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<script type="text/javascript">
function showFCK<%= LanguageTxt(LangT) %>(){
	document.getElementById("btn_showFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("ReHeightFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('details<%= LanguageTxt(LangT) %>',{height:300});
}
</script>
<%If Config_Lebi_Eshop(19) = "0" Then%><script type="text/javascript">showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=product<%= LanguageTxt(LangT) %>&Lang=<%= LanguageTxt(LangT) %>"></SCRIPT>
</td>
</tr>
    <tr class="classrow">
      <td width="12%" height="30" class="classrow" valign="top">WAP端描述：</td>
<td colspan="3" class="classrow">
<textarea name="wap_details<%= LanguageTxt(LangT) %>" id="wap_details<%= LanguageTxt(LangT) %>" rows="12" cols="80" class="text"><%
If Not IsNull(wap_details) Then 
	Response.write server.htmlencode(wap_details) 
End If 
%>
</textarea>
<span id="wap_btn_showFCK<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="" class="button"></span>
<span id="wap_ReHeightFCK<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'wap_details<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'wap_details<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<script type="text/javascript">
function wap_showFCK<%= LanguageTxt(LangT) %>(){
	document.getElementById("wap_btn_showFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("wap_ReHeightFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('wap_details<%= LanguageTxt(LangT) %>',{height:300});
}
</script>
<%If Config_Lebi_Eshop(19) = "0" Then%><script type="text/javascript">wap_showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
</td>
</tr>
<tr id="ProductValueBox<%= LanguageTxt(LangT) %>" style="display:none">
<td width="15%" height="30" valign="top" class="classrow"><%=Lang_Product(226)%></td>
<td width="85%" colspan="3" class="classrow">
<input type="hidden" name="pro_name<%= LanguageTxt(LangT) %>" id="pro_name<%= LanguageTxt(LangT) %>">
<input type="hidden" name="pro_info<%= LanguageTxt(LangT) %>" id="pro_info<%= LanguageTxt(LangT) %>">
<span id="ProductValue<%= LanguageTxt(LangT) %>"><script type="text/javascript">getSelectValue(<%=SelectType%>,'<%=pro_name%>@@<%=pro_info%>',0,2,'<%= LanguageTxt(LangT) %>');</script></span>
</td>
</tr>
	</table>
	</div>
	<script type="text/javascript">tdshow("add_<%= LangT %>");</script>
<%Next%>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="mainbody-block">
<div class="mainbody-block2">
<table cellspacing="0" cellpadding="0" width="100%" border="0" id="add_other" class="classtable">
<tr><td height="30" class="classtop" colspan="2"><%=Lang_Product(223)%></td></tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Product(21)%></td>
<td width="85%" class="classrow"><input type="text" name="bianhao" value="<%= bianhao %>" size="20" class="form"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(22)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(36)%></td>
<td class="classrow"><input type="text" name="brand" size="20" maxlength="10" value="<%= brand %>" class="form">
<select name="brand2" class="form" onChange="(document.addproduct.brand.value=this.options[this.selectedIndex].value)">
<option value="" selected>┌ <%=Lang_sys(77)%></option>
<%
sort_arr = Split(sort_id,",")
sql_1 = ""
for j=0 to ubound(sort_arr)
		If IsSqlDataBase = 1 Then
				sql_1 = sql_1 & " charindex(',"&trim(sort_arr(j))&",',b_class)>0 or CharIndex(',,',b_class)>0"
				If j < ubound(sort_arr) Then sql_1 = sql_1 & " or "
		Else
				sql_1 = sql_1 & " instr(b_class,',"&trim(sort_arr(j))&",')>0 or instr(b_class,',,')>0"
				If j < ubound(sort_arr) Then sql_1 = sql_1 & " or "
		End If
Next
sql="select brand from [Lebi_brand]"
If sql_1 <> "" Then sql = sql &" where ("&sql_1&")"
sql = sql &" order by paixu desc"
set rs = conn.execute(sql)
if not rs.eof then
		do while not rs.eof
		%>
		<option value="<%=trim(rs("brand"))%>">├ <%=trim(rs("brand"))%></option>
		<%
		rs.movenext
		loop
		rs.close
end if%></select></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(37)%></td>
<td class="classrow"><input type="text" name="kucun<%=id%>" id="kucun<%=id%>" size="5" maxlength="10" value="<%= kucun %>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"><input type="hidden" name="total_kucun<%=id%>" id="total_kucun<%=id%>" value="<%= kucun %>" /></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(45)%><!--br><font color=red>（单位：元）</font--></td>
<td class="classrow"><%=Lang_Product(46)%><input type="text" id="sprice" name="sprice" size="6" value="<%= sprice %>" maxlength="10" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"> <span id="mes_sprice"></span><INPUT onclick="marketPriceSetted()" type="button" value="<%=Lang_Product(47)%>" class="button"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(48)%>','50','up');" onmouseout="hidehintinfo();" />
&nbsp;&nbsp;<%=Lang_Product(49)%><input type="text" id="cbprice" name="cbprice" size="6" maxlength="10" value="<%= cbprice %>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(50)%>','50','up');" onmouseout="hidehintinfo();" /> <span id="mes_cbprice"></span>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(51)%></td>
<td class="classrow"><SCRIPT LANGUAGE="JavaScript">setPrice();</SCRIPT><INPUT TYPE="hidden" NAME="users_price"><INPUT TYPE="hidden" NAME="users_grade">&nbsp;<%=Lang_Product(34)%><input type="text" name="cprice" size="6" maxlength="10" value="<%=cprice%>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"></td>
</tr>
<tr class="classrow">
<td height="30" valign="top" class="classrow"><%=Lang_SelectValue(17)%></td>
<td class="classrow">
<select name="SelectType" id="SelectType" onChange="getSelectValue(0,'',<%=id%>,0,'');getSelectValue(0,'',<%=id%>,1,'');<%For LangT = 1 To TotalLang%>getSelectValue(0,'',<%=id%>,2,'<%= LanguageTxt(LangT) %>');<%Next%>">
<%
sql = "select s_name,s_id from [Lebi_SelectType] 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 
Response.Write("<option value="""">┌ "& Lang_SelectValue(18) &"</option>")
If IsSelectValue = 1 Then 
For i = 0 To UBound(DataSelectValue,2)
Arr_SelectValue = Split(DataSelectValue(1,i),Chr(13)&Chr(10))
For ii = 0 To UBound(Arr_SelectValue)
	Response.Write("<option value="""& DataSelectValue(1,i) &""" "& judge2(DataSelectValue(1,i),SelectType) &">├ "& DataSelectValue(0,i) &"</option>")
Next 
Next 
End If 
%>
</select>
</td>
</tr>
<tr id="SpecificationValueBox" class="classrow" style="display:none">
<td height="30" valign="top" class="classrow">&nbsp;</td>
<td class="classrow">
<input type="hidden" name="P_SpecificationName" id="P_SpecificationName" value="<%=P_SpecificationName%>" />
<input type="hidden" name="P_SpecificationValue" id="P_SpecificationValue" value="<%=P_SpecificationValue%>" />
<input type="hidden" name="P_SpecificationPic" id="P_SpecificationPic" value="<%=P_SpecificationPic%>" />
<input type="hidden" name="SpecificationCount" id="SpecificationCount" value="<%=SpecificationCount%>" />
<input type="hidden" name="SP_id" id="SP_id" />
<input type="hidden" name="SP_no" id="SP_no" />
<input type="hidden" name="SP_value" id="SP_value" />
<input type="hidden" name="SP_stock" id="SP_stock" />
<input type="hidden" name="SP_price" id="SP_price" />
<input type="hidden" name="SP_cbprice" id="SP_cbprice" />
<input type="hidden" name="SP_weight" id="SP_weight" />
<span id="SpecificationValue"><script type="text/javascript">getSelectValue(<%=SelectType%>,'<%=P_SpecificationName%>$$$<%=P_SpecificationValue%>',<%=id%>,1,'');</script></span>
<span id="Get_SpecificationPic<%=id%>"></span>
<span id="Get_Specification<%=id%>"></span>
<table id="Table_Specification" cellpadding="0" cellspacing="0" width="100%" class="tablelist" style="display:none"></table>
<script type="text/javascript">getspecificationpic(<%=id%>,'<%=P_SpecificationValue%>','<%=P_SpecificationPic%>');getspecification(<%=id%>,'<%=P_SpecificationName%>',0);</script>
</td>
</tr>
<tr class="classrow">
<td width="12%" height="30" class="classrow"><%=Lang_Product(53)%></td>
<td height="30" class="classrow">
<table cellspacing="0" cellpadding="0"><tr><td><input type="text" id="pic" name="pic" value="<%= pic %>" size="25" class="form"></td>
<td width="5"></td>
<td><IFRAME src="upfile/upload.asp?u_type=0" frameBorder=0 width="400" height="23" scrolling=no allowtransparency="true"></IFRAME> <span id="mes_pic"></span></td>
</tr>
</table>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_Product(56)%></td>
<td height="30" class="classrow"><textarea id="cpic" name="cpic" rows="3" cols="40" class="text"><%= cpic %></textarea>
<IFRAME src="upfile/upload.asp?u_type=1" frameBorder=0 width="280" height="52" scrolling=no allowtransparency="true"></IFRAME><img src="images/help.gif" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(57)%>','50','up');" onmouseout="hidehintinfo();" /> <span id="mes_cpic"></span><br />
<a href="javascript:u_Size(-5,'cpic')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
<a href="javascript:u_Size(5,'cpic')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
</td>
</tr>
<tr id="SelectValueBox" class="classrow" style="display:none">
<td height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_Product(225)%></td>
<td class="classrow">
<input type="hidden" name="p_SelectValue" id="p_SelectValue" value="<%=p_SelectValue%>" />
<span id="SelectValue"><script type="text/javascript">getSelectValue(<%=SelectType%>,'<%=p_SelectValue%>',<%=id%>,0,'');</script></span>
</td>
</tr>
<tr class="classrow">
<td class="classrow" valign="top"><%=Lang_Product(158)%><br/><em><%=Lang_Product(23)%></em></td>
<td class="classrow"><select id="categoryid" name="categoryid" size="10" multiple="multiple" style="width:200px;">
<% check_sort (0),ii,","& sort_id &"," %>
</select>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(38)%></td>
<td class="classrow"><input type="text" name="actionkucun" size="5" maxlength="10" value="<%= actionkucun %>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(39)%></td>
<td class="classrow"><input type="text" name="enddate" value="<%= enddate %>" size="10" class="Calendar" onclick="setday(this)" /> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(40)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(41)%></td>
<td class="classrow"><input type="text" name="p_weight" id="p_weight" size="5" maxlength="10" value="<%= p_weight %>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(42)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(43)%></td>
<td class="classrow"><input type="text" name="p_jifen" size="5" maxlength="10" value="<%= p_jifen %>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(44)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(52)%></td>
<td colspan="2" class="classrow"><input type="text" name="p_order" size="5" maxlength="10" value="0" value="0" class="form" onkeyup="value=value.replace(/[^\d]/g,'');"></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(20)%></td>
<td colspan="2" class="classrow"><input type="text" name="sj" size="20" value="<%=Now()%>" class="calendar" onclick="setday(this)" style="width:120px"></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_Product(24)%></td>
<td class="classrow"><input type="text" name="p_tags" size="40" value="<%= p_tags %>" class="form">
<select name="brand2" class="form" onchange="DoTags(this.options[this.selectedIndex].value)">
<option value="" selected>┌ <%=Lang_sys(77)%></option>
<%
sql="select tags_name,tags_num from [Lebi_tags] order by tags_num desc"
set rs = conn.execute(sql)
if not rs.eof Then
		do while not rs.eof%>
		<option value="<%=trim(rs("tags_name"))%>,">├ <%=trim(rs("tags_name"))%> (<%=trim(rs("tags_num"))%>)</option>
		<%
		rs.movenext
		loop
End If
rs.close:Set rs=Nothing
%>
</select>
<img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(25)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(26)%></td>
<td class="classrow">
<%=Lang_Product(75)%> <input type="checkbox" name="zhuangtai" value="1" checked>&nbsp;┊&nbsp;<%=Lang_Product(27)%> <input type="checkbox" name="IsNew" value="1" <%=judge(IsNew,"1")%>>&nbsp;┊&nbsp;<%=Lang_Product(28)%> <input type="checkbox" name="stj" value="1" <%=judge(stj,"1")%>>&nbsp;<%=Lang_Product(29)%><input type="text" name="p_stj_sj" style="width:30px;" class="form" value="<%=p_stj_sj%>"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(30)%>','50','up');" onmouseout="hidehintinfo();" />&nbsp;┊&nbsp;<%=Lang_Product(31)%> <input type="checkbox" name="ytj" value="1" <%=judge(ytj,"1")%>>&nbsp;<%=Lang_Product(29)%><input type="text" name="p_ytj_sj" style="width:30px;" class="form" value="<%=p_ytj_sj%>"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(30)%>','50','up');" onmouseout="hidehintinfo();" />&nbsp;┊&nbsp;<%=Lang_Product(32)%><img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(33)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" name="cx" value="1" <%=judge(cx,"1")%>>&nbsp;<%=Lang_Product(35)%><input type="text" name="p_cx_sj" style="width:30px;" class="form" value="<%=p_cx_sj%>"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(30)%>','50','up');" onmouseout="hidehintinfo();" />
</td>
</tr>
</table>
</div>
</div>
<div class="mainbody-block">
<div class="mainbody-block2">
<table cellspacing="0" cellpadding="0" width="100%" border="0" class="classtable">
<tr>
   <td height="30" class="classtop" colspan="4"><%=Lang_sys(73)%></td>
 </tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist2">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="seo<%= LangT %>" style="CURSOR:pointer;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%For LangT = 1 To TotalLang%>
   <div id="seo<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="0" width="100%" border="0" id="seo_<%= LangT %>">
<tr class="classrow">
   <td width="15%" height="30" class="classrow"><%=Lang_sys(74)%></td>
   <td width="85%" class="classrow"><input name="webtitle<%= LanguageTxt(LangT) %>" value="<%= webtitle %>" type="text" class="form" size="78"></td>
</tr>
<tr class="classrow">
   <td height="30" class="classrow"><%=Lang_sys(75)%></td>
   <td class="classrow"><input name="webkeyword<%= LanguageTxt(LangT) %>" value="<%= webkeyword %>" type="text" class="form" size="78"></td>
</tr>
<tr class="classrow">
   <td height="30" class="classrow"><%=Lang_sys(76)%></td>
   <td class="classrow"><input name="webdescription<%= LanguageTxt(LangT) %>" value="<%= webdescription %>" type="text" class="form" size="78"></td>
</tr>
<%If LangT = 1 Then%>
<tr><td height="30" class="classtop" colspan="2"><%=Lang_Product(63)%></td></tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(64)%></td>
<td class="classrow">
<input name="p_filename" id="p_filename" value="" type="text" maxlength="250" class="form" size="40"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(67)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" id="CopyName" value="1" > <%=Lang_Product(65)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" id="CopyNameToPinYin" value="1" > <%=Lang_Product(66)%>
</td>
</tr>
<%End If%>
	</table>
	</div>
	<script type="text/javascript">tdshow("seo_<%= LangT %>");</script>
<%Next%>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="mainbody-block">
<div class="mainbody-block2">
<table cellspacing="0" cellpadding="0" width="100%" border="0" id="remark" class="classtable">
<tr><td height="30" class="classtop" colspan="2"><%=Lang_Product(224)%></td></tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow" valign="top"><%=Lang_sys(96)%><br /><em>≤ <span id="r_remLen">255</span></em></td>
<td class="classrow"><textarea wrap="r_physical" name="p_remark" id="p_remark" rows="3" cols="60" onKeyDown="r_checkMaxInput(this.form)" onKeyUp="r_checkMaxInput(this.form)" class="text"><%= p_remark %></textarea>
<br /><a href="javascript:u_Size(-5,'p_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
<a href="javascript:u_Size(5,'p_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
</td>
</tr>
<tr>
<td height="30" align="left" class="classfooter">
<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" onclick="reset();return false;" align="absmiddle" title=" <%=Lang_sys(2)%> ">
<input type="hidden" name="action" value="add">
<input type="hidden" name="sort_id" value="<%=sort_id%>">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="ref" value=<%=request("ref")%>>
</td>
<td align="right" class="classfooter">
<%=Lang_Product(68)%>
<input type="radio" name="backtype" value="1" <%=judge(backtype,1)%>> <%=Lang_Product(69)%>
<input type="radio" name="backtype" value="2" <%=judge(backtype,2)%>> <%=Lang_Product(70)%>
<input type="radio" name="backtype" value="3" <%=judge(backtype,3)%>> <%=Lang_Product(71)%>
</td>
</tr>
</form>
</table>
<script type="text/javascript">
var r_maxLen = 255;
var p_remark = document.getElementById("p_remark");
function r_checkMaxInput(form) {
if (p_remark.value.length > r_maxLen)
p_remark.value = p_remark.value.substring(0, r_maxLen);
else document.getElementById("r_remLen").innerHTML = r_maxLen - p_remark.value.length;
}
showtabcontent("tablist");showtabcontent("tablist2");tdshow("add_other");tdshow("remark");</script>
<%
end sub
rem	<-{  会员组价格设置 2008-2-25  by 56770.WangLei
Sub setUsersPrice(pid)
%>
<SCRIPT language="JavaScript">
/********WangLei 2008-2-23********/
//	会员组价格设置
var uGradeArr = new Array();
<%
if pid = 0 then
sql="select grade_dj,discount,price_txt,id from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj"
else
sql="select g.grade_dj,discount,g.price_txt,p.price from [Lebi_user_grade] as g Left Join (Select price,grade_id from [Lebi_product_price] where product_id = "&pid&") as p on p.grade_id=g.grade_dj where grade_dj <> 0 order by g.grade_dj"
end if
set rs_up = conn.execute(sql)
j = 0
do while not rs_up.eof
%>
	var tArr = new Array();
	tArr[0] = "<%=rs_up(0)%>";
	tArr[1] = "<%=rs_up(1)%>";
	tArr[2] = "<%=rs_up(2)%>";
	tArr[3] = "<%=rs_up(3)%>";
	uGradeArr[<%=j%>] = tArr;
<%
	j = j+1
	rs_up.movenext
Loop
rs_up.close:Set rs_up = Nothing
%>
function setPrice()
{
	var s='';
	for(var i = 0; i < uGradeArr.length; i++)
	{
		if (i==5) s = s + "<br />&nbsp;&nbsp;";
		s = s + uGradeArr[i][2]+'：';
		s = s + '<input type="text" name="u_price" id="u_price_'+i+'" size="6" maxlength="10" value="<%If pid <> 0 Then%>'+uGradeArr[i][3]+'<%End If%>" class="form" onkeyup="value=value.replace(\/[^\\d\\.]\/g,\'\');">&nbsp;<span id="mes_u_price_'+i+'"></span>&nbsp;';
	}
	document.write(s);
}
function marketPriceSetted()	// 按市场价计算会员组价格
{
	var s_price = document.forms['addproduct'].elements['sprice'].value;
	if (s_price=="")
	{
		alert("<%=Lang_Product(4)%>");
		document.forms['addproduct'].elements['sprice'].focus();
		return false;
	}
	if (document.forms['addproduct'].elements['u_price'] != undefined)
	{
		var obj = document.forms['addproduct'].elements['u_price'];
		if (uGradeArr.length == obj.length)
		{
			for(var i = 0; i < uGradeArr.length; i++)
			{
				obj[i].value = (s_price * uGradeArr[i][1]).toFixed(2);
			}
		}
	}else
	{
		alert('<%=Lang_Product(72)%>');
		return false;
	}
}
</script>
<%
End Sub
rem	}->
rem	<-{  将会员组价格插入产品价格表 2008-2-26  by 56770.WangLei
Sub insertUsersPrice(pid,price_str,grade_str)
	pArr = Split(price_str,",")
	gArr = Split(grade_str,",")
	If ubound(pArr) = ubound(gArr) Then
		for j=0 to ubound(pArr)
			If Trim(gArr(j)) <> "" And Trim(pArr(j)) <> "" Then
				conn.execute("insert into [Lebi_product_price] (product_id,grade_id,price)values("&pid&","&gArr(j)&","&pArr(j)&")")
			End If
		Next
	End If
End Sub
rem	}->
%>