<!--#include file="ewcfg11.asp"-->
<!--#include file="aspfn11.asp"-->
<!--#include file="userfn11.asp"-->
<!--#include file="conn.asp"-->
<%
nowurl=Request.ServerVariables("HTTP_url")

if InStr(nowurl,"webset") > 0 then 
	ismenu=1
	topmenu="#m1"
end if
if InStr(nowurl,"webseo") > 0 then 
	ismenu=1
	topmenu="#m1"
end if
if InStr(nowurl,"lmlist") > 0 then 
	ismenu=2
	topmenu="#m2"
end if
if InStr(nowurl,"xwfb") > 0 then 
	ismenu=3
	topmenu="#m3"
end if
if InStr(nowurl,"zxzx") > 0 then 
	ismenu=4
	topmenu="#m4"
end if
if InStr(nowurl,"zlogin") > 0 then 
	ismenu=5
	topmenu="#m5"
end if
if InStr(nowurl,"UserLevelslist") > 0 then 
	ismenu=5
	topmenu="#m5"
end if
%>
<!-- Begin Main Menu -->
<div class="ewMenu">
<%

' Initialize language object
Set Language = New cLanguage
Call Language.LoadPhrases()

' Generate all menu items
Dim RootMenu
Set RootMenu = new cMenu
RootMenu.Id = EW_MENUBAR_ID
%>
<%

' Variables for checking menu items for user level
Const EW_SESSION_MENU_AR_USER_LEVEL_PRIV = "aspweb_2015_2_arUserLevelPriv" ' User Level Privilege Array
Const EW_SESSION_MENU_USER_LEVEL = "aspweb_2015_2_Status_UserLevelValue" ' User level value
Const EW_MENU_ALLOW_ADMIN = 16
Dim arMenuUserLevelPriv

' Restore user level privilege
If IsArray(Session(EW_SESSION_MENU_AR_USER_LEVEL_PRIV)) Then
	arMenuUserLevelPriv = Session(EW_SESSION_MENU_AR_USER_LEVEL_PRIV)
End If

' Check if menu item is allowed for current user level
Function AllowListMenu(TableName)
		Dim i, priv, thispriv, userlevellist
		userlevellist = CurrentUserLevelList ' Get user level id list
		If userlevellist & "" = "" Then ' Not defined, just get user level
			userlevellist = CurrentUserLevel
		End If
		If IsLoggedIn() Then
			If IsListItem(userlevellist, "-1") Then
				AllowListMenu = True
			Else
				AllowListMenu = False
				priv = 0
				If IsArray(arMenuUserLevelPriv) Then
					For i = 0 to UBound(arMenuUserLevelPriv, 2)
						If CStr(arMenuUserLevelPriv(0, i)) = CStr(TableName) Then
							If IsListItem(userlevellist, arMenuUserLevelPriv(1, i)) Then
								thispriv = arMenuUserLevelPriv(2, i)
								If IsNull(thispriv) Then thispriv = 0
								If Not IsNumeric(thispriv) Then thispriv = 0
								thispriv = CLng(thispriv)
								priv = priv Or thispriv
							End If
						End If
					Next
				End If
				AllowListMenu = CBool(priv And 8)
			End If
		Else
			AllowListMenu = False
		End If
End Function

' Is list item
Function IsListItem(list, item)
	Dim ar, i
	If list = "" Then
		IsListItem = False
	Else
		ar = Split(list, ",")
		For i = 0 to UBound(ar)
			If CStr(item&"") = CStr(Trim(ar(i)&"")) Then
				IsListItem = True
				Exit Function
			End If
		Next
		IsListItem = False
	End If
End Function
%>
<%

' Get Menu Text
Function GetMenuText(Id, Text)
	GetMenuText = Language.MenuPhrase(Id, "MenuText")
	If GetMenuText = "" Then GetMenuText = Text
End Function
%>
<%
If ismenu=3 Then
	sql2 = "select * FROM bhlm order by px,bh"
	set rs2=conn2.execute(sql2)
	do while not rs2.Eof 
%>
<p></p>
<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
  <tr>
    <td height="25"><img src="images/record.png" style="vertical-align:middle; margin-right:10px" /><a href="xwfblist.asp?showmaster=bhlm&bh=<%=rs2("bh")%>"><%=rs2("bhmc")%></a></td>
  </tr>
