<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/config.inc"-->
<!--#include file="../include/Lebi_XML_Cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_language.asp
'* 最后更新 2012-07-04 by 56770.kingdge
'*****************************************
Set LB_XML = new ASPXML
Dim admin_flag
admin_flag=",10.8,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_language.inc"
CurrentId = 5
CurrentUrl = "admin_language.asp"
LB_Head()
LB_Menu()
Response.Write("<div class=""mainbody"">")
Response.Write("<div class=""mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
Else
		Select Case Request("action")
			   Case "editfile_ok" : editfile_ok()
			   Case "editfile" : editfile()
			   Case "edit_ok" : edit_ok()
			   Case "edit" : edit()
			   Case Else
					list()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

sub edit_ok()
		If OnlyRead = 1 Then OnlyReadMessage()
        id = Safereplace(request("id"))
        l_name = Safereplace(request("l_name"))
		l_mark = Safereplace(request("l_mark"))
		l_money = Replace(Trim(request("l_money")),"'","")
		l_money2 = Replace(Trim(request("l_money2")),"'","")
		l_rate = CheckNum(request("l_rate"),0)
		l_ico = Safereplace(request("l_ico"))
		l_txt = Safereplace(request("l_txt"))
		l_file = Safereplace(request("l_file"))
		l_state = CheckNum(request("l_state"),0)
		l_default = CheckNum(request("l_default"),0)
		l_order = CheckNum(request("l_order"),0)
		s_id = CheckNum(request("s_id"),0)
		l_path = Safereplace(request("l_path"))
		l_folder = Safereplace(request("l_folder"))
		template = Safereplace(request("template"))
		l_decimal = CheckNum(request("l_decimal"),0)
		If l_state = 0 Then
				If CheckNum(conn.execute("select count(l_id) from [Lebi_Language] where l_state = 1 and l_id <> "& id &"")(0),0) = 0 Then
						Call Up_mes(Lang_sys(46),"·"& Lang_Language(3),0,"javascript:history.back()",0,0,2,0)
				End If
		End If
		set rs=server.createobject("ADODB.Recordset")
		sql="select * from [Lebi_Language] where l_id = "& id &""
		rs.open sql, conn, 1, 3
		rs("l_name") = l_name
		rs("l_mark") = l_mark
		rs("l_money") = l_money
		rs("l_money2") = l_money2
		rs("l_rate") = l_rate
		rs("l_ico") = l_ico
		rs("l_state") = l_state
		rs("l_default") = l_default
		rs("l_order") = l_order
		rs("l_path") = l_path
		rs("l_decimal") = l_decimal
		rs("l_folder") = l_folder
		rs("template") = template
		rs.update
		rs.close:set rs=Nothing
		If l_default = 1 Then conn.execute("update [Lebi_Language] set l_default = 0 where l_id <> "& id &"")
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Language(4) &" ["&l_name&"]"
		m_u="?keywords="& request("keywords") &"&page="& request("page") &""
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,m_u,0,0,2,1)
end Sub

Sub editfile_ok()
		If OnlyRead = 1 Then OnlyReadMessage()
		name = safereplace(request("name"))
		languagecode = request.form("languagecode")
		Dim Hackchar
		Hackchar = "execute(,request(,session(,insert,truncate,declare,createtextfile,createdirectory,deletedirectory,deletefolder,opentextfile,filesystemobject,adodb.stream,savehtml,server.,scripting.,object.,shell.application,wscript,xmlhttp,script.encode,javascript.encode"
		For i = 0 To UBound(Split(Hackchar,","))
				If InStr(LCase(languagecode),Split(Hackchar,",")(i)) > 0 Then
						Call Up_mes(Lang_sys(46),"·"& Lang_sys(87) &"["& Split(Hackchar,",")(i) &"]",0,"javascript:history.back();",0,0,2,0)
				End If
		Next
		str_filename="..\include\lebi_lang\"& name
		Savehtml str_filename,languagecode
		m_u="?keywords="& request("keywords") &"&page="& request("page") &""
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,m_u,0,0,2,1)
End Sub

sub list
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		keyword = safereplace(Trim(request("keyword")))
		state = safereplace(request("state"))
		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="l.l_id"
		.Field="l.l_id,l.l_name,l.l_mark,l.l_money,l.l_rate,l.l_state,l.l_default,l.template,l.l_file"
		.Table="[Lebi_Language] as l"
		sql = "1=1"
		If keyword <> "" Then sql = sql &" and (l.l_name like '%"& keyword &"%')"
		If state <> "" Then sql = sql &" and l.l_state = "& CLng(state)
		.Condition=sql
		.OrderBy="l.l_id asc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<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" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="s_type">
