<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/config.inc"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_brand.asp
'* 最后更新 2013-05-04 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",3.10,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_brand.inc"
CurrentId = 1
CurrentUrl = "admin_brand.asp"
LB_Head()
LB_Menu()
action = request("action")
%>
<div class="tabmenu mainwidth">
      <ul>
        <li <%If action <> "add" And action <> "updatenum" Then Response.Write("class=""current""") End If%>><a href="admin_brand.asp"><span><%=Lang_Menu(76)%></span></a></li>
        <li <%If action = "update" Or action = "updatenum" Then Response.Write("class=""current""") End If%>><a href="?action=updatenum"><span><%=Lang_brand(1)%></span></a></li>
        <li <%If action = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_brand(13)%></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 action
	           Case "add" : add()
		       Case "add_ok" : add_ok()
			   Case "update" : update()
			   Case "updatenum" : updatenum()
			   Case "edit" : edit()
			   Case "edit_ok" : edit_ok()
			   Case "del" : del()
			   Case Else
			        b_main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub updatenum()
        If OnlyRead = 1 Then OnlyReadMessage()
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select brand,b_pronum from [Lebi_brand]",conn,1,3
		do while not rs.eof
				num = checknum(conn.execute("select count(id) from [lebi_product] where brand = '"& rs(0) &"'")(0),0)
				rs(1) = num
				rs.update
		rs.movenext
		Loop
		rs.close : Set rs = Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_brand(1)
	    m_t=Lang_Menu(76)
	    m_s="·"& Lang_brand(2)
	    m_u="?zimu="& request("l_type") &"&sort_id="& request("sort_id") &"&keyword="& request("keyword") &"&lang="& request("lang") &"&pagenum="& request("pagenum") &"&page="& request("page")
	    m_time="2"
	    Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
End Sub

Sub update()
        If OnlyRead = 1 Then OnlyReadMessage()
		m_id=Replace(Safereplace(trim(request("m_id")))," ","")
		brand_w=Replace(Safereplace(trim(request("brand_w")))," ","")
		brand_pic=Replace(Safereplace(trim(request("brand_pic")))," ","")
		tj=Replace(Safereplace(trim(request("tj")))," ","")
		paixu=Replace(Safereplace(trim(request("paixu")))," ","")
		If UBound(Split(m_id,",")) = 0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_brand] where id=" &m_id, conn, 1, 3
                        rs("brand_w")=brand_w
                        rs("brand_pic")=brand_pic
                        rs("tj")=tj
                        rs("paixu")=checknum(paixu,0)
                rs.update
                rs.close:set rs=Nothing
		Else
		For i = 0 To UBound(Split(m_id,","))
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_brand] where id=" &Split(m_id,",")(i), conn, 1, 3
                        rs("brand_w")=Split(brand_w,",")(i)
                        rs("brand_pic")=Split(brand_pic,",")(i)
                        rs("tj")=Split(tj,",")(i)
                        rs("paixu")=checknum(Split(paixu,",")(i),0)
                rs.update
                rs.close:set rs=Nothing
		Next
		End If
		ManageLog Lang_brand(3)
	    m_t=Lang_Menu(76)
	    m_s="·"& Lang_brand(4)
	    m_u="?zimu="& request("l_type") &"&sort_id="& request("sort_id") &"&keyword="& request("keyword") &"&pagenum="& request("pagenum") &"&lang="& request("lang") &"&page="& request("page")
	    m_time="2"
	    Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
End Sub

Sub del
        If OnlyRead = 1 Then OnlyReadMessage()
        del_id= Replace(safereplace(Trim(request("id"))),"，",",")
		If Right(del_id,1) = "," Then del_id = Left(del_id,Len(del_id)-1)
        if del_id="" then
                response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                response.end
        end If
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select brand_pic from [Lebi_brand] where id in ("&del_id&")",conn,1,3
		Do While Not rs.eof 
				set objfso = server.createobject("scripting.FileSystemObject")
				If objfso.FileExists(server.MapPath("../"& rs(0))) Then
						objfso.DeleteFile(server.MapPath("../"& rs(0)))
				End If
				set objfso = Nothing
				rs.delete
				rs.update
		rs.movenext 
		Loop
		rs.close : Set rs = Nothing 
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_brand(5) & del_id
	    m_t=Lang_sys(43)
	    m_s="·"& Lang_sys(42)
	    m_u="?zimu="& request("l_type") &"&sort_id="& request("sort_id") &"&keyword="& request("keyword") &"&pagenum="& request("pagenum") &"&lang="& request("lang") &"&page="& request("page")
	    m_time="2"
	    Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
