<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_selectvalue.asp
'* 最后更新 2013-01-14 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",3.4,"
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_selectvalue.asp"
LB_Head()
LB_Menu()
action = request("action")
typeid = checknum(request("typeid"),0)
mode = checknum(request("mode"),0)
%>
<div class="tabmenu mainwidth">
      <ul>
		<li <%If action = "" Then response.write(" class=""current""") End If%>><a href="Admin_selectvalue.asp"><span><%=Lang_SelectValue(28)%></span></a></li>
		<li <%If InStr(action,"value") > 0 And InStr(action,"add_value") = 0 And InStr(action,"edit_value") = 0 And InStr(action,"edit_list_value") = 0 And mode = 0 Then response.write(" class=""current""") End If%>><a href="?action=value&typeid=<%=typeid%>&name=<%=server.urlencode(request("name"))%>&mode=0"><span><%=Lang_SelectValue(33)%></span></a></li>
		<li <%If InStr(action,"value") > 0 And InStr(action,"add_value") = 0 And InStr(action,"edit_value") = 0 And InStr(action,"edit_list_value") = 0 And mode = 2 Then response.write(" class=""current""") End If%>><a href="?action=value&typeid=<%=typeid%>&name=<%=server.urlencode(request("name"))%>&mode=2"><span><%=Lang_SelectValue(38)%></span></a></li>
		<li <%If InStr(action,"value") > 0 And InStr(action,"add_value") = 0 And InStr(action,"edit_value") = 0 And InStr(action,"edit_list_value") = 0 And mode = 1 Then response.write(" class=""current""") End If%>><a href="?action=value&typeid=<%=typeid%>&name=<%=server.urlencode(request("name"))%>&mode=1"><span><%=Lang_SelectValue(29)%></span></a></li>
		<%If InStr(action,"add_value") > 0 Then%><li class="current"><a href="#"><span><%
		If request("id") <> "" Then 
				response.write(Lang_SelectValue(35))
		Else
				response.write(Lang_SelectValue(6))
		End If 
		%></span></a></li><%End If%>
		<%If InStr(action,"edit_value") > 0 Then%><li class="current"><a href="#"><span><%=Lang_SelectValue(9)%></span></a></li><%End If%>
		<%If InStr(action,"edit_list_value") > 0 Then%><li class="current"><a href="#"><span><%=Lang_SelectValue(34)%></span></a></li><%End If%>
      </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 "del" : del()
			Case "update" : update()
			Case "add" : add()
			Case "add_ok" : add_ok()
			Case "edit" : edit()
			Case "edit_ok" : edit_ok()
			Case "del_value" : del_value()
			Case "update_value" : update_value()
			Case "add_value" : add_value()
			Case "add_value_ok" : add_value_ok()
			Case "edit_value" : edit_value()
			Case "edit_value_ok" : edit_value_ok()
			Case "list_value" : list_value()
			Case "del_list_value" : del_list_value()
			Case "edit_list_value" : edit_list_value()
			Case "edit_list_value_ok" : edit_list_value_ok()
			Case "update_list_value" : update_list_value()
			Case "value" : value()
			Case Else
				 main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_value_ok
		If OnlyRead = 1 Then OnlyReadMessage()
        s_type = checknum(request("s_type"),0)
        s_order = checknum(request("s_order"),0)
		id = checknum(request("id"),0)
		If id = 0 Then 
				sql = "select * from [Lebi_SelectName]"
				set rs = server.CreateObject("adodb.recordset")
				rs.Open sql, conn, 1, 3
				rs.AddNew
				For LangT = 1 To TotalLang
						rs("s_name" & LanguageTxt(LangT))=safereplace(request("s_name" & LanguageTxt(LangT)))
				Next
				rs("s_order")=s_order
				rs("s_mode")=mode
				rs("s_type")=s_type
				rs("typeid")=typeid
				rs.Update
				rs.Close : set rs=Nothing
				If s_type = 0 Then 
				Set rs = conn.execute("select s_id from [Lebi_SelectName] where s_name = '"& safereplace(request("s_name")) &"' and s_mode = "& mode &" and typeid = "& typeid &"")
				id = rs(0)
				rs.close : Set rs = Nothing 
				End If 
		End If 
		Arr_SelectValue = Split(Replace(Trim(request("s_value")),"'","&#180;"),Chr(13)&Chr(10))
		For ii = 0 To UBound(Arr_SelectValue)
			set rs = server.CreateObject("adodb.recordset")
			rs.Open "select * from [Lebi_SelectValue] where s_value = '"& Split(Replace(Trim(request("s_value")),"'","&#180;"),Chr(13)&Chr(10))(ii) &"' and s_mode = "& mode &" and typeid = "& typeid &"", conn, 1, 3
			If rs.eof Then 
					rs.AddNew
					rs("s_mode")=mode
					rs("typeid")=typeid
			End If 
			For LangT = 1 To TotalLang
					s_value = Replace(Trim(request("s_value" & LanguageTxt(LangT))),"'","&#180;")
					If s_value = "" Then s_value = Replace(Trim(request("s_value")),"'","&#180;")
					rs("s_value" & LanguageTxt(LangT))=Split(s_value,Chr(13)&Chr(10))(ii)
			Next
			rs("s_order")=UBound(Arr_SelectValue)+1-ii
			rs("s_id")=id
			rs("s_pic")=s_pic
			rs.Update
			rs.Close : set rs=Nothing
		Next 
		ManageLog Lang_SelectValue(1) &" ["& safereplace(request("s_name" & LanguageTxt(LangT))) &"]"
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),0,"?action=value&typeid="& request("type") &"&name="& server.urlencode(request("name")) &"&mode="& mode,0,0,2,1)
End Sub