<option value="">┌ <%=Lang_Language(28)%></option>
<option value="0"<%=judge2(state,0)%>>├ <%=Lang_Language(25)%></option>
<option value="1"<%=judge2(state,1)%>>├ <%=Lang_Language(24)%></option>
</select>
</td>
<td style="padding-left:5px;"><input name="keyword" type="text" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
</tr>
</table>
</td>
</form>
<td align="right" class="classhead">
	<%=QuickMenu("admin_qq.asp|"& Lang_Menu(146) &"","")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable" id="classtable">
<tbody>
<tr>
  <td colspan="3" height="30" align="left" class="classhead">&nbsp;</td>
  <td colspan="6" height="30" class="classhead" align="right"><%=ors.ShowPageHead(page)%></td>
 </tr>
<tr>
<td height="30" width="5%" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td width="10%" class="classtop"><%=Lang_Language(29)%></td>
<td width="10%" class="classtop"><%=Lang_Language(30)%></td>
<td width="10%" class="classtop"><%=Lang_Language(31)%></td>
<td width="10%" class="classtop"><%=Lang_Language(32)%></td>
<td width="20%" class="classtop"><%=Lang_Language(33)%></td>
<td width="10%" class="classtop"><%=Lang_Language(34)%></td>
<td width="10%" class="classtop"><%=Lang_Language(28)%></td>
<td width="10%" class="classtop"><%=Lang_Language(35)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
		If Not IsNull(DataList(7,i)) Then 
		LB_XML.Path = server.MapPath("../skins/"& DataList(7,i) &"/data.xml")
		LB_XML.Data = "data"
		LB_XML.open
		LB_XML.SelectTable("config")
		skinname = LB_XML.read("name")
		LB_XML.close
		End If 
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>"><input name="item_id" type="hidden" value="<%=DataList(0,i)%>"></td>
<td class="classrow"><%=DataList(1,i)%></td>
<td class="classrow"><%=DataList(2,i)%></td>
<td class="classrow"><%=DataList(3,i)%></td>
<td class="classrow"><%=DataList(4,i)%></td>
<td class="classrow"><%=skinname%></td>
<td class="classrow"><%if DataList(5,i)="1" then response.write Lang_Language(25) Else  response.write Lang_Language(24) end if%></td>
<td class="classrow"><%if DataList(6,i)="1" then response.write Lang_Language(23) Else  response.write Lang_Language(22) end if%></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" align="absmiddle"></a>&nbsp;&nbsp;<a href="?action=editfile&name=<%=DataList(8,i)%>"><img src="images/icon_text.gif" width="16" height="16" title=" <%=Lang_Language(27)%> " border="0" align="absmiddle"></a>&nbsp;&nbsp;<a href="admin_skin_save.asp?action=all&template=<%=DataList(7,i)%>&LangI=<%=i+1%>&back_type=1"><img src="images/icon_savefile.gif" width="16" height="16" border="0" align="absmiddle" title="<%=Lang_Language(36)%>" width="16"></a></td>
</tr>
<%
        Next
End If
%>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="7"><%=ors.ShowPageFoot(page)%></td>
</tr>
</table>
<script>tdshow("classtable");</script>
<%end Sub