End Sub

Sub add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        brand=Safereplace(request("brand"))
        brand_w=left(ucase(Safereplace(request("brand_w"))),1)
        paixu=request("paixu")
		If Not IsNumeric(paixu) Then paixu=0
        brand_pic=Safereplace(request("brand_pic"))
        b_class = ","& replace(Safereplace(request("b_class"))," ","") &","
        tj=request("tj")
        if tj="1" then
                tj=1
        else
                tj=0
        end If
        If brand_w = "" Then
		        mes = mes &"<br>·"& Lang_brand(6) &""
				Is_error = 1
		End If
        If brand = "" Then
		        mes = mes &"<br>·"& Lang_brand(7) &""
				Is_error = 1
		End If
		If Is_error = 1 Then
				m_t=Lang_Menu(76)
				m_s=mes
				m_u="javascript:history.back()"
				m_time="2"
				Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,0)
		End If
        set rs=server.createobject("adodb.recordset")
        sql="select * from [Lebi_brand]"
        rs.open sql, conn, 1, 3
        rs.addnew
				For LangT = 1 To TotalLang
						rs("brand" & LanguageTxt(LangT))=Safereplace(request("brand" & LanguageTxt(LangT)))
						rs("b_content" & LanguageTxt(LangT))=Trim(replace(request("b_content" & LanguageTxt(LangT)),"'","&#180;"))
				Next
                rs("paixu")=paixu
                rs("brand_w")=brand_w
                rs("brand_pic")=brand_pic
                rs("tj")=tj
		        rs("b_class")=b_class
        rs.update
        rs.close:set rs=Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_brand(8) &" ["& brand &"]"
	    m_t=Lang_Menu(76)
	    m_s="·"& Lang_sys(44)
	    m_u="?"
	    m_time="2"
	    Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
End Sub

Sub edit_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        id = CLng(request("id"))
        brand=Safereplace(trim(request("brand")))
        brand_w=left(ucase(Safereplace(request("brand_w"))),1)
        paixu=request("paixu")
		If Not IsNumeric(paixu) Then paixu=0
        brand_pic=Safereplace(trim(request("brand_pic")))
        b_class = ","& replace(Safereplace(request("b_class"))," ","") &","
        tj=request("tj")
        if tj="1" then
                tj=1
        else
                tj=0
        end If
        If brand_w = "" Then
		        mes = mes &"<br>·"& Lang_brand(6) &""
				Is_error = 1
		End If
        If brand = "" Then
		        mes = mes &"<br>·"& Lang_brand(7) &""
				Is_error = 1
		End If
		If Is_error = 1 Then
				m_t=Lang_Menu(76)
				m_s=mes
				m_u="javascript:history.back()"
				m_time="2"
				Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,0)
		End If
        set rs=server.createobject("adodb.recordset")
        sql="select * from [Lebi_brand] where id = "& id &""
        rs.open sql, conn, 1, 3
				For LangT = 1 To TotalLang
						rs("brand" & LanguageTxt(LangT))=Safereplace(request("brand" & LanguageTxt(LangT)))
						rs("b_content" & LanguageTxt(LangT))=Trim(replace(request("b_content" & LanguageTxt(LangT)),"'","&#180;"))
				Next
                rs("paixu")=paixu
                rs("brand_w")=brand_w
                rs("brand_pic")=brand_pic
                rs("tj")=tj
		        rs("b_class")=b_class
        rs.update
        rs.close:set rs=Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_brand(9) &" ["& brand &"]"
	    m_t=Lang_sys(48)
	    m_s="·"& Lang_sys(47)
	    m_u="?"
	    m_time="2"
	    Call Up_mes(m_t,m_s,0,m_u,0,0,m_time,1)
