<!--#include file="ewcfg7.asp"-->
<!--#include file="aspfn7.asp"-->
<!--#include file="userfn7.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


' Variables for checking menu items for user level
Const EW_SESSION_MENU_AR_USER_LEVEL_PRIV = "yousiteadmin_arUserLevelPriv" ' User Level Privilege Array
Const EW_SESSION_MENU_USER_LEVEL = "yousiteadmin_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) And _
							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
					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
%>
<!-- Begin Main Menu -->
<div class="aspmaker">
<p style="height:20px"></p>
<%
If AllowListMenu("bhlm") and ismenu=2 Then
%>

<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
 <tr>
    <td class="leftmenu1"><a href="bhlmlist.asp">栏目管理</a></td>
  </tr>
  <tr>
    <td class="leftmenu3">　　<a href="bhlmlist.asp">一级栏目管理</a></td>
  </tr>
  <tr>
    <td class="leftmenu3">　　<a href="xwlmlist.asp?cmd=resetall">二级栏目管理</a></td>
  </tr>
  <tr>
    <td class="leftmenu3">　　<a href="sjlmlist.asp">三级栏目管理</a></td>
  </tr>
</table>
<% end if%>
<%
If AllowListMenu("xwfb") and ismenu=3 Then
	sql2 = "select * FROM bhlm order by px,bh"
	set rs2=conn2.execute(sql2)
	do while not rs2.Eof 
%>

<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
  <tr>
    <td height="25"><img src="images/l1.jpg" width="14" 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/fl2.gif" width="14" 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%>
<%
If AllowListMenu("webset") and ismenu=1Then
%>
<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
  <tr>
    <td class="leftmenu1"><a href="websetlist.asp">站点基本信息</a></td>
  </tr>
  <tr>
    <td class="leftmenu1"><a href="webseolist.asp">站点SEO设置</a></td>
  </tr>
</table>
<% end if%>
<%
If AllowListMenu("zxzx") and ismenu=4Then
%>
<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
  <tr>
    <td class="leftmenu1"><a href="zxzxlist.asp">在线咨询管理</a></td>
  </tr>
</table>
<% end if%>
<%
If AllowListMenu("login") and ismenu=5 Then
%>
<table width="140" border="0" cellspacing="0" cellpadding="0" align="right" class="leftmenu">
  <tr>
    <td class="leftmenu1"><a href="zloginlist.asp">管理员管理</a></td>
  </tr>
  <%
  If (Session(EW_SESSION_MENU_USER_LEVEL) And EW_MENU_ALLOW_ADMIN) = EW_MENU_ALLOW_ADMIN Then
  %>
    <tr>
    <td class="leftmenu1"><a href="UserLevelslist.asp">管理员等级设置</a></td>
  </tr>
  <% end if%>
</table>
<% end if%>
</div>
<!-- End Main Menu -->
