<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/lebi_config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_product_unite.asp
'* 最后更新 2013-03-03 by 56770.kingdge
'*****************************************
Dim admin_flag
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_product.inc"
include "lang/"& LangFilePath &"/lang_upfile.inc"
CurrentId = 1
CurrentUrl = "admin_product_unite.asp"
LB_Head()
LB_Menu()
id = checknum(request("id"),0)
%>
<div class="tabmenu mainwidth">
      <ul>
        <li <%If request("action") <> "add" Then Response.Write("class=""current""") End If%>><a href="admin_product_unite.asp"><span><%=Lang_Menu(53)%></span></a></li>
        <li <%If request("action") = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%
If id<>0 Then
	response.write Lang_Product(77)
Else
	response.write Lang_Product(129)
End if%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If OutSubmit = 1 Then CheckOutSubmit()
Select Case request("action")
	   Case "add_ok" : add_ok()
	   Case "del" : del()
	   Case "getSelectProduct" : getSelectProduct()
	   Case "add" : add()
	   Case "pytj" : pytj()
	   Case "changestate" : changestate()
	   Case "updateOrder" : updateOrder()
	   Case Else
			productlist()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_ok
        If OnlyRead = 1 Then OnlyReadMessage()
        bianhao1=Right(Year(date),2) & Month(date) & Day(date)
        bianhao = safereplace(request("bianhao"))
        sprice = CheckNum(request("sprice"),0)
        cprice = CheckNum(request("cprice"),0)
        '增加单个商品积分
        p_jifen = CheckNum(request("p_jifen"),0)
        pic = Safereplace(request("pic"))
		'cpic = pic
        if pic="" then pic="noimages.gif"
        cpic = Safereplace(request("cpic"))
        if cpic="" then cpic="nonegif.gif"
        zhuangtai = CheckNum(request("zhuangtai"),0)
        '新增推荐时间和特价时间   by kingdge Lebi.com  2005-10-17
        'p_cx_sj=Safereplace(trim(request("p_cx_sj")))
        'If p_cx_sj="" Then p_cx_sj="0"
        'p_stj_sj=Safereplace(trim(request("p_stj_sj")))
        'If p_stj_sj="" Then p_stj_sj="0"
        p_ytj_sj = CheckNum(request("p_ytj_sj"),0)
        ytj = CheckNum(request("ytj"),0)
		rem 增加商品重量 用于计算配送费用 2006-5-4 by 56770.kingdge
		p_weight = CheckNum(request("p_weight"),0)
		kucun = CheckNum(request("kucun"),0)
		p_filename = Left(Replace(Replace(Replace(Replace(Replace(safereplace(request("p_filename"))," ",""),"/",""),"\",""),"?",""),"|",""),250)
        '结束检验，添加商品
		If id <> 0 Then
				admin_flag=",2.5,"
				if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
						adminflag()
				End If
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select * from [Lebi_product_unite] where id="& id, conn, 1, 3
				If Not  rs.eof then
						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))=Left(Replace(request("details" & LanguageTxt(LangT)),"'","&#180;"),200)
								End If
								rs("briefed" & LanguageTxt(LangT))=Replace(request("briefed" & LanguageTxt(LangT)),"'","&#180;")
								rs("webhead" & LanguageTxt(LangT))=safereplace(request("webtitle" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webkeyword" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webdescription" & LanguageTxt(LangT)))
						Next
						rs("sprice")=sprice
						rs("cprice")=cprice
						rs("bianhao") = CheckBianhao(bianhao,id,1,1)
						rs("pic")=pic
						rs("cpic")=cpic
						rs("zhuangtai")=zhuangtai
						rs("p_jifen")=p_jifen
						rs("ytj")=ytj
						rs("p_ytj_sj")=p_ytj_sj
						rs("p_weight")=p_weight
						rs("product_unite_info") = safereplace(request("productUniteStr"))
						rs("kucun") = kucun
						rs("p_filename") = p_filename
						If request("up_sj")="0" Then rs("sj") = Now()
						rs.update
				End If
				rs.close:Set rs = Nothing
				If p_filename = "" Then conn.execute ("update [lebi_product_unite] set p_filename='"& id &"' where id=" & id&"")
				ManageLog Lang_Product(125) &" ["&id&"]"
				Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,CheckUrl(request("ref")),0,0,2,1)
		Else
				admin_flag=",2.4,"
				if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
						adminflag()
				End If
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select * from [Lebi_product_unite]", 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("briefed" & LanguageTxt(LangT))=Replace(request("briefed" & LanguageTxt(LangT)),"'","&#180;")
						rs("webhead" & LanguageTxt(LangT))=safereplace(request("webtitle" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webkeyword" & LanguageTxt(LangT)))&"$$$"&safereplace(request("webdescription" & LanguageTxt(LangT)))
				Next
				rs("bianhao")=CheckBianhao(bianhao,0,0,1)
				rs("sprice")=sprice
				rs("cprice")=cprice
				rs("pic")=pic
				rs("cpic")=cpic
				rs("zhuangtai")=1
				rs("p_jifen")=p_jifen
				rs("p_ytj_sj")=p_ytj_sj
				rs("ytj")=ytj
				rs("p_weight")=p_weight
				rs("sj") = Now()
				rs("buys") = 0
				rs("views") = 0
				rs("html") = 0
				rs("product_unite_info") = safereplace(request("productUniteStr"))
				rs("kucun") = kucun
				rs("p_filename") = p_filename
				rs.update
				rs.close : Set rs = Nothing
				'取得添加商品ID
				set rs=conn.execute("select top 1 id from [Lebi_product_unite] order by id desc")
				id=rs(0)
				rs.close:set rs=Nothing
				If bianhao = "" Then conn.execute ("update [lebi_product_unite] set bianhao='"& bianhao1 & id &"' where id=" & id&"")
				If p_filename = "" Then conn.execute ("update [lebi_product_unite] set p_filename='"& id &"' where id=" & id&"")
				ManageLog Lang_Product(126) &" ["& product_name &"]"
				Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),0,CheckUrl(request("ref")),0,0,2,1)
		End If
End Sub

Sub add
If id <> 0 Then
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		sql = "select * from [Lebi_product_unite] where id = "& id
		set Rs = conn.execute(Sql)
		If not rs.eof Then
				sprice = rs("sprice")
				cprice = rs("cprice")
				bianhao = rs("bianhao")
				p_weight = rs("p_weight")
				p_jifen = rs("p_jifen")
				ytj = rs("ytj")
				p_ytj_sj = rs("p_ytj_sj")
				pic = rs("pic")
				cpic = rs("cpic")
				productUniteStr = Trim(rs("product_unite_info"))
				zhuangtai = rs("zhuangtai")
				kucun = rs("kucun")
				p_filename = rs("p_filename")
				sj = rs("sj")
		End If
		rs.close:set rs=nothing
Else
		admin_flag=",2.4,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		sprice = "0.1"
		p_weight = "0"
		p_ytj_sj = "0"
		p_jifen = 0
		zhuangtai = 1
		webhead = "$$$$$$$$$"
		kucun = "100"
End If
%>
<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');
	if (iscopy.checked){
	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(127)%>');return false;}
	if (CheckEmpty('cprice')){ShowMessage('cprice','<%=Lang_Product(128)%>');return false;}
	if (CheckEmpty('pic')){ShowMessage('pic','<%=Lang_Product(7)%>');return false;}
	if (CheckEmpty('cpic')){ShowMessage('cpic','<%=Lang_Product(8)%>');return false;}
	if (!getSubmitUniteStr())
	{
		return false;
	}
}
</script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form action="?action=add_ok" 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="reset();return false;" align="absmiddle"><INPUT TYPE="hidden" NAME="id" value="<%=id%>"><input type="hidden" name="ref" value="<%=request("ref")%>"></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(77)
Else
	response.write Lang_Product(129)
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 %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%
For LangT = 1 To TotalLang
If id <> 0 Then
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		sql = "select product_name"& LanguageTxt(LangT)&",briefed"& LanguageTxt(LangT)&",details"& LanguageTxt(LangT)&",webhead"& LanguageTxt(LangT)&" from [Lebi_product_unite] where id = "& id
		set Rs = conn.execute(Sql)
		If not rs.eof Then
				product_name = rs(0)
				briefed = rs(1)
				details = rs(2)
				webhead = rs(3)
		End If
		If instr(webhead,"$$$") = 0 Or IsNull(webhead) Then webhead = "$$$$$$$$$"
		rs.close:set rs=Nothing
End If
%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_<%= LangT %>">
<tr valign="middle" class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Product(16)%></td>
<td class="classrow"><input type="text" id="product_name<%= LanguageTxt(LangT) %>" name="product_name<%= LanguageTxt(LangT) %>" size="55" class="form" value="<%= product_name %>"> <span id="mes_product_name<%= LanguageTxt(LangT) %>"></span></td>
</tr>
<tr valign="middle" class="classrow">
<td height="30" class="classrow" valign="top"><%=Lang_Product(17)%><br /><em>≤ <span id="remLen<%= LanguageTxt(LangT) %>">200</span></em></td>
<td colspan="4" class="classrow"><textarea wrap="physical" name="briefed<%= LanguageTxt(LangT) %>" rows="4" 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 valign="middle" class="classrow">
      <td 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="4" class="classrow">
<textarea name="details<%= LanguageTxt(LangT) %>" id="details<%= LanguageTxt(LangT) %>" rows="12" cols="80" class="text"><%= details %></textarea>
<span id="btn_showFCK<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="showFCK<%= LanguageTxt(LangT) %>()" 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>
   <td height="30" class="classtop" colspan="2"><%=Lang_sys(73)%></td>
 </tr>
<tr class="classrow">
   <td height="30" class="classrow"><%=Lang_sys(74)%></td>
   <td height="30" colspan="4" class="classrow"><input name="webtitle<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(0)%>" class="form" size="90"></td>
</tr>
<tr class="classrow">
   <td height="30" class="classrow"><%=Lang_sys(75)%></td>
   <td height="30" colspan="4" class="classrow"><input name="webkeyword<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(1)%>" class="form" size="90"></td>
</tr>
<tr class="classrow">
   <td height="30" class="classrow"><%=Lang_sys(76)%></td>
   <td height="30" colspan="4" class="classrow"><input name="webdescription<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(2)%>" class="form" size="90"></td>
</tr>
	</table>
	</div>
	<script type="text/javascript">tdshow("add_<%= LangT %>");</script>
<%Next%>
</div>
<script type="text/javascript">showtabcontent("tablist")</script>
<ul id="tablistmain">
   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
</ul>
<div id="tabcontentcontainer">
<table cellspacing="0" cellpadding="4" width="100%" border="0" id="add_other">
<tr valign="middle" class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Product(21)%></td>
<td 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(26)%></td>
  <td class="classrow"><%=Lang_Product(28)%> <input type="checkbox" name="ytj" value="1" <%If ytj="1" Then response.write"checked"%>>&nbsp;<%=Lang_Product(29)%><input type="text" name="p_ytj_sj" style="width:30px;" class="form" value="<%=p_ytj_sj%>" onkeyup="value=value.replace(/[^\d]/g,'');"></td></tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(37)%></td>
<td colspan="3" class="classrow"><input type="text" name="kucun" size="5" maxlength="10" value="<%=kucun%>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');">
</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();" /></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" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(44)%>','50','up');" onmouseout="hidehintinfo();" /></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="<%=sj%>" class="calendar" onclick="setday(this)">
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(74)%></td>
<td colspan="2" class="classrow"><%=Lang_Product(75)%> <input type="checkbox" name="zhuangtai" value="1" <%=judge(zhuangtai,"1")%>>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Product(130)%></td>
<td class="classrow"><%=Lang_Product(131)%><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>
&nbsp;&nbsp;&nbsp;&nbsp;<%=Lang_Product(132)%><input type="text" id="cprice" name="cprice" size="6" maxlength="10" value="<%=cprice%>" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(133)%>','50','up');" onmouseout="hidehintinfo();" /> <span id="mes_cprice"></span>
</tr>
<tr class="classrow">
  <td height="30" class="classrow"><%=Lang_Product(53)%></td>
  <td class="classrow">
	  <table cellspacing="0" cellpadding="0"><tr><td><input type="text" id="pic" name="pic" size="25" class="form" value="<%=pic%>"></td>
		<td width="5"></td>
		<td><IFRAME src="upfile/upload.asp?u_type=0" frameBorder=0 width="300" height="23" scrolling=no></IFRAME><img src="images/help.gif" onmouseover="showhintinfo(this,0,0,'','<%=Lang_Product(55)%>','50','up');" onmouseout="hidehintinfo();" /> <span id="mes_pic"></span></td>
		</tr>
		</table>
</tr>
<tr class="classrow">
  <td height="30" class="classrow"><%=Lang_Product(56)%></td>
  <td class="classrow"><textarea id="cpic" name="cpic" rows="3" cols="43" class="text"><%=cpic%></textarea>
	<IFRAME src="upfile/upload.asp?u_type=1" frameBorder=0 width="280" height="52" scrolling=no></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>
  </tr>
  </table>
<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
<tr><td height="30" class="classtop" colspan="3"><%=Lang_Product(138)%></td></tr>
<tr valign="middle" class="classrow">
<td height="30" class="classrow" colspan="3">
			<select id="s_sort_id" name="s_sort_id" class="select">
			<option value="0" selected>┌ <%=Lang_Product(85)%></option>
			<%
			sort (0),ii,sort_id
			ii = 0
			%>
			</select>
			<input type="text" name="s_keywords" id="s_keywords" class="form_query" size="20"><input name="Submit" type="button" onClick="ajaxSub(0,'ajax_data.asp?action=search&s_keywords='+ escape(document.getElementById('s_keywords').value) +'&s_sort_id=' + document.getElementById('s_sort_id').options[document.getElementById('s_sort_id').selectedIndex].value);return false;" value="" class="btn_query" align="absmiddle"> <span id="mes_n_product"></span>
			</td>
			</tr>
		<tr>
			<td width="310" height="180" align="center">
			<span id="test1">
				<select multiple size="10" id="temp_product" name="temp_product" class="select" style="width:300px;">
					<option value="">┌ <%=Lang_Product(134)%></option>
				</select>
			</span>	</td>
			<td align="center" width="60">
				<input type="button" onClick="move(document.getElementById('get_product'),document.getElementById('temp_product'))" value="<%=Lang_Product(135)%>" class="button"><br /><br />
				<input type="button" onClick="move(document.getElementById('temp_product'),document.getElementById('get_product'))" value="<%=Lang_Product(136)%>" class="button"><br /><br />
<input type="button" name="S2" onclick="ajaxSub(1,'Admin_Product_unite.asp?action=getSelectProduct&n_product='+document.getElementById('n_product').value);" value="<%=Lang_Product(137)%>" class="button" /></td>
			<td>
				<input type="hidden" id="n_product" name="n_product" value="0">
				<select multiple size="10" id="get_product" name="get_product" style="width:300px;">
				</select></td>
		</tr>
<td class="classrow" colspan="3"><INPUT TYPE="hidden" NAME="productUniteStr" id="productUniteStr" value="<%=productUniteStr%>">
	<table border="0" width="660" id="tableUP" class="tablelist">
		<tr>
			<td class="listhead"><%=Lang_Product(102)%></td>
			<td class="listhead"><%=Lang_Product(101)%></td>
			<td class="listhead"><%=Lang_Product(139)%></td>
			<td class="listhead"><%=Lang_Product(140)%></td>
			<td class="listhead"><%=Lang_sys(15)%></td>
		</tr>
	</table>
	</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
<tr><td height="30" class="classtop" colspan="2"><%=Lang_Product(63)%></td></tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Product(64)%></td>
<td class="classrow">
<input name="p_filename" id="p_filename" value="<%=p_filename%>" type="text" maxlength="250" class="form" size="50"> <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" value="1" > <%=Lang_Product(65)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" value="1" > <%=Lang_Product(66)%>
</td>
</tr>
</table>
</div>
<script type="text/javascript">tdshow("add_other");</script>
</td>
</tr>
<tr align="middle">
<td height="30" align="left" colspan="2" 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" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
</tr>
</form>
</table>
<script language="javascript">
//window.onload=function(){
//    window.frames["ifrPic"].document.getElementsByName("Ifbigpic")[0].disabled = true;
//}
getUniteProduct_re("<%=productUniteStr%>");
</script>
<%
	'response.write("<script language=""JavaScript"">getUniteProduct_re('"&productUniteStr&"');</script>")
end Sub

Sub del
        If OnlyRead = 1 Then OnlyReadMessage()
        on error resume next
		admin_flag=",2.6,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		id = safereplace(request("id"))
		if id="" then
				response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
				response.end
		end if
		sql="select id,pic,cpic from [Lebi_product_unite] where id in ("&id&") "
		set rs=conn.execute(sql)
		If Not rs.eof Then
				Do While Not rs.eof
				cpic=LCase(Trim(rs("cpic")))
				pic=LCase(Trim(rs("pic")))
				filepath_pic="../"& PicPath &"/"&pic
				path_pic=server.MapPath(filepath_pic)
				set objfso = server.createobject("scripting.FileSystemObject")
				If (pic<>"noimages.gif" And pic<>"nonegif.gif") And objfso.FileExists(path_pic) then
						objfso.DeleteFile(path_pic)
				End If
				If cpic<>"nonegif.gif" And cpic<>"noimages.gif" Then
						If InStr(cpic,"@@")>0 Then
								str_cpic=Split(cpic,"@@")
								For i = 0 To UBound(str_cpic)
										filepath_cpic="../"& PicPath &"/"&str_cpic(i)
										path_cpic= server.MapPath(filepath_cpic)
										If Trim(str_cpic(i))<>"nonegif.gif" And Trim(str_cpic(i))<>"noimages.gif" And objfso.FileExists(path_cpic) Then
												objfso.DeleteFile(path_cpic)
										End If
								Next
						Else
								filepath_cpic="../"& PicPath &"/"&cpic
								path_cpic= server.MapPath(filepath_cpic)
								If cpic<>"nonegif.gif" And cpic<>"noimages.gif" And objfso.FileExists(path_cpic) Then
										objfso.DeleteFile(path_cpic)
								End If
						End If
				End If
				set objfso = Nothing
				conn.execute "delete from [Lebi_product_unite] where id="&rs("id")&""
				'conn.execute "delete from [Lebi_dvote] where downid="&rs("id")&""
				rem 删除商品时删除收藏夹内的商品 2006-1-2 Lebi.kingdge
				'conn.execute "delete from [Lebi_action] where id="&rs("id")&""
				rs.movenext
				Loop
		End If
		rs.close:Set rs=Nothing
		ManageLog Lang_Product(141) &" ["&id&"]"
		m_u="?page="& request("page") &"&state="& request("state") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo") &"&pagenum="& request("pagenum") &"&lang="& request("lang")
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
End Sub

Sub updateOrder
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		id = safereplace(request("id"))
		p_order = safereplace(request("p_order"))
		If Right(id,1) = "," Then id = id&"0"
		If Right(p_order,1) = "," Then p_order = p_order&"0"
		debug p_order,1
		if id="" then
				response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(70) &"');javascript:history.go(-1)</SCRIPT>"
				response.end
		end If
		Dim idArr:idArr = Split(id,",")
		Dim orderArr:orderArr = Split(p_order,",")
		If ubound(idArr) = 0 Then
				conn.execute("update [Lebi_product_unite] set p_order = "& p_order &" where id ="& id)
		Else
				for i=0 to ubound(idArr)
						conn.execute("update [Lebi_product_unite] set p_order = "&orderArr(i)&" where id ="&idArr(i))
				Next
		End If
		ManageLog Lang_Product(142)
		url="?page=" & request("page")& "&zhuangtai=" & request("zhuangtai")
		response.redirect url
End Sub

Sub productlist
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		state = safereplace(request("state"))
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		datefrom=safeReplace(request("datefrom"))
		dateto=safeReplace(request("dateto"))
		keyword=safereplace(Trim(request("keyword")))
		lang = safereplace(request("lang"))
		If lang = "" Then lang = LanguageTxt(0)
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=0
		.Pkey="id"
		.Field="id,bianhao,product_name"& lang &",sprice,cprice,ytj,buys,views,pic,zhuangtai,p_order,kucun,cpic"
		.Table="[Lebi_product_unite]"
		sql = "1=1"
        if keyword<>"" then sql=sql + " and (product_name"& lang &" like '%"&keyword&"%' or bianhao like '%"&keyword&"%')"
		If state<>"" Then sql=sql&" and zhuangtai="& CLng(state)
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,sj,'"& datefrom &"')<=0 and DateDiff(d,sj,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',sj,'"& datefrom &"')<=0 and DateDiff('d',sj,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="p_order desc,id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" type="text/javascript" src="inc/js/js_link.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/lightbox/jquery.colorbox-min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){$("a[rel^='colorbox']").colorbox({title:"<%=Lang_Upfile(21)%>",slideshow:true,slideshowAuto:false,previous:"<%=Lang_Upfile(22)%>",next:"<%=Lang_Upfile(23)%>",close:"<%=Lang_Upfile(24)%>",slideshowStart:"<%=Lang_Upfile(25)%>",slideshowStop:"<%=Lang_Upfile(26)%>",current:"({total}/{current})"});});
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form name="Lebi" method="get" action="?">
<td height="30" align="left" colspan="5" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="lang">
<option value="" selected>┌ <%=Lang_sys(67)%></option>
<%For LangT = 1 To TotalLang%>
<option value="<%= LanguageTxt(LangT) %>"<%=judge2(LanguageTxt(LangT),Lang)%>>├ <%= LanguageName(LangT) %></option>
<%Next%>
</select>
<select name="state">
<option value="">┌ <%=Lang_Product(86)%></option>
<option value="0"<%=judge2(state,0)%>>├ <%=Lang_Product(76)%></option>
<option value="1"<%=judge2(state,1)%>>├ <%=Lang_Product(75)%></option>
</select>
</td>
<td style="padding-left:5px;">
<input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" />
</td>
<td style="padding-left:5px;">
<input name="keyword" id="keyword" type="text" value="<%=keyword%>" class="form_query" size="15" autocomplete="off" onkeyup="search_suggest('keyword','Lebi_product_unite','<%=lang%>')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>"><br /><div id="search_suggest_keyword" class="search_suggest" style="display:none"></div>
</td>
</tr>
</table>
</td>
</form>
<td align="right" colspan="8" class="classhead">
<!--<input type="image" border="0" title=" 更新排序 " onclick="toUpdateOrder();" src="lang/<%=LangFilePath%>/images/bt_update.gif" align="absmiddle">&nbsp;-->
<%=QuickMenu("Admin_product_csv.asp|"& Lang_Menu(70) &"","Admin_score.asp|"& Lang_Menu(72) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable2">
<thead>
<tr>
<td height="30" align="left" colspan="3" class="classhead">
<form action="?" method="post">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="hidden" name="action" value="del">
<INPUT TYPE="hidden" NAME="page" value="<%=cstr(page)%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="Lang" value="<%=Lang%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
<td height="30" align="right" colspan="10" class="classhead"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td class="classtop" height="30" width="4%" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td class="classtop" width="12%"><%=Lang_Product(102)%></td>
<td class="classtop" width="21%"><%=Lang_Product(101)%></td>
<td class="classtop" width="5%"><%=Lang_Product(100)%></td>
<td class="classtop" width="8%"><%=Lang_Product(143)%></td>
<td class="classtop" width="8%"><%=Lang_Product(144)%></td>
<td class="classtop" width="6%"><%=Lang_Product(28)%></td>
<td class="classtop" width="6%"><%=Lang_Product(86)%></td>
<td class="classtop" width="6%"><%=Lang_Product(104)%></td>
<td class="classtop" width="5%"><%=Lang_Product(118)%></td>
<td class="classtop" width="6%"><%=Lang_Product(121)%></td>
<td class="classtop" width="6%"><%=Lang_Product(122)%></td>
<td class="classtop" width="5%"><%=Lang_Product(105)%></td>
</tr>
</thead>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
		cpic = DataList(12,i)
		picarr = ""
		If Left(cpic,2) <> "@@" And Trim(cpic) <> "" Then cpic = "@@"& cpic
		If UBound(Split(cpic,"@@")) > 1 Then 
			For c = 2 To UBound(Split(cpic,"@@"))
				picarr = picarr &"<a href=""../"& PicPath &"/"& Split(cpic,"@@")(c) &""" rel=""colorbox"& DataList(0,i) &"""></a>"
			Next 
		End If 
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>" title="ID:<%=DataList(0,i)%>"></td>
<td class="classrow"><%=DataList(1,i)%></td>
<td class="classrow"><%=DataList(2,i)%></td>
<td class="classrow"><a href="../<%= PicPath %>/<%=Split(cpic,"@@")(1)%>" rel="colorbox<%=DataList(0,i)%>" target="_blank" title="<%=Lang_Upfile(21)%>"><img src='images/img.gif' align='absmiddle' onMouseover="javascript:ddrivetip('<img src=../<%= PicPath %>/<%=trim(DataList(8,i))%> width=<%=Upload_SPicWidth%>>', '#ffffff', '<%=Upload_SPicWidth%>')" onMouseout="hideddrivetip()"></a><%=picarr%></td>
<td class="classrow"><%=formatnumber2(DataList(4,i))%></td>
<td class="classrow"><%=formatnumber2(DataList(3,i))%></td>
<td class="classrow"><a href="?action=pytj&ytj=<%=DataList(5,i)%>&id=<%=DataList(0,i)%>&ref=<%=server.urlencode(backurl())%>" title="<%=Lang_Product(106)%>"><%if DataList(5,i)=1 then response.write"<font color=red>√</font>" else response.write"×" end if %></a></td>
<td class="classrow"><a href="?action=changestate&zhuangtai=<%=DataList(9,i)%>&id=<%=DataList(0,i)%>&ref=<%=server.urlencode(backurl())%>" title="<%=Lang_Product(106)%>"><%if DataList(9,i)=1 then response.write"<font color=red>"& Lang_Product(75) &"</font>" else response.write Lang_Product(76) end if %></a></td>
<td class="classrow"><%=DataList(11,i)%></td>
<td class="classrow"><%=DataList(10,i)%></td>
<td class="classrow"><%=DataList(6,i)%></td>
<td class="classrow"><%=DataList(7,i)%></td>
<td class="classrow"><a href="?action=add&id=<%=DataList(0,i)%>&ref=<%=server.urlencode(backurl())%>"><img src="images/icon_edit.gif" border="0" title="<%=Lang_sys(51)%>"></a>&nbsp;&nbsp;<a target="_blank" href="../unite/show/?id=<%=DataList(0,i)%>"><img src="images/icon_view.gif" border="0" title="<%=Lang_sys(59)%>" width="16" height="16" /></a></td>
</tr>
<%
        Next
End If
%>
</form>
<tfoot>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="13"><%=ors.ShowPageFoot(page)%></td>
</tr>
</tfoot>
</tbody>
</table>
<script type="text/javascript">tdshow("list");</script>
<%
end Sub

sub pytj
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		id = CheckNum(request("id"),0)
		ytj = CheckNum(request("ytj"),0)
		if ytj=1 then
				ytj=0
		else
				ytj=1
		end If
		conn.execute("Update [Lebi_product_unite] set ytj ="&ytj&" where id="&id&"")
		response.redirect CheckUrl(request("ref"))
		response.End
end sub

sub changestate()
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",2.5,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		id = CheckNum(request("id"),0)
		zhuangtai = CheckNum(request("zhuangtai"),0)
		if zhuangtai=1 then
				zhuangtai=0
		else
				zhuangtai=1
		end If
		conn.execute("Update [Lebi_product_unite] set zhuangtai ="& zhuangtai &" where id="&id&"")
		response.redirect CheckUrl(request("ref"))
		response.End
end sub

Sub getSelectProduct()
		n_product = Replace(safereplace(request("n_product"))," ","")
		If IsNull(n_product) Or IsEmpty(n_product) Then n_product = "0"
		If Right(n_product,1) = "," Then n_product = Left(n_product,Len(n_product)-1)
		sql = "select id,bianhao,product_name,sprice,p_weight from [Lebi_product] where id in ("&n_product&")"
		Set rs = conn.execute(sql)
		tstr = ""
		If Not (rs.eof And rs.bof) Then
				Do While Not rs.eof
					If tstr = "" Then
						tstr = "aa"&"||"&rs("id")&"||"&rs("bianhao")&"||"&rs("product_name")&"||"&rs("sprice")&"||"&rs("p_weight")&"||"&"bb"
					else
						tstr = tstr & "||||"&"aa"&"||"&rs("id")&"||"&rs("bianhao")&"||"&rs("product_name")&"||"&rs("sprice")&"||"&rs("p_weight")&"||"&"bb"
					End If
				rs.movenext
				Loop
		End If
		response.write(Trim(tstr))
		rs.close : Set rs= Nothing
End Sub
%>