End Sub

Sub add()
%>
<script type="text/javascript">
function CheckForm(theform)
{
	if (CheckEmpty('brand')){ShowMessage('brand','<%=Lang_brand(10)%>');return false;}
	if (CheckEmpty('brand_w')){ShowMessage('brand_w','<%=Lang_brand(11)%>');return false;}
}
</script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="Add_brand" method="post" action="?" onSubmit="return CheckForm(this);">
<tr>
	<td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="action" value="add_ok"></td>
	<td class="classhead" align="right"><%=QuickMenu("","")%></td>
 </tr>
<tr>
   <td colspan="2" class="classtop" height="30"><%=Lang_brand(13)%></td></tr>
<tr>
<td colspan="2" class="classbg">
<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%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_brand(14)%></td>
<td width="85%" class="classrow">
<input type="text" name="brand<%= LanguageTxt(LangT) %>" id="brand<%= LanguageTxt(LangT) %>" size="20" class="form"> <span id="mes_brand<%= LanguageTxt(LangT) %>"></span>
</td>
</tr>
<tr>
<td height="30" class="classrow" valign="top" style="padding-top:6px;"><%=Lang_brand(15)%><div class="autosave"><span id="timemsg<%= LanguageTxt(LangT) %>"></span><br /><span id="msg2<%= LanguageTxt(LangT) %>"></span><br /><span id="msg<%= LanguageTxt(LangT) %>"></span></div></td>
<td class="classrow">
<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('b_content<%= LanguageTxt(LangT) %>',{height:300});
}
</script>
<textarea name="b_content<%= LanguageTxt(LangT) %>" id="b_content<%= LanguageTxt(LangT) %>" rows="10" cols="80" class="text"></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,'b_content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'b_content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=brand<%= LanguageTxt(LangT) %>&Lang=<%= LanguageTxt(LangT) %>"></SCRIPT>
</td></tr>
	</table>
	</div>
	<script>tdshow("classtable_<%= LangT %>");</script>
<%Next%>
</div>
<script>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="classtable">
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_brand(16)%></td>
<td class="classrow">
<input name="brand_w" id="brand_w" type="text" size="5" maxlength="1" class="form"> <span id="mes_brand_w"></span>
</td>
<td width="25%" rowspan="4" class="classrow">
<div style="width:100%;border-left:#CCC 1px solid;background:#FAFAFA;text-align:center">
<%=Lang_brand(35)%> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_brand(36)%>','50','up');" onmouseout="hidehintinfo();" /><br /><select name="b_class" id="b_class" size="8" multiple="multiple" style="width:180px;height:80x;"><% check_sort (0),ii,",," %></select> <span id="mes_b_class"></span>
</div>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_brand(17)%></td>
<td class="classrow">
<input id="brand_pic" name="brand_pic" type="text" size="20" class="form"> <input type="button" id="Upload_brand_pic" name="Upload_brand_pic" value="<%=Lang_sys(52)%>" onclick="uploadpanel('Add_brand','brand_pic','brand')" class="btn_upload">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_brand(18)%></td>
<td class="classrow">
<input type="text" name="paixu" size="5" value="1" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_brand(19)%></td>
<td class="classrow">
<select name="tj">
<option value="0"><%=Lang_brand(20)%></option>
<option value="1"><%=Lang_brand(21)%></option>
</select>
</td>
</tr>
</table>
<script>tdshow("classtable");</script>
</div>
</td>
</tr>
<tr class="classfooter">
  <td height="30" colspan="2" align="left" class="classfooter"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
 </tr>
</form>
</table>
<%
End Sub

