<!--#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_protext.asp
'* 最后更新 2010-12-28 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",3.7,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_protext.inc"
CurrentId = 1
CurrentUrl = "admin_color.asp"
LB_Head()
LB_Menu()%>
<div class="tabmenu mainwidth">
      <ul>
        <li><a href="admin_color.asp"><span><%=Lang_Menu(77)%></span></a></li>
        <li><a href="Admin_chima.asp"><span><%=Lang_Menu(78)%></span></a></li>
		<li><a href="Admin_gongxiao.asp"><span><%=Lang_Menu(79)%></span></a></li>
		<li><a href="Admin_person.asp"><span><%=Lang_Menu(80)%></span></a></li>
        <li class="current"><a href="Admin_protext.asp"><span><%=Lang_Menu(82)%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
		Select Case request("action")
			   Case "del" : del()
			   Case "add" : add()
			   Case "add_ok" : add_ok()
			   Case "edit" : edit()
			   Case "edit_ok" : edit_ok()
			   Case Else
				main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        p_name = safereplace(request("p_name"))
	    If p_name = "" Then p_name = Lang_Protext(1)
	    p_check = CheckNum(request("p_check"),0)
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_protext]", conn, 1, 3
        rs.AddNew
                rs("p_name") = p_name
				For LangT = 1 To TotalLang
						rs("p_text" & LanguageTxt(LangT))=trim(safereplace(request("p_pro1" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro2" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro3" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro4" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro5" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro6" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro7" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro8" & LanguageTxt(LangT))))
				Next
				rs("p_check") = p_check
        rs.Update
        rs.Close:set rs=Nothing
	    set Rs = conn.execute("select top 1 p_id from [Lebi_protext] order by p_id desc")
	    p_id = rs("p_id")
	    rs.Close :set rs=nothing
	    If p_check = 1 Then conn.execute("update [Lebi_protext] set p_check = 0 where p_id <> "& p_id &"")
		ManageLog Lang_Protext(2) &" ["& p_name &"]"
        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 = checknum(request("id"),0)
        p_name = safereplace(request("p_name"))
	    p_check = safereplace(request("p_check"))
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_protext] where p_id ="& id &"", conn, 1, 3
                rs("p_name") = p_name
				For LangT = 1 To TotalLang
						rs("p_text" & LanguageTxt(LangT))=trim(safereplace(request("p_pro1" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro2" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro3" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro4" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro5" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro6" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro7" & LanguageTxt(LangT)))) &"$"& trim(safereplace(request("p_pro8" & LanguageTxt(LangT))))
				Next
				rs("p_check") = p_check
        rs.Update
        rs.Close:set rs=Nothing
		ManageLog Lang_Protext(3) &" ["&request("m_id")&"]"
        Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?",0,0,2,1)
End Sub

Sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
        del_id= Replace(safereplace(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
	    totalnum = conn.execute("select count(p_id) from [Lebi_protext]")(0)
	    If totalnum = 1 Then
				Call Up_mes(Lang_sys(46),"·"& Lang_Protext(4),0,"?",0,0,2,0)
	    Else
                conn.execute "delete from [Lebi_protext] where p_id in("&del_id&")"
				ManageLog Lang_Protext(5) &" ["&del_id&"]"
                m_u="?page=" & request("page")& "&keyword=" & request("keyword")& "&pagenum="& request("pagenum") &"&Lang="& request("lang")
	            Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
	    End If
End Sub

Sub add
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.p_name,'<%=Lang_Protext(6)%>')) return false;
}
</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" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" 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_Protext(7)%></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="add_<%= LangT %>">
<tr>
<td height="30" class="classtop">{text1}</td>
<td class="classtop">{text2}</td>
<td class="classtop">{text3}</td>
<td class="classtop">{text4}</td>
<td class="classtop">{text5}</td>
<td class="classtop">{text6}</td>
<td class="classtop">{text7}</td>
<td class="classtop">{text8}</td>
</tr>
<tr>
<td height="30" class="classrow">
<input name="p_pro1<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro2<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro3<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro4<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro5<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro6<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro7<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro8<%= LanguageTxt(LangT) %>" type="text" style="width:98%;" class="form">
</td>
</tr>
	</table>
	</div>
	<script>tdshow("add_<%= 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="add_other">
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Protext(8)%></td>
<td width="85%" class="classrow">
<input name="p_name" type="text" size="20" class="form">
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Protext(9)%></td>
<td width="85%" class="classrow">
<select name="p_check">
<option value="0"><%=Lang_Protext(10)%></option>
<option value="1" style="background-color:#FFFFFF;color:red;"><%=Lang_Protext(11)%></option>
</select>
</td>
</tr>
</table>
</div>
<script>tdshow("add_other");</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" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
 </tr>
</form>
</table>
<%End Sub

Sub edit()
Id = checknum(request("id"),0)
sql = "select * from [Lebi_protext] where p_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.p_name,'<%=Lang_Protext(6)%>')) return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form2" 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=" 提交 " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="id" value="<%=id%>"></td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_Protext(12)%></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="edit_<%= LangT %>">
<tr>
<td class="classtop">{text1}</td>
<td class="classtop">{text2}</td>
<td class="classtop">{text3}</td>
<td class="classtop">{text4}</td>
<td class="classtop">{text5}</td>
<td class="classtop">{text6}</td>
<td class="classtop">{text7}</td>
<td class="classtop">{text8}</td>
</tr>
<tr>
<td height="30" class="classrow">
<input name="p_pro1<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(0) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro2<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(1) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro3<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(2) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro4<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(3) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro5<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(4) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro6<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(5) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro7<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(6) %>" type="text" style="width:98%;" class="form">
</td>
<td class="classrow">
<input name="p_pro8<%= LanguageTxt(LangT) %>" value="<%= split(trim(rs("p_text"& LanguageTxt(LangT) )),"$")(7) %>" type="text" style="width:98%;" class="form">
</td>
</tr>
	</table>
	</div>
	<script>tdshow("edit_<%= 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="edit_other">
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Protext(8)%></td>
<td width="85%" class="classrow">
<input name="p_name" value="<%=rs("p_name")%>" type="text" size="20" class="form">
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Protext(9)%></td>
<td width="85%" class="classrow">
<select name="p_check">
<option value="0"><%=Lang_Protext(10)%></option>
<option value="1" style="background-color:#FFFFFF;color:red;" <%If rs("p_check") = 1 Then response.write(" selected") End If%>><%=Lang_Protext(11)%></option>
</select>
</td>
</tr>
</table>
</div>
<script>tdshow("edit_other");</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" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
 </tr>
</form>
</table>
<%
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"))
		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="p_id"
		.Field="p_id,p_check,p_name,p_text"& lang &""
		.Table="[Lebi_protext]"
		sql = "1=1"
		If keyword <> "" Then sql = sql &" and (p_name like '%"& keyword &"%' or p_text"& lang &" like '%"& keyword &"%')"
		.Condition=sql
		.OrderBy="p_check desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<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" 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_person.asp|"& Lang_Menu(80) &"","admin_tags.asp|"& Lang_Menu(81) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable2">
<tbody>
<form name="form" action="?action=del" method="post">
<tr>
  <td colspan="3" height="30" align="left" class="classhead">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="image" 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" value="<%=page%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="lang" value="<%=lang%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
     </td>
  <td colspan="9" height="30" 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="8%" ><%=Lang_Protext(13)%></td>
<td class="classtop" width="15%"><%=Lang_Protext(14)%></td>
<td class="classtop" width="8%">{text1}</td>
<td class="classtop" width="8%">{text2}</td>
<td class="classtop" width="8%">{text3}</td>
<td class="classtop" width="8%">{text4}</td>
<td class="classtop" width="8%">{text5}</td>
<td class="classtop" width="8%">{text6}</td>
<td class="classtop" width="8%">{text7}</td>
<td class="classtop" width="8%">{text8}</td>
<td class="classtop"><%=Lang_Protext(15)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
		p_text = split(trim(DataList(3,i)),"$")
		p_pro1 = p_text(0)
		p_pro2 = p_text(1)
		p_pro3 = p_text(2)
		p_pro4 = p_text(3)
		p_pro5 = p_text(4)
		p_pro6 = p_text(5)
		p_pro7 = p_text(6)
		p_pro8 = p_text(7)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>"></td>
<td height="30" class="classrow">
<%
If DataList(1,i)=1 Then
		response.write"默认"
Else
		response.write"&nbsp;"
End If
%>
</td>
<td class="classrow"><a href="?action=edit&id=<%=DataList(0,i)%>"><%= trim(DataList(2,i)) %></a></td>
<td class="classrow"><%= p_pro1 %>&nbsp;</td>
<td class="classrow"><%= p_pro2 %>&nbsp;</td>
<td class="classrow"><%= p_pro3 %>&nbsp;</td>
<td class="classrow"><%= p_pro4 %>&nbsp;</td>
<td class="classrow"><%= p_pro5 %>&nbsp;</td>
<td class="classrow"><%= p_pro6 %>&nbsp;</td>
<td class="classrow"><%= p_pro7 %>&nbsp;</td>
<td class="classrow"><%= p_pro8 %>&nbsp;</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></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="10"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tr>
<td colspan="12" class="classfaq">
<div class="faq_main">
<p class="faq_title"><%=Lang_sys(49)%></p>
<%=Lang_Protext(16)%>
</div>
</td>
</tr>
</tbody>
</table>
<script>tdshow("list");</script>
<%End Sub%>