Sub edit_value_ok
		If OnlyRead = 1 Then OnlyReadMessage()
		id = Safereplace(request("id"))
        s_type = checknum(request("s_type"),0)
        s_order = checknum(request("s_order"),0)
		s_typeid = checknum(request("s_typeid"),0)
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_SelectName] where s_id = "& id &"", conn, 1, 3
		For LangT = 1 To TotalLang
				rs("s_name" & LanguageTxt(LangT))=safereplace(request("s_name" & LanguageTxt(LangT)))
		Next
		rs("s_type")=s_type
        rs("s_order")=s_order
		rs("typeid")=s_typeid
        rs.Update
        rs.Close:set rs=Nothing
		conn.execute("update [Lebi_SelectValue] set typeid = "& s_typeid &" where s_id = "& id &"")
		ManageLog Lang_SelectValue(2) &" ["& safereplace(request("s_name" & LanguageTxt(LangT))) &"]"
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?action=value&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&mode="& mode,0,0,2,1)
End Sub

Sub edit_list_value_ok
		If OnlyRead = 1 Then OnlyReadMessage()
		id = Safereplace(request("id"))
        s_order = checknum(request("s_order"),0)
		s_pic = safereplace(request("s_pic"))
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_SelectValue] where id = "& id &"", conn, 1, 3
		For LangT = 1 To TotalLang
				rs("s_value" & LanguageTxt(LangT))=Replace(Trim(request("s_value" & LanguageTxt(LangT))),"'","&#180;")
		Next
		rs("s_pic")=s_pic
        rs("s_order")=s_order
        rs.Update
        rs.Close:set rs=Nothing
		ManageLog Lang_SelectValue(2) &" ["& safereplace(request("s_name" & LanguageTxt(LangT))) &"]"
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?action=list_value&id="& request("s_id") &"&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&mode="& mode,0,0,2,1)
End Sub

Sub update_value
        If OnlyRead = 1 Then OnlyReadMessage()
		s_id=Replace(Safereplace(trim(request("m_id")))," ","")
		s_order=Replace(Safereplace(trim(request("s_order")))," ","")
		If UBound(Split(s_id,",")) = 0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectName] where s_id=" &s_id, conn, 1, 3
                        rs("s_order")=s_order
                rs.update
                rs.close:set rs=Nothing
		Else
		For i = 0 To UBound(Split(s_id,","))
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectName] where s_id=" &Split(s_id,",")(i), conn, 1, 3
                        rs("s_order")=Split(s_order,",")(i)
                rs.update
                rs.close:set rs=Nothing
		Next
		End If
		ManageLog Lang_SelectValue(3) &" ["&id&"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"?action=value&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&page="& request("page") &"&keyword="& request("keyword") & "&pagenum="& request("pagenum") &"&Lang="& request("lang") &"&mode="& mode,0,0,2,1)
End Sub

Sub del_value
        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 s_id from [Lebi_SelectName] where s_id in ("&del_id&")",conn,1,3
		If Not rs.eof Then
				Do While Not rs.eof
				Set srs = server.CreateObject("adodb.recordset")
				srs.open "select s_pic from [Lebi_SelectValue] where s_id = "& rs(0) &"",conn,1,3
				Do While Not srs.eof 
						set objfso = server.createobject("scripting.FileSystemObject")
						If objfso.FileExists(server.MapPath("../"& srs(0))) Then
								objfso.DeleteFile(server.MapPath("../"& srs(0)))
						End If
						set objfso = Nothing
						srs.delete
						srs.update
				srs.movenext 
				Loop
				srs.close : Set srs = Nothing 
				rs.delete
				rs.update
				rs.movenext
				Loop
		End If
		rs.close:Set rs=Nothing
		ManageLog Lang_SelectValue(4) &" ["&del_id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?action=value&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&page=" & request("page")& "&keyword=" & request("keyword")& "&pagenum="& request("pagenum") &"&Lang="& request("lang") &"&mode="& mode,0,0,2,1)
End Sub

Sub update_list_value
        If OnlyRead = 1 Then OnlyReadMessage()
		id=Replace(Safereplace(trim(request("m_id")))," ","")
		s_order=Replace(Safereplace(trim(request("s_order")))," ","")
		If UBound(Split(id,",")) = 0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectValue] where id=" &id, conn, 1, 3
                        rs("s_order")=s_order
                rs.update
                rs.close:set rs=Nothing
		Else
		For i = 0 To UBound(Split(id,","))
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectValue] where id=" &Split(id,",")(i), conn, 1, 3
                        rs("s_order")=Split(s_order,",")(i)
                rs.update
                rs.close:set rs=Nothing
		Next
		End If
		ManageLog Lang_SelectValue(3) &" ["&id&"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"?action=list_value&id="& request("id") &"&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&page="& request("page") &"&keyword="& request("keyword") & "&pagenum="& request("pagenum") &"&Lang="& request("lang") &"&mode="& mode,0,0,2,1)
