<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="../include/config.inc"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_footer.asp
'* 最后更新 2010-09-19 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",8.11,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_footer.inc"
CurrentId = 5
CurrentUrl = "admin_footer.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
		If OutSubmit = 1 Then CheckOutSubmit()
		select case request("action")
			   Case "add" :add()
			   Case "add_ok" :add_ok()
			   Case "add_s" : add_s()
			   Case "edit" : edit()
			   Case "edit_ok" : edit_ok()
			   Case "del" :del()
			   Case "del_s" :del_s()
			   Case "up_s" : up_s()
			   Case "down_s" : down_s()
			   Case Else
					main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
		f_id = CheckNum(request("f_id"),0)
		f_paixu = CheckNum(request("f_paixu"),0)
		f_url = safereplace(request("f_url"))
		f_target = safereplace(request("f_target"))
		set rs=server.CreateObject("adodb.recordset")
		If f_id = 0 Then
				rs.Open "select * from [Lebi_footer]", conn, 1, 3
				rs.AddNew
				For LangT = 1 To TotalLang
						rs("f_name" & LanguageTxt(LangT))=safereplace(request("f_name" & LanguageTxt(LangT)))
				Next
				rs("f_paixu") = f_paixu
				rs("f_url") = f_url
				rs("f_target") = f_target
				rs.Update
		Else
				rs.Open "select * from [Lebi_footer_s]", conn, 1, 3
				rs.AddNew
				For LangT = 1 To TotalLang
						rs("f_s_name" & LanguageTxt(LangT))=safereplace(request("f_name" & LanguageTxt(LangT)))
				Next
				rs("f_s_paixu") = f_paixu
				rs("f_s_url") = f_url
				rs("f_s_target") = f_target
				rs("f_id") = f_id
				rs.Update
		End If
		rs.Close:set rs=Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(1) &" ["&safereplace(request("f_name"& lang))&"]"
		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)
		f_id = CheckNum(request("f_id"),0)
		f_paixu = CheckNum(request("f_paixu"),0)
		f_url = safereplace(request("f_url"))
		f_target = safereplace(request("f_target"))
		set rs=server.CreateObject("adodb.recordset")
		If f_id = 0 Then
			rs.Open "select * from [Lebi_footer] where f_id = "& id &"", conn, 1, 3
			For LangT = 1 To TotalLang
					rs("f_name" & LanguageTxt(LangT))=safereplace(request("f_name" & LanguageTxt(LangT)))
			Next
			rs("f_paixu") = f_paixu
			rs("f_url") = f_url
			rs("f_target") = f_target
			rs.Update
		Else
			rs.Open "select * from [Lebi_footer_s] where f_s_id = "& id &"", conn, 1, 3
			For LangT = 1 To TotalLang
					rs("f_s_name" & LanguageTxt(LangT))=safereplace(request("f_name" & LanguageTxt(LangT)))
			Next
			rs("f_s_paixu") = f_paixu
			rs("f_s_url") = f_url
			rs("f_s_target") = f_target
			rs("f_id") = f_id
			rs.Update
		End If
		rs.Close:set rs=Nothing
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(2) &" ["&safereplace(request("f_name"& lang))&"]"
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?",0,0,2,1)
End Sub

Sub del
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		conn.execute "delete from [Lebi_footer] where f_id="&id
		conn.execute "delete from [Lebi_footer_s] where f_id="&id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(3) &" ["&id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?",0,0,2,1)
End Sub

Sub del_s
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		conn.execute "delete from [Lebi_footer_s] where f_s_id="&id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(4) &" ["&id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?",0,0,2,1)
End Sub

Sub up_s
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		conn.execute "update [Lebi_footer_s] set f_s_paixu=f_s_paixu+1 where f_s_id="&id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(5) &" ["&id&"]"
		response.Redirect "?"
		response.End
End Sub

Sub down_s
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		conn.execute "update [Lebi_footer_s] set f_s_paixu=f_s_paixu-1 where f_s_id="&id
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_Footer(6) &" ["&id&"]"
		response.Redirect "?"
		response.End
End Sub