</table>
	<%
		sql = "select * FROM xwlm where bh="&rs2("bh")&" order by px,bh"
		set rs=conn2.execute(sql)
		do while not rs.Eof 
	%>
	
	<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu2">
	  <tr>
		<td height="25"><img src="images/action_remove.png"  style="vertical-align:middle; margin-right:10px" /><a href="xwfblist.asp?showmaster=xwlm&bh=<%=rs("bh")%>&lmid=<%=rs("lmid")%>"><%=rs("lmmc")%></a></td>
	  </tr>
	</table>
		<%
            sql3 = "select * FROM sjlm where lmid="&rs("lmid")&" order by px,bh"
            set rs3=conn2.execute(sql3)
            do while not rs3.Eof 
        %>
        
        <table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu3">
          <tr>
            <td height="25"><img src="images/fl1.gif" width="14" style="vertical-align:middle; margin-right:10px" /><a href="xwfblist.asp?showmaster=sjlm&bh=<%=rs3("bh")%>&lmid=<%=rs3("lmid")%>&id=<%=rs3("id")%>"><%=rs3("sjmc")%></a></td>
          </tr>
        </table>
        <%rs3.movenext:loop:set rs3=nothing%>
	<%rs.movenext:loop:set rs=nothing%>
<%rs2.movenext:loop:set rs2=nothing%>
<% end if%>
<%

' Generate all menu items
RootMenu.Id = EW_MENUBAR_ID
RootMenu.IsRoot = True
RootMenu.AddMenuItem 42, GetMenuText("42", "网站设置"), "", -1, "", "", True, False, True
RootMenu.AddMenuItem 35, GetMenuText("35", "导航设置"), "dhlist.asp", 42, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}dh"), False, False
RootMenu.AddMenuItem 29, GetMenuText("29", "SEO优化"), "webseolist.asp", 42, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}webseo"), False, False
RootMenu.AddMenuItem 5, GetMenuText("5", "站点信息"), "websetlist.asp", 42, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}webset"), False, False
RootMenu.AddMenuItem 43, GetMenuText("43", "关键词关联"), "gjclist.asp", 42, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}gjc"), False, False
RootMenu.AddMenuItem 21, GetMenuText("21", "网站栏目管理"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 1, GetMenuText("1", "信息栏目"), "bhlmlist.asp", 21, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}bhlm"), False, False
RootMenu.AddMenuItem 8, GetMenuText("8", "信息二级栏目"), "xwlmlist.asp?cmd=resetall", 21, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}xwlm"), False, False
RootMenu.AddMenuItem 30, GetMenuText("30", "三级栏目"), "sjlmlist.asp?cmd=resetall", 21, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}sjlm"), False, False
RootMenu.AddMenuItem 28, GetMenuText("28", "网站信息管理"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 7, GetMenuText("7", "信息管理"), "xwfblist.asp?cmd=resetall", 28, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}xwfb"), False, False
RootMenu.AddMenuItem 27, GetMenuText("27", "在线咨询"), "zxzxlist.asp", -1, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}zxzx"), False, False
RootMenu.AddMenuItem 26, GetMenuText("26", "管理中心"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 2, GetMenuText("2", "管理员"), "zloginlist.asp", 26, "", "", AllowListMenu("{A697AD8C-67CB-4820-BF4F-84306CDBBEE7}login"), False, False
RootMenu.AddMenuItem 4, GetMenuText("4", "管理员等级设置"), "UserLevelslist.asp", 26, "", "", ((Session(EW_SESSION_MENU_USER_LEVEL) And EW_MENU_ALLOW_ADMIN) = EW_MENU_ALLOW_ADMIN), False, False
RootMenu.AddMenuItem 3, GetMenuText("3", "User Level Permissions"), "UserLevelPermissionslist.asp", -1, "", "", ((Session(EW_SESSION_MENU_USER_LEVEL) And EW_MENU_ALLOW_ADMIN) = EW_MENU_ALLOW_ADMIN), False, False
RootMenu.AddMenuItem &HFFFFFFFF, Language.Phrase("Logout"), "logout.asp", -1, "", "", IsLoggedIn(), False, False
RootMenu.AddMenuItem &HFFFFFFFF, Language.Phrase("Login"), "login.asp", -1, "", "", (Not IsLoggedIn() And Right(Request.ServerVariables("URL"), Len("login.asp")) <> "login.asp"), False, False
RootMenu.Render(False)
Set RootMenu = Nothing
%>
</div>
<!-- End Main Menu -->