End Sub

Sub del_list_value
        If OnlyRead = 1 Then OnlyReadMessage()
        del_id= Replace(safereplace(Trim(request("del_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 srs = server.CreateObject("adodb.recordset")
		srs.open "select s_pic from [Lebi_SelectValue] where id in ("&del_id&")",conn,1,3
		Do While Not srs.eof 
				set objfso = server.createobject("scripting.FileSystemObject")
				If objfso.FileExists(server.MapPath("../"& srs(0))) Then
						objfso.DeleteFile(server.MapPath("../"& srs(0)))
				End If
				set objfso = Nothing
				srs.delete
				srs.update
		srs.movenext 
		Loop
		srs.close : Set srs = Nothing 
		ManageLog Lang_SelectValue(4) &" ["&del_id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?action=list_value&id="& request("id") &"&typeid="& request("typeid") &"&name="& server.urlencode(request("name")) &"&page=" & request("page")& "&keyword=" & request("keyword")& "&pagenum="& request("pagenum") &"&Lang="& request("lang") &"&mode="& mode,0,0,2,1)
End Sub

Sub add_ok
		If OnlyRead = 1 Then OnlyReadMessage()
        s_order = checknum(request("s_order"),0)
		categoryid = ","& replace(Safereplace(request("categoryid"))," ","") &","
		set rs=server.CreateObject("adodb.recordset")
		rs.Open "select * from [Lebi_SelectType]", conn, 1, 3
		rs.AddNew
		For LangT = 1 To TotalLang
				rs("s_name" & LanguageTxt(LangT))=safereplace(request("s_name" & LanguageTxt(LangT)))
		Next
		rs("s_order")=s_order
		rs("categoryid")=categoryid
		rs.Update
		rs.Close:set rs=Nothing
		ManageLog Lang_SelectValue(20) &" ["& safereplace(request("s_name" & LanguageTxt(LangT))) &"]"
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),0,"?",0,0,2,1)
 End Sub

Sub edit_ok
		If OnlyRead = 1 Then OnlyReadMessage()
		id = Safereplace(request("id"))
        s_order = checknum(request("s_order"),0)
		categoryid = ","& replace(Safereplace(request("categoryid"))," ","") &","
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_SelectType] where s_id = "& id &"", conn, 1, 3
		For LangT = 1 To TotalLang
				rs("s_name" & LanguageTxt(LangT))=safereplace(request("s_name" & LanguageTxt(LangT)))
		Next
        rs("s_order")=s_order
		rs("categoryid")=categoryid
        rs.Update
        rs.Close:set rs=Nothing
		ManageLog Lang_SelectValue(21) &" ["& safereplace(request("s_name" & LanguageTxt(LangT))) &"]"
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?",0,0,2,1)
End Sub

Sub update
        If OnlyRead = 1 Then OnlyReadMessage()
		s_id=Replace(Safereplace(trim(request("m_id")))," ","")
		s_order=Replace(Safereplace(trim(request("s_order")))," ","")
		If UBound(Split(s_id,",")) = 0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectType] where s_id=" &s_id, conn, 1, 3
                        rs("s_order")=s_order
                rs.update
                rs.close:set rs=Nothing
		Else
		For i = 0 To UBound(Split(s_id,","))
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_SelectType] where s_id=" &Split(s_id,",")(i), conn, 1, 3
                        rs("s_order")=Split(s_order,",")(i)
                rs.update
                rs.close:set rs=Nothing
		Next
		End If
		ManageLog Lang_SelectValue(22) &" ["&id&"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"?",0,0,2,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
        conn.execute "delete from [Lebi_SelectType] where s_id in("&del_id&")"
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select s_id from [Lebi_SelectName] where typeid in ("&del_id&")",conn,1,3
		If Not rs.eof Then
				Do While Not rs.eof
				Set srs = server.CreateObject("adodb.recordset")
				srs.open "select s_pic from [Lebi_SelectValue] where s_id = "& rs(0) &"",conn,1,3
				Do While Not srs.eof 
						set objfso = server.createobject("scripting.FileSystemObject")
						If objfso.FileExists(server.MapPath("../"& srs(0))) Then
								objfso.DeleteFile(server.MapPath("../"& srs(0)))
						End If
						set objfso = Nothing
						srs.delete
						srs.update
				srs.movenext 
				Loop
				srs.close : Set srs = Nothing 
				rs.delete
				rs.update
				rs.movenext
				Loop
		End If
		rs.close:Set rs=Nothing
		ManageLog Lang_SelectValue(23) &" ["&del_id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?page=" & request("page")& "&keyword=" & request("keyword")& "&pagenum="& request("pagenum") &"&sort_id="& request("sort_id") &"&Lang="& request("lang"),0,0,2,1)