Sub main()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
	<tr>
		<td colspan="3" height="30" align="left" class="classhead"><input type="image" src="lang/<%=LangFilePath%>/images/bt_add.gif" border="0" title=" <%=Lang_sys(6)%> " onclick="location.href='?action=add';return false;" align="absmiddle"></td>
		<td align="right" class="classhead">
		<%=QuickMenu("Admin_gug.asp|"& Lang_Menu(141) &"","admin_vote.asp|"& Lang_Menu(145) &"")%>
		</td>
	 </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
   <tr>
   <%
   set rs = conn.execute("select f_url,f_name,f_id from [Lebi_footer] order by f_paixu desc")
   i=1
   If rs.eof Then
		response.write"<td>"& Lang_Footer(7) &"</td>"
   Else
   Do While Not rs.eof
   %>
   <td width="25%" valign=top>
     <table cellspacing="0" cellpadding="1" width="100%">
	  <tr>
	    <td width="75%" height="30" class="classtop"><%If Trim(rs("f_url"))<>"" Then%><a href="<%If InStr(LCase(Trim(rs("f_url"))),"http://")>0 Then response.write Trim(rs("f_url")) Else response.write "../"&Trim(rs("f_url")) End If%>" target="_blank"><%=rs("f_name")%></a><%else%><%=rs("f_name")%><%End if%></td>
		<td width="25%" class="classtop" align=center><a href="?action=edit&id=<%=rs("f_id")%>" title="<%=Lang_sys(51)%>"><img src="images/icon_edit.gif" align="absmiddle" border="0"></a> <a href="?action=del&id=<%=rs("f_id")%>" onClick="return ConfirmDel();" title="<%=Lang_sys(15)%>"><img src="images/icon_del.gif" align="absmiddle" border="0"></a></td>
	  </tr>
  	     <%
   	    set rs_s = conn.execute("select f_id,f_s_id,f_s_url,f_s_name from [Lebi_footer_s] where f_id="&rs("f_id")&" order by f_s_paixu desc")
   	    If rs_s.eof Then
   	    response.write"<tr><td class=classrow height=50 valign=middle>"& Lang_Footer(7) &"</td></tr>"
   	    Else
   	    Do While Not rs_s.eof
         %>
		 <tr class="classrow">
		   <td class="classrow" width="75%" height="30"><a href=?action=up_s&id=<%=rs_s("f_s_id")%> title="<%=Lang_Footer(8)%>">↑</a><a href="?action=down_s&id=<%=rs_s("f_s_id")%>" title="<%=Lang_Footer(9)%>">↓</a>&nbsp;&nbsp;<%If Trim(rs_s("f_s_url"))<>"" Then%><a href="<%If InStr(LCase(Trim(rs_s("f_s_url"))),"http://")>0 Then response.write Trim(rs_s("f_s_url")) Else response.write "../"&Trim(rs_s("f_s_url")) End If%>" target="_blank"><%=rs_s("f_s_name")%></a><%else%><%=rs_s("f_s_name")%><%End if%></td>
		   <td class="classrow" width="25%" align="center"><a href="?action=edit&f_id=<%=rs_s("f_id")%>&id=<%=rs_s("f_s_id")%>" title="<%=Lang_sys(51)%>"><img src="images/icon_edit.gif" align="absmiddle" border="0"></a> <a href="?action=del_s&id=<%=rs_s("f_s_id")%>" onClick="return ConfirmDel();" title="<%=Lang_sys(15)%>"><img src="images/icon_del.gif" align="absmiddle" border="0"></a></td>
		 </tr>
		<%
		rs_s.movenext
		Loop
		End If
		rs_s.close:Set rs_s=Nothing
	    response.write"</table></td>"
		If i Mod 2 = 0 Then:response.write"</tr>":End if
		rs.movenext
		i=i+1
		Loop
		End If
		rs.close:Set rs=Nothing
		%>
</table>
<script>tdshow("classtable");</script>
<%End Sub %>