Sub b_main
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		sort_id = CheckNum(request("sort_id"),0)
		zimu = Safereplace(request("zimu"))
		keyword = Safereplace(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,brand_w,brand_pic,brand"& lang &",paixu,tj"
		.Table="[Lebi_brand]"
		sql = "1=1"
		If IsSqlDataBase = 1 And sort_id<>0 Then sql = sql&" and charindex(',"& sort_id &",',b_class)>0"
		If IsSqlDataBase = 0 And sort_id<>0 Then sql = sql&" and instr(b_class,',"& sort_id &",')>0"
		if zimu<>"" then sql=sql + " and brand_w ='"& zimu &"'"
		If keyword<>"" Then sql=sql + " and brand"& lang &" like '%"& keyword &"%'"
		.Condition=sql
		.OrderBy="paixu desc,id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/js_link.js"></script>
<script language="javascript" src="Upfile/js/Upload_Other.js"></script>
<script>
function todel()
{
	
   var i = 0;
   var chkArr = document.getElementsByTagName("input");
   var page = document.getElementById("page").value;
   var Lang = document.getElementById("Lang").value;
   var l_type = document.getElementById("l_type").value;
   var keyword = document.getElementById("keyword").value;
   var sort_id = document.getElementById("sort_id").value;
   var pagenum = document.getElementById("pagenum").value;
   var param = "";
   for (i=0;i<chkArr.length;i++)
   if (chkArr[i].checked)
   param+=chkArr[i].value +",";
   
   if (param.length == 0)
   {
       alert("<%=Lang_sys(41)%>");
   }else{
       if(window.confirm("<%=Lang_sys(64)%>")){
           document.location.href="?action=del&id="+param+"&keyword="+escape(keyword)+"&l_type="+escape(l_type)+"&Lang="+Lang+"&sort_id="+escape(sort_id)+"&pagenum="+pagenum+"&page="+page;
       }else return;
   }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tr>
<form method="get" name="forms" action="?">
<td height="30" align="left" 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="sort_id">
<option value="0" selected>┌ <%=Lang_brand(22)%></option>
<script src="../include/Lebi_Html/CategoryOption.js"></script>
</select>
<select name="zimu">
<option value="" selected>┌ <%=Lang_brand(23)%></option>
<option value="">├ <%=Lang_brand(24)%></option>
<option value="A" <%=judge2("A",zimu)%>>├ A</option>
<option value="B" <%=judge2("B",zimu)%>>├ B</option>
<option value="C" <%=judge2("C",zimu)%>>├ C</option>
<option value="D" <%=judge2("D",zimu)%>>├ D</option>
<option value="E" <%=judge2("E",zimu)%>>├ E</option>
<option value="F" <%=judge2("F",zimu)%>>├ F</option>
<option value="G" <%=judge2("G",zimu)%>>├ G</option>
<option value="H" <%=judge2("H",zimu)%>>├ H</option>
<option value="I" <%=judge2("I",zimu)%>>├ I</option>
<option value="J" <%=judge2("J",zimu)%>>├ J</option>
<option value="K" <%=judge2("K",zimu)%>>├ K</option>
<option value="L" <%=judge2("L",zimu)%>>├ L</option>
<option value="M" <%=judge2("M",zimu)%>>├ M</option>
<option value="N" <%=judge2("N",zimu)%>>├ N</option>
<option value="O" <%=judge2("O",zimu)%>>├ O</option>
<option value="P" <%=judge2("P",zimu)%>>├ P</option>
<option value="Q" <%=judge2("Q",zimu)%>>├ Q</option>
<option value="R" <%=judge2("R",zimu)%>>├ R</option>
<option value="S" <%=judge2("S",zimu)%>>├ S</option>
<option value="T" <%=judge2("T",zimu)%>>├ T</option>
<option value="U" <%=judge2("U",zimu)%>>├ U</option>
<option value="V" <%=judge2("V",zimu)%>>├ V</option>
<option value="W" <%=judge2("W",zimu)%>>├ W</option>
<option value="X" <%=judge2("X",zimu)%>>├ X</option>
<option value="Y" <%=judge2("Y",zimu)%>>├ Y</option>
<option value="Z" <%=judge2("Z",zimu)%>>├ Z</option>
</select>
</td>
<td style="padding-left:5px;">
<input name="keyword" id="keyword" type="text" class="form_query" size="15" autocomplete="off" onkeyup="search_suggest('keyword','Lebi_brand','<%=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>
<td height="30" align="right" class="classhead">
<%=QuickMenu("Admin_sort.asp|"& Lang_Menu(75) &"","Admin_selectvalue.asp|"& Lang_Menu(194) &"")%>
</td>
</tr>
</form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<form name="form1" method="post" action="?">
<tr>
	<td height="30" class="classhead" align="left" colspan="3">
     <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle">
     <input type="image" border="0" title=" <%=Lang_sys(15)%> " onclick="location.href='javascript:todel();';return false;" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
	 <input type="hidden" name="page" id="page" value="<%=page%>">
	 <input type="hidden" name="keyword" id="keyword" value="<%=keyword%>">
	 <input type="hidden" name="sort_id" id="sort_id" value="<%=sort_id%>">
	 <input type="hidden" name="l_type" id="l_type" value="<%=zimu%>">
	 <input type="hidden" name="Lang" id="Lang" value="<%=Lang%>">
	 <input type="hidden" name="pagenum" id="pagenum" value="<%= pagenum %>">
	 <input type="hidden" name="action" value="update">
    </td>
	<td height="30" class="classhead" align="right" colspan="4"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td width="5%" height="30" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:hand;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td width="30%" class="classtop"><%=Lang_brand(25)%></td>
<td width="8%" class="classtop"><%=Lang_brand(23)%></td>
<td width="35%" class="classtop"><%=Lang_brand(26)%></td>
<td width="8%" class="classtop"><%=Lang_brand(21)%></td>
<td width="8%" class="classtop"><%=Lang_brand(27)%></td>
<td width="6%" class="classtop"><%=Lang_brand(28)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>"><input name="m_id" type="hidden" value="<%=DataList(0,i)%>"></td>
<td class="classrow"><%=DataList(3,i)%></td>
<td class="classrow">
<input name="brand_w" type="text" size="1" maxlength="1" value=<%=DataList(1,i)%> class="form" style="width:40px;"></td>
<td class="classrow">
<img src='images/img.gif' align='absmiddle' onMouseover="javascript:ddrivetip('<img src=../<%=trim(DataList(2,i))%> height=30>', '#ffffff', '30')" onMouseout="hideddrivetip()">
<input name="brand_pic" id="brand_pic<%=DataList(0,i)%>" type="text" size="25" value="<%=trim(DataList(2,i))%>" class="form"> <input type="button" id="Upload_brand_pic<%=DataList(0,i)%>" name="Submit" value="<%=Lang_sys(52)%>" onclick="uploadpanel('form1','brand_pic<%=DataList(0,i)%>','brand')" class="btn_upload"></td>
<td class="classrow">
<select name="tj">
<option value="0"><%=Lang_brand(29)%></option>
<option value="1" style="color:#FF0000;" <%=judge2("1",DataList(5,i))%>><%=Lang_brand(30)%></option>
</select>
</td>
<td class="classrow"><input name="paixu" type="text" value="<%=DataList(4,i)%>" class="form" style="width:35px;"></td>
<td class="classrow">
<input type="image" title="<%=Lang_sys(51)%>" onclick="location.href='?action=edit&id=<%=DataList(0,i)%>&brand_name=<%=server.urlencode(trim(DataList(3,i)))%>&keyword=<%=server.urlencode(keyword)%>&zimu=<%=zimu%>&sortid=<%=sortid%>&page=<%=page%>';return false;" src="images/icon_edit.gif" align="absmiddle">
</td>
</tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="6"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tfoot>
<tr>
<td colspan="8" class="classfaq">
<div class="faq_main">
<p class="faq_title"><%=Lang_sys(49)%></p>
<%=Lang_brand(32)%>
<br><%=Lang_brand(33)%>
</div>
</td>
</tr>
</tfoot>
</table>
<script>tdshow("classtable");</script>
<%
End Sub

Sub edit()
		id = CLng(request("id"))
		Set rs = conn.execute("select * from [lebi_brand] where id = "& id &"")
		If Not rs.eof Then
%>
		<script type="text/javascript">
		function CheckForm(theform)
		{
			if (CheckEmpty('brand')){ShowMessage('brand','<%=Lang_brand(10)%>');return false;}
			if (CheckEmpty('brand_w')){ShowMessage('brand_w','<%=Lang_brand(11)%>');return false;}
		}
		</script>
		<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
		<script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
		<form name="Add_brand" method="post" action="?" onSubmit="return CheckForm(this);">
		<tr>
			<td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="id" value="<%= id %>"><input type="hidden" name="action" value="edit_ok"></td>
			<td class="classhead" align="right">
			<%=QuickMenu("","")%>
			</td>
		 </tr>
		<tr>
		   <td class="classtop" colspan="2" height="30"><%=Lang_brand(34)%></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%>
		   <div id="tcontent<%= LangT %>" class="tabcontent">
		   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
		<tr class="classrow">
		<td width="15%" height="30" class="classrow"><%=Lang_brand(14)%></td>
		<td width="85%" class="classrow">
		<input type="text" name="brand<%= LanguageTxt(LangT) %>" id="brand<%= LanguageTxt(LangT) %>" value="<%= rs("brand"& LanguageTxt(LangT)) %>" size="20" class="form"> <span id="mes_brand<%= LanguageTxt(LangT) %>"></span>
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow" valign="top" style="padding-top:6px;"><%=Lang_brand(15)%><div class="autosave"><span id="timemsg<%= LanguageTxt(LangT) %>"></span><br /><span id="msg2<%= LanguageTxt(LangT) %>"></span><br /><span id="msg<%= LanguageTxt(LangT) %>"></span></div></td>
		<td class="classrow">
		<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('b_content<%= LanguageTxt(LangT) %>',{height:300});
		}
		</script>
		<textarea name="b_content<%= LanguageTxt(LangT) %>" id="b_content<%= LanguageTxt(LangT) %>" rows="10" cols="80" class="text"><%= rs("b_content"& LanguageTxt(LangT)) %></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,'b_content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'b_content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
		<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
		<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=brand<%= LanguageTxt(LangT) %>&Lang=<%= LanguageTxt(LangT) %>"></SCRIPT>
		</td></tr>
			</table>
			</div>
			<script>tdshow("classtable_<%= LangT %>");</script>
		<%Next%>
		</div>
		<script>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="classtable">
		<tr class="classrow">
		<td width="15%" height="30" class="classrow"><%=Lang_brand(16)%></td>
		<td class="classrow">
		<input name="brand_w" id="brand_w" type="text" value="<%=rs("brand_w")%>" size="5" maxlength="1" class="form"> <span id="mes_brand_w"></span>
		</td>
		<td width="25%" rowspan="4" class="classrow">
		<div style="width:100%;border-left:#CCC 1px solid;background:#FAFAFA;text-align:center">
		<%=Lang_brand(35)%> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_brand(36)%>','50','up');" onmouseout="hidehintinfo();" /><br /><select name="b_class" id="b_class" size="8" multiple="multiple" style="width:180px;height:80x;"><% check_sort (0),ii,","& rs("b_class") &"," %></select> <span id="mes_b_class"></span>
		</div>
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_brand(17)%></td>
		<td class="classrow">
		<input id="brand_pic" name="brand_pic" type="text" value="<%=rs("brand_pic")%>" size="20" class="form"> <input type="button" id="Upload_brand_pic" name="Upload_brand_pic" value="<%=Lang_sys(52)%>" onclick="uploadpanel('Add_brand','brand_pic','brand')" class="btn_upload">
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_brand(18)%></td>
		<td class="classrow">
		<input type="text" name="paixu" size="5" value="<%=rs("paixu")%>" class="form">
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_brand(19)%></td>
		<td class="classrow">
		<select name="tj">
		<option value="0"><%=Lang_brand(20)%></option>
		<option value="1" <%If rs("tj") = "1" Then response.write(" selected") End If%>><%=Lang_brand(21)%></option>
		</select>
		</td>
		</tr>
		</table>
		</div>
		<script>tdshow("classtable");</script>
		</td>
		</tr>
		<tr class="classfooter">
		  <td height="30" colspan="2" align="left" class="classfooter"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
		 </tr>
		</form>
		</table>
<%
		End If
		rs.close : Set rs = Nothing
End Sub
 %>