End Sub

Sub add_value()
		id = checknum(request("id"),0)
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
	<%If id = 0 Then%>if (CheckEmpty("s_name<%= LanguageTxt(1) %>")){ShowMessage("s_name<%= LanguageTxt(1) %>","<%=Lang_SelectValue(5)%>");return false;}<%End If%>
	var s_type = document.getElementsByName("s_type");
    for (var i=0;i<s_type.length ;i++)
	{ if(s_type[i].checked==true)
		{
			s_type = s_type[i].value;
		}
	}
	if (s_type!=1)
	{
		if (CheckEmpty('s_value<%= LanguageTxt(1) %>')){ShowMessage('s_value<%= LanguageTxt(1) %>','<%=Lang_SelectValue(30)%>');return false;}
	}
}
<%If mode = 2 Then%>
function UType(n){
	<%For LangT = 1 To TotalLang%>
    var s_valuebox<%= LanguageTxt(LangT) %> = document.getElementById("s_valuebox<%= LanguageTxt(LangT) %>");
	if (n == 1){
		s_valuebox<%= LanguageTxt(LangT) %>.style.display = "none";
	}
	if (n == 0){
		s_valuebox<%= LanguageTxt(LangT) %>.style.display = "";
	}
	<%Next%>
}
<%End If%>
</script>
<script language=JavaScript src="inc/js/dialog.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form2" method="post" action="?action=add_value_ok" 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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%
		If id <> 0 Then 
				response.write(Lang_SelectValue(35))
		Else
				response.write(Lang_SelectValue(6))
		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%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
    <%If id = 0 Then%>
	<tr class="classrow">
	<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(7)%></td>
	<td width="85%" class="classrow">
	<input type="text" name="s_name<%= LanguageTxt(LangT) %>" id="s_name<%= LanguageTxt(LangT) %>" size="20" class="form"> <span id="mes_s_name<%= LanguageTxt(LangT) %>"></span>
	</td>
	</tr>
	<%End If%>
	<tr id="s_valuebox<%= LanguageTxt(LangT) %>" class="classrow">
	<td width="15%" height="30" class="classrow" valign="top"><%=Lang_SelectValue(14)%></td>
	<td width="85%" class="classrow">
	<textarea id="s_value<%= LanguageTxt(LangT) %>" name="s_value<%= LanguageTxt(LangT) %>" cols="30" rows="10" class="text"></textarea>
	<img src="images/help.gif" onmouseover="showhintinfo(this,0,0,'','<%=Lang_SelectValue(15)%>','50','up');" onmouseout="hidehintinfo();" /> <span id="mes_s_value<%= LanguageTxt(LangT) %>"></span><br />
	<a href="javascript:u_Size(-5,'s_value<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" alt="<%=Lang_sys(12)%>" /></a>
	<a href="javascript:u_Size(5,'s_value<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" alt="<%=Lang_sys(22)%>" /></a>
	</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">