<%
Sub add()
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.f_name,'<%=Lang_Footer(10)%>')) return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
	<form name="form" 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 align="right" class="classhead">
		<%=QuickMenu("","")%>
		</td>
	 </tr>
	<tr>
	   <td class="classtop" colspan="2" height="30"><%=Lang_Footer(11)%></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_Footer(12)%></td>
			<td class="classrow">
			<input type="text" name="f_name<%= LanguageTxt(LangT) %>" size="30" value="" 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_Footer(13)%></td>
		<td class="classrow">
		<select name="f_id">
		<option value="0">┌ <%=Lang_Footer(14)%></option>
		<%
		sqlts="select f_id,f_name from [Lebi_footer] order by f_paixu desc"
		Set rsts = conn.execute(sqlts)
		Do while not rsts.eof
		%>
				  <option value="<%=rsts("f_id")%>">├ <%=rsts("f_name")%></option>
				  <%
		rsts.movenext
		loop
		rsts.Close:set rsts=nothing
		%>
		</select>
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(15)%></td>
		<td class="classrow">
		<input name="f_url" type="text" id="f_url" size="30" class="form"> <input type="button" value="<%=Lang_sys(50)%>" onClick="JavaScript:window.open('admin_help.asp?action=sortlist&IsCheck=1','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=470,top=176,left=161');" class="button" />
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(16)%></td>
		<td class="classrow">
		<input name="f_target" type="text" value="_self" size="5" class="form">
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(17)%></td>
		<td class="classrow">
		<input name="f_paixu" type="text" id="f_paixu" value="1" size="5" class="form">
		</td>
		</tr>
		</table>
		</div>
		<script>tdshow("classtable");</script>
	</td>
	</tr>
	<tr>
	<td colspan="2" class="classfooter" height="30" align="left">
	<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)
f_id = CheckNum(request("f_id"),0)
set rs=server.CreateObject("adodb.recordset")
If f_id = 0 Then
	sql = "select * from [Lebi_footer] where f_id="& id &""
	rs.open sql, conn, 1, 1
	order = rs("f_paixu")
	target =  Trim(rs("f_target"))
	url = Trim(rs("f_url"))
Else
	sql = "select * from [Lebi_footer_s] where f_s_id="& id &""
	rs.open sql, conn, 1, 1
	order = rs("f_s_paixu")
	target =  Trim(rs("f_s_target"))
	url = Trim(rs("f_s_url"))
End If
%>
<script language="JavaScript" type="text/JavaScript">
function CheckForm(theform)
{
    if (!isEmpty(theform.f_name,'<%=Lang_Footer(10)%>')) return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
	<form name="form" method="post" action="?action=edit_ok&id=<%=id%>" 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 align="right" class="classhead">
		<%=QuickMenu("","")%>
		</td>
	 </tr>
	<tr>
	   <td class="classtop" colspan="2" height="30"><%=Lang_Footer(18)%></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_Footer(12)%></td>
			<td class="classrow" height="30">
			<input type="text" name="f_name<%= LanguageTxt(LangT) %>" size="30" value="<%If f_id = 0 Then
			response.write rs("f_name" & LanguageTxt(LangT))
			Else
			response.write rs("f_s_name" & LanguageTxt(LangT))
			End If%>" 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_Footer(13)%></td>
		<td class="classrow">
		<select name="f_id">
		<option value="0">┌ <%=Lang_Footer(14)%></option>
		<%
		sqlts="select f_id,f_name from [Lebi_footer] order by f_paixu desc"
		Set rsts = conn.execute(sqlts)
		Do while not rsts.eof
		%>
				  <option value="<%=rsts("f_id")%>" <%=judge2(rsts("f_id"),f_id)%>>├ <%=rsts("f_name")%></option>
				  <%
		rsts.movenext
		loop
		rsts.Close:set rsts=nothing
		%>
		</select>
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(15)%></td>
		<td class="classrow">
		<input name="f_url" type="text" id="f_url" value="<%=url%>" size="30" class="form"> <input type="button" value="<%=Lang_sys(50)%>" onClick="JavaScript:window.open('admin_help.asp?action=sortlist&IsCheck=1','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=470,top=176,left=161');" class="button" />
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(16)%></td>
		<td class="classrow">
		<input name="f_target" type="text" value="<%=target%>" size="5" class="form">
		</td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_Footer(17)%></td>
		<td class="classrow">
		<input name="f_paixu" type="text" id="f_paixu" value="<%=order%>" size="5" class="form">
		</td>
		</tr>
		</table>
		</div>
		<script>tdshow("classtable");</script>
	</td>
	</tr>
	<tr>
	<td colspan="2" class="classfooter" height="30" align="left">
	<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%>