sub edit()
id = CheckNum(request("id"),0)
Set rs = conn.execute("select * from [Lebi_Language] where l_id = "& id &"")
If Not rs.eof Then
%>
<table width="99%" border="0" cellspacing="0" cellpadding="3" class="classtable">
<form name="add" method="post" action="?action=edit_ok">
<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 align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" height="30" colspan="2"><%=Lang_Language(27)%></td></tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <li class="selected"><a rel="tcontent" style="CURSOR:hand;"><%=Lang_Language(7)%></a></li>
</ul>
<div id="tabcontentcontainer">
   <div id="tcontent" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable">
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(8)%></td>
<td width="85%" class="classrow"><input type="text" name="l_name" size="15" value="<%=rs("l_name")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(9)%></td>
<td width="85%" class="classrow"><input type="text" name="l_mark" size="15" value="<%=rs("l_mark")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(10)%></td>
<td width="85%" class="classrow"><input type="text" name="l_ico" size="15" value="<%=rs("l_ico")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(11)%></td>
<td width="85%" class="classrow"><input type="text" name="l_money" size="15" value="<%=rs("l_money")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(37)%></td>
<td width="85%" class="classrow"><input type="text" name="l_money2" size="15" value="<%=rs("l_money2")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(12)%></td>
<td width="85%" class="classrow"><input type="text" name="l_rate" size="15" value="<%=rs("l_rate")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(13)%></td>
<td width="85%" class="classrow"><input type="text" name="l_order" size="15" value="<%=rs("l_order")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(14)%></td>
<td width="85%" class="classrow"><select name="template">
<%
LB_XML.Path = server.MapPath("../skins/Lebi_Tpl.xml")
LB_XML.Data = "data"
LB_XML.open
LB_XML.SelectTable("template")
do while not(LB_XML.Xml_Bof or LB_XML.Xml_Eof)
response.write("<option value='"& LB_XML.read("templatefolder") &"' "& judge2(rs("template"),LB_XML.read("templatefolder")) &">"& LB_XML.read("name") &"</option>")
LB_XML.MoveNext()
Loop
LB_XML.close
%>
</select></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(19)%></td>
<td width="85%" class="classrow"><input type="text" name="l_path" size="15" value="<%=rs("l_path")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(42)%></td>
<td width="85%" class="classrow"><input type="text" name="l_folder" size="15" value="<%=rs("l_folder")%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Language(21)%></td>
<td width="85%" class="classrow"><select name="l_state">
<option value="0"><%=Lang_Language(24)%></option>
<option value="1" style="background-color:#FFFFFF;color:red;" <%=judge2(rs("l_state"),1)%>><%=Lang_Language(25)%></option>
</select></td>
</tr>
<tr class="classtd">
<td height="30" width="15%" class="classtd"><%=Lang_Language(20)%></td>
<td width="85%" class="classtd"><select name="l_default">
<option value="0"><%=Lang_Language(22)%></option>
<option value="1" style="background-color:#FFFFFF;color:red;" <%=judge2(rs("l_default"),1)%>><%=Lang_Language(23)%></option>
</select></td>
</tr>
<tr class="classrow">
<td width="15%" class="classrow" height="30"><%=Lang_Language(38)%></td>
<td width="85%" class="classrow" height="30">
	<input type="radio" value="0" <%=judge(rs("l_decimal"),"0")%> name="l_decimal"> <%=Lang_Language(39)%>
	<input type="radio" value="1" <%=judge(rs("l_decimal"),"1")%> name="l_decimal"> <%=Lang_Language(40)%>
	<input type="radio" value="2" <%=judge(rs("l_decimal"),"2")%> name="l_decimal"> <%=Lang_Language(41)%>
</td>
</tr>
	</table>
	</div>
	<script>tdshow("classtable");</script>
</div>
<script>showtabcontent("tablist")</script>
</td>
</tr>
<tr class="classfooter">
  <td colspan="2" height="30" 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>
<tr>
<td colspan="2" class="classfaq">
  <div class="faq_main">
  <p class="faq_title"><%=Lang_sys(49)%></p>
  <%=Lang_Language(26)%>
  </div>
</td>
</tr>
</table>
<%
End If
rs.close : Set rs = Nothing
end Sub

Sub editfile()
		Dim cssname,fso,TruePath
		name = Replace(Replace(request("name"),"/",""),"\","")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="edit" class="classtable">
<form method="post" action="?action=editfile_ok">
<tr>
 <td height="30" class="classhead" align="left">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;" align="absmiddle">
			<input type="hidden" name="name" value="<%=name%>">
 </td>
 <td align="right" class="classhead"><%=QuickMenu("","")%></td>
</tr>
<tr>
  <td class="classtop" colspan="2" height="30"><%=name%>
</td>
</tr>
<tr class="classrow">
	<td class="classrow" colspan="2" align="right"><a href="javascript:u_Size(-10,'str_css')"><img src="lang/<%=LangFilePath%>/images/bt_close.gif" border='0'></a> <a href="javascript:u_Size(10,'str_css')"><img src="lang/<%=LangFilePath%>/images/bt_open.gif" border='0'></a></td>
</tr>
<tr class="classrow">
<td class="classrow" valign="top" width="15%">
<%
        If not IsObjInstalled("Scripting.FileSystemObject")Then
				response.write "1.<a href=""?action=editfile&name=zh-cn.inc""><font color=red>css.css</font></a><br/>"
		Else
				Set fso=server.createobject("scripting.filesystemobject")
				TruePath=Server.MapPath("../include/lebi_lang/")
				if fso.FolderExists(TruePath)then
						Set theFolder=fso.GetFolder(TruePath)
				end If
				i = 1
				For Each theFile In theFolder.Files
						response.write i &".<a href=""?action=editfile&name="& theFile.Name &""">"
						If CStr(cssname) = CStr(theFile.Name) Then
								response.write "<font color=red>"& UCase(theFile.Name) &"</font>"
						Else
								response.write UCase(theFile.Name)
						End If
						response.write "</a><br/>"
						i = i + 1
				next
        End If
%>
</td>
<td class="classrow" width="85%">
		<textarea cols="102" rows="24" name="languagecode" class="html"><%=LoadFile("../include/lebi_lang/"& name &"")%></textarea>
</td>
</tr>
<tr>
<td class="classfooter" colspan="2" align="left" height="30">
<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;">
</td>
</tr>
</form>
</table>
<script>tdshow("edit");</script>
<%End sub%>