<%If typeid = 0 Then%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(17)%></td>
<td width="85%" class="classrow">
<select name="typeid">
<%Set rs = conn.execute("Select s_id,s_name from [Lebi_SelectType] order by s_order desc")
Do While Not rs.eof 
		Response.Write("<option value="""& rs(0) &""">"& rs(1) &"</option>")
rs.movenext 
Loop
rs.close : Set rs = Nothing 
%>
</select>
</td>
</tr>
<%Else%>
<input type="hidden" name="typeid" value="<%=request("typeid")%>">
<%End If%>
<%If mode = 2 Then%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(39)%></td>
<td width="85%" class="classrow">
<input type="radio" name="s_type" value="0" onclick="UType(0)" checked> <%=Lang_SelectValue(41)%>
<input type="radio" name="s_type" value="2" onclick="UType(0)"> <%=Lang_SelectValue(42)%>
<input type="radio" name="s_type" value="1" onclick="UType(1)"> <%=Lang_SelectValue(40)%>
</td>
</tr>
<%End If%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(8)%></td>
<td width="85%" class="classrow">
<input type="text" name="s_order" size="5" value="1" class="form">
</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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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="name" value="<%=request("name")%>"><input type="hidden" name="mode" value="<%=mode%>"><input type="hidden" name="id" value="<%=id%>"><input type="hidden" name="type" value="<%=checknum(request("typeid"),0)%>"></td>
 </tr>
</form>
</table>
<%
End Sub

Sub edit_value()
Id = checknum(request("id"),0)
sql = "select * from [Lebi_SelectName] where s_id = "& id &""
set Rs = conn.execute(sql)
if Not (rs.eof and rs.bof) then
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (CheckEmpty('s_name<%= LanguageTxt(1) %>')){ShowMessage('s_name<%= LanguageTxt(1) %>','<%=Lang_SelectValue(5)%>');return false;}
}
</script>
<script language=JavaScript src="inc/js/dialog.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form1" method="post" action="?action=edit_value_ok" 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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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%>"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_SelectValue(9)%></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_SelectValue(7)%></td>
	<td width="85%" class="classrow">
	<input type="text" name="s_name<%= LanguageTxt(LangT) %>" id="s_name<%= LanguageTxt(LangT) %>" value="<%= rs("s_name"& LanguageTxt(LangT)) %>" size="20" class="form"> <span id="mes_s_name<%= LanguageTxt(LangT) %>"></span>
	</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_SelectValue(17)%></td>
<td width="85%" class="classrow">
<select name="s_typeid">
<%Set rstype = conn.execute("Select s_id,s_name from [Lebi_SelectType] order by s_order desc")
Do While Not rstype.eof 
		Response.Write("<option value="""& rstype(0) &""""& judge2(rstype(0),rs("typeid")) &">"& rstype(1) &"</option>")
rstype.movenext 
Loop
rstype.close : Set rstype = Nothing 
%>
</select>
</td>
</tr>
<%If rs("s_mode") = 2 Then%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(39)%></td>
<td width="85%" class="classrow">
<input type="radio" name="s_type" value="0"<%=judge(rs("s_type"),0)%>> <%=Lang_SelectValue(41)%>
<input type="radio" name="s_type" value="2"<%=judge(rs("s_type"),2)%>> <%=Lang_SelectValue(42)%>
<input type="radio" name="s_type" value="1"<%=judge(rs("s_type"),1)%>> <%=Lang_SelectValue(40)%>
</td>
</tr>
<%End If%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(8)%></td>
<td width="85%" class="classrow">
<input type="text" name="s_order" value="<%=rs("s_order")%>" size="5" value="1" class="form">
</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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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="typeid" value="<%=request("typeid")%>"><input type="hidden" name="name" value="<%=request("name")%>"><input type="hidden" name="mode" value="<%=mode%>"></td>
 </tr>
</form>
</table>
<%
End If
rs.close : Set rs = Nothing
End Sub

Sub value()
		page = checknum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		keyword = safereplace(request("keyword"))
		lang = safereplace(request("lang"))
		typeid = CheckNum(request("typeid"),0)
		name = safereplace(request("name"))
		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=-1
		.Pkey="s_id"
		.Field="s_id,s_name"& lang &",s_order,s_type"
		.Table="[Lebi_SelectName]"
		sql = "s_mode = "& mode
		If typeid <> 0 Then sql = sql &" and typeid = "& typeid
		If keyword <> "" Then sql = sql &" and (s_name"& lang &" like '%"& keyword &"%')"
		.Condition=sql
		.OrderBy="s_order desc,s_id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script>
function todel()
{

   var i = 0;
   var chkArr = document.getElementsByTagName("input");
   var page = document.getElementById("page").value;
   var lang = document.getElementById("lang").value;
   var keyword = document.getElementById("keyword").value;
   var pagenum = document.getElementById("pagenum").value;
   var typeid = document.getElementById("typeid").value;
   var name = document.getElementById("name").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)%>")){
           location="?action=del_value&mode=<%=mode%>&id="+param+"&keyword="+escape(keyword)+"&lang="+lang+"&pagenum="+pagenum+"&typeid="+typeid+"&name="+escape(name)+"&page="+page;
       }else return;
   }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form method="get" 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>
</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_SelectName|<%=mode%>','<%=lang%>')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="action" value="value"><input type="hidden" name="typeid" value="<%=typeid%>"><input type="hidden" name="name" value="<%=name%>"><input type="hidden" name="mode" value="<%=mode%>"><br /><div id="search_suggest_keyword" class="search_suggest" style="display:none">
</td>
</tr>
</table>
</td>
</form>
<td align="right" class="classhead">
<%=QuickMenu("","")%>
</td>
</tr>
<tr>
<td colspan="2" class="classhead">
<img src="images/bt_arr.gif" align="absmiddle" /> <a href="Admin_selectvalue.asp"><%=Lang_SelectValue(18)%></a> > <%If typeid<>0 Then%><%=name%> > <%End If%><%Select Case mode
Case 0 response.write(Lang_SelectValue(33))
Case 1 response.write(Lang_SelectValue(29))
Case 2 response.write(Lang_SelectValue(38))
End Select 
%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form1" method="post" action="?">
<tr>
  <td colspan="2" height="30" align="left" class="classhead">
     <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=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="image" border="0" title=" <%=Lang_sys(6)%> " onclick="location.href='?action=add_value&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>';return false;" src="lang/<%=LangFilePath%>/images/bt_add.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="lang" id="lang" value="<%=lang%>">
	 <input type="hidden" name="pagenum" id="pagenum" value="<%= pagenum %>">
	 <input type="hidden" name="typeid" id="typeid" value="<%=typeid%>">
	 <input type="hidden" name="name" id="name" value="<%=name%>">
	 <input type="hidden" name="mode" id="mode" value="<%=mode%>">
	 <input type="hidden" name="action" value="update_value">
  </td>
  <td colspan="3" class="classhead" align="right"><%=ors.ShowPageHead(page)%></td>
 </tr>
<tr>
<td class="classtop" width="4%" height="30" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td class="classtop" width="15%"><%=Lang_SelectValue(10)%></td>
<td class="classtop" width="61%"><%=Lang_SelectValue(16)%></td>
<td class="classtop" width="10%"><%=Lang_SelectValue(11)%></td>
<td class="classtop" width="10%"><%=Lang_SelectValue(12)%></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(1,i)%></td>
<td class="classrow"><%
Set rs = conn.execute("select s_value from [Lebi_SelectValue] where s_id = "& DataList(0,i) &"")
If Not rs.eof Then 
		datavalue = rs.getrows()
		datacount = 1
Else
		datacount = 0
End If 
rs.close : Set rs = Nothing 
If datacount = 1 Then 
		For s = 0 To UBound(datavalue,2)
				response.write(datavalue(0,s))
				If s < UBound(datavalue,2) Then response.write("、")
		Next 
End If 
%>&nbsp;</td>
<td class="classrow"><input name="s_order" type="text" id="s_order" value=<%=DataList(2,i)%> size="3" class="form"></td>
<td class="classrow"><a href="?action=edit_value&id=<%=DataList(0,i)%>&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>"><img src="images/icon_edit.gif" width="16" height="16" title=" <%=Lang_sys(51)%> " border="0"></a>&nbsp;&nbsp;
<%If DataList(3,i) <> 1 Then%><a href="?action=add_value&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>&id=<%=DataList(0,i)%>"><img src="images/icon_add.gif" width="16" height="16" title=" <%=Lang_sys(5)%> " border="0"></a>&nbsp;&nbsp;<a href="?action=list_value&id=<%=DataList(0,i)%>&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>"><img src="images/icon_manage.gif" width="16" height="16" title=" <%=Lang_SelectValue(19)%> " border="0"></a><%End If%></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="3"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tr>
<td colspan="5" class="classfaq">
<div class="faq_main">
<p class="faq_title"><%=Lang_sys(49)%></p>
<%Select Case mode
Case 0 response.write(Lang_SelectValue(13))
Case 1 response.write(Lang_SelectValue(36))
End Select 
%>
</div>
</td>
</tr>
</table>
<script>tdshow("classtable");</script>
<%End Sub

Sub list_value()
		page = checknum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		typeid = CheckNum(request("typeid"),0)
		id = CheckNum(request("id"),0)
		keyword = safereplace(request("keyword"))
		lang = safereplace(request("lang"))
		name = safereplace(request("name"))
		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=-1
		.Pkey="id"
		.Field="id,s_value"& lang &",s_order,s_pic"
		.Table="[Lebi_SelectValue]"
		sql = "s_id = "& id &" and s_mode = "& mode
		If typeid <> 0 Then sql = sql &" and typeid = "& typeid
		If keyword <> "" Then sql = sql &" and (s_value"& lang &" like '%"& keyword &"%')"
		.Condition=sql
		.OrderBy="s_order desc,id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script>
function todel()
{

   var i = 0;
   var chkArr = document.getElementsByTagName("input");
   var page = document.getElementById("page").value;
   var lang = document.getElementById("lang").value;
   var keyword = document.getElementById("keyword").value;
   var pagenum = document.getElementById("pagenum").value;
   var typeid = document.getElementById("typeid").value;
   var name = document.getElementById("name").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)%>")){
           location="?action=del_list_value&mode=<%=mode%>&id=<%=id%>&del_id="+param+"&keyword="+escape(keyword)+"&lang="+lang+"&pagenum="+pagenum+"&typeid="+typeid+"&name="+escape(name)+"&page="+page;
       }else return;
   }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form method="get" 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>
</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_SelectValue|<%=id%>,<%=mode%>,<%=typeid%>','<%=lang%>')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="action" value="list_value"><input type="hidden" name="typeid" value="<%=typeid%>"><input type="hidden" name="id" value="<%=id%>"><input type="hidden" name="name" value="<%=name%>"><input type="hidden" name="mode" value="<%=mode%>"><br /><div id="search_suggest_keyword" class="search_suggest" style="display:none">
</td>
</tr>
</table>
</td>
</form>
<td align="right" class="classhead">
<%=QuickMenu("","")%>
</td>
</tr>
<tr>
<td colspan="2" class="classhead">
<img src="images/bt_arr.gif" align="absmiddle" /> <a href="Admin_selectvalue.asp"><%=Lang_SelectValue(18)%></a> > <%If typeid <> 0 Then%><%=name%> > <%End If%><a href="?action=value&typeid=<%=typeid%>&name=<%=server.urlencode(request("name"))%>&mode=<%=mode%>"><%Select Case mode
Case 0 response.write(Lang_SelectValue(33))
Case 1 response.write(Lang_SelectValue(29))
Case 2 response.write(Lang_SelectValue(38))
End Select 
%></a> > <%
Set rs = conn.execute("select s_name from [Lebi_SelectName] where s_id = "& id &"")
If Not rs.eof Then 
		response.write(rs(0))
End If 
rs.close : Set rs = Nothing
%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form1" method="post" action="?">
<tr>
  <td colspan="2" height="30" align="left" class="classhead">
     <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=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="image" border="0" title=" <%=Lang_sys(6)%> " onclick="location.href='?action=add_value&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>&id=<%=id%>';return false;" src="lang/<%=LangFilePath%>/images/bt_add.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="lang" id="lang" value="<%=lang%>">
	 <input type="hidden" name="pagenum" id="pagenum" value="<%= pagenum %>">
	 <input type="hidden" name="typeid" id="typeid" value="<%=typeid%>">
	 <input type="hidden" name="name" id="name" value="<%=name%>">
	 <input type="hidden" name="mode" id="mode" value="<%=mode%>">
	 <input type="hidden" name="id" id="id" value="<%=id%>">
	 <input type="hidden" name="action" value="update_list_value">
  </td>
  <td colspan="3" class="classhead" align="right"><%=ors.ShowPageHead(page)%></td>
 </tr>
<tr>
<td class="classtop" width="5%" height="30" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td class="classtop" width="20%"><%=Lang_SelectValue(16)%></td>
<td class="classtop" width="55%"><%=Lang_SelectValue(31)%></td>
<td class="classtop" width="10%"><%=Lang_SelectValue(11)%></td>
<td class="classtop" width="10%"><%=Lang_SelectValue(12)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="d_id" type="checkbox" value="<%=DataList(0,i)%>"><input name="m_id" type="hidden" value="<%=DataList(0,i)%>"></td>
<td class="classrow"><%=DataList(1,i)%></td>
<td class="classrow"><%If DataList(3,i) <> "" Then%><img src="../<%=DataList(3,i)%>" height="20" /><%End If%>&nbsp;</td>
<td class="classrow"><input name="s_order" type="text" id="s_order" value=<%=DataList(2,i)%> size="3" class="form"></td>
<td class="classrow"><a href="?action=edit_list_value&id=<%=DataList(0,i)%>&s_id=<%=id%>&typeid=<%=typeid%>&name=<%=server.urlencode(name)%>&mode=<%=mode%>"><img src="images/icon_edit.gif" width="16" height="16" title=" <%=Lang_sys(51)%> " border="0"></a></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="3"><%=ors.ShowPageFoot(page)%></td>
</tr>
</table>
<script>tdshow("classtable");</script>
<%End Sub

Sub edit_list_value()
Id = checknum(request("id"),0)
sql = "select * from [Lebi_SelectValue] where id = "& id &""
set Rs = conn.execute(sql)
if Not (rs.eof and rs.bof) then
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (CheckEmpty('s_value<%= LanguageTxt(1) %>')){ShowMessage('s_value<%= LanguageTxt(1) %>','<%=Lang_SelectValue(30)%>');return false;}
}
</script>
<script language="javascript" type="text/javascript" src="Inc/js/js_link.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/dialog.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="form1" method="post" action="?action=edit_list_value_ok" 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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_SelectValue(9)%></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_SelectValue(7)%></td>
	<td width="85%" class="classrow">
	<input type="text" name="s_value<%= LanguageTxt(LangT) %>" value="<%= rs("s_value"& LanguageTxt(LangT)) %>" size="20" class="form"> <span id="mes_s_value<%= LanguageTxt(LangT) %>"></span>
	</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" style="display:none">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(32)%></td>
<td width="85%" class="classrow">
<input id="s_pic" name="s_pic" type="text" size="20" value="<%=rs("s_pic")%>" class="form"> <input type="button" id="Upload_s_pic" name="Upload_s_pic" value="<%=Lang_sys(52)%>" onclick="uploadpanel('form1','s_pic','other')" class="btn_upload"> 
<%If rs("s_pic") <> "" Then%><img src="images/img.gif" align="absmiddle" onMouseover="javascript:ddrivetip('<img src=../<%=rs("s_pic")%>>', '#ffffff', '100')" onMouseout="hideddrivetip()"><%End If%>
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_SelectValue(8)%></td>
<td width="85%" class="classrow">
<input type="text" name="s_order" value="<%=rs("s_order")%>" size="5" value="1" class="form">
</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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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="typeid" value="<%=request("typeid")%>"><input type="hidden" name="name" value="<%=request("name")%>"><input type="hidden" name="s_id" value="<%=request("s_id")%>"><input type="hidden" name="id" value="<%=id%>"><input type="hidden" name="mode" value="<%=mode%>"></td>
 </tr>
</form>
</table>
<%
End If
rs.close : Set rs = Nothing
End Sub

Sub add()
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.s_name,'<%=Lang_SelectValue(24)%>')) return false;
}
</script>
<script language=JavaScript src="inc/js/dialog.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form2" method="post" action="?action=add_ok" 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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_SelectValue(25)%></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_SelectValue(17)%></td>
	<td width="85%" class="classrow">
	<input type="text" name="s_name<%= LanguageTxt(LangT) %>" size="20" class="form">
	</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_SelectValue(8)%></td>
<td width="85%" class="classrow">
<input type="text" name="s_order" size="5" value="1" class="form">
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow" valign="top"><%=Lang_SelectValue(27)%></td>
<td width="85%" class="classrow">
<select name="categoryid" size="8" multiple="multiple" style="width:180px;height:80x;"><% check_sort (0),ii,",," %></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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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 edit()
Id = checknum(request("id"),0)
sql = "select * from [Lebi_SelectType] where s_id = "& id &""
set Rs = conn.execute(sql)
if Not (rs.eof and rs.bof) then
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.s_name,'<%=Lang_SelectValue(24)%>')) return false;
}
</script>
<script language=JavaScript src="inc/js/dialog.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form1" method="post" action="?action=edit_ok" 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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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%>"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_SelectValue(26)%></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_SelectValue(17)%></td>
	<td width="85%" class="classrow">
	<input type="text" name="s_name<%= LanguageTxt(LangT) %>" value="<%= rs("s_name"& LanguageTxt(LangT)) %>" size="20" class="form">
	</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_SelectValue(8)%></td>
<td width="85%" class="classrow">
<input type="text" name="s_order" value="<%=rs("s_order")%>" size="5" value="1" class="form">
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow" valign="top"><%=Lang_SelectValue(27)%></td>
<td width="85%" class="classrow">
<select name="categoryid" size="8" multiple="multiple" style="width:180px;height:80x;"><% check_sort (0),ii,","& rs("categoryid") &"," %></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)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&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

Sub main()
		page = checknum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		keyword = safereplace(Trim(request("keyword")))
		lang = safereplace(request("lang"))
		sort_id = CheckNum(request("sort_id"),0)
		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=-1
		.Pkey="s_id"
		.Field="s_id,s_name"& lang &",s_order"
		.Table="[Lebi_SelectType]"
		sql = "1=1"
		If keyword <> "" Then sql = sql &" and (s_name"& lang &" like '%"& keyword &"%')"
		If sort_id<>"0" And IsSqlDataBase = 1 Then sql=sql + " and charindex(',"&sort_id&",',categoryid)>0"
		If sort_id<>"0" And IsSqlDataBase = 0 Then sql=sql + " and instr(categoryid,',"&sort_id&",')>0"
		.Condition=sql
		.OrderBy="s_order desc,s_id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script>
function todel()
{

   var i = 0;
   var chkArr = document.getElementsByTagName("input");
   var page = document.getElementById("page").value;
   var lang = document.getElementById("lang").value;
   var keyword = document.getElementById("keyword").value;
   var pagenum = document.getElementById("pagenum").value;
   var sort_id = document.getElementById("sort_id").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)%>")){
           location="?action=del&id="+param+"&keyword="+escape(keyword)+"&lang="+lang+"&pagenum="+pagenum+"&sort_id="+sort_id+"&page="+page;
       }else return;
   }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form method="get" 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>&nbsp;<select name="sort_id" id="sort_id">
<option value="0" selected>┌ <%=Lang_Product(85)%></option>
<script src="../include/Lebi_Html/CategoryOption.js"></script>
</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_SelectType','<%=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">
</td>
</tr>
</table>
</td>
</form>
<td align="right" class="classhead">
<%=QuickMenu("Admin_brand.asp|"& Lang_Menu(76) &"","Admin_gongxiao.asp|"& Lang_Menu(79) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form1" method="post" action="?">
<tr>
  <td colspan="2" height="30" align="left" class="classhead">
     <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=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="image" border="0" title=" <%=Lang_sys(6)%> " onclick="location.href='?action=add';return false;" src="lang/<%=LangFilePath%>/images/bt_add.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="lang" id="lang" value="<%=lang%>">
	 <input type="hidden" name="pagenum" id="pagenum" value="<%= pagenum %>">
	 <input type="hidden" name="action" value="update">
  </td>
  <td colspan="3" class="classhead" align="right"><%=ors.ShowPageHead(page)%></td>
 </tr>
<tr>
<td class="classtop" width="5%" height="30" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td class="classtop" width="20%"><%=Lang_SelectValue(18)%></td>
<td class="classtop" width="55%">&nbsp;</td>
<td class="classtop" width="10%"><%=Lang_SelectValue(11)%></td>
<td class="classtop" width="10%"><%=Lang_SelectValue(12)%></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 colspan="2" class="classrow"><a href="?action=value&typeid=<%=DataList(0,i)%>&name=<%=server.urlencode(DataList(1,i))%>"><%=DataList(1,i)%></a></td>
<td class="classrow"><input name="s_order" type="text" id="s_order" value=<%=DataList(2,i)%> size="3" class="form"></td>
<td class="classrow"><a href="?action=edit&id=<%=DataList(0,i)%>"><img src="images/icon_edit.gif" width="16" height="16" title=" <%=Lang_sys(51)%> " border="0"></a>&nbsp;&nbsp;<a href="?action=value&typeid=<%=DataList(0,i)%>&name=<%=server.urlencode(DataList(1,i))%>"><img src="images/icon_manage.gif" width="16" height="16" title=" <%=Lang_SelectValue(19)%> " border="0"></a></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="3"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tr>
<td colspan="5" class="classfaq">
<div class="faq_main">
<p class="faq_title"><%=Lang_sys(49)%></p>
<%=Lang_SelectValue(37)%>
</div>
</td>
</tr>
</table>
<script>tdshow("classtable");</script>
<%End Sub
%>