📄 menu.php
字号:
<?
include_once("inc/reg_check.php");
if($OA_REG_ON!=2)
exit;
include_once("inc/auth.php");
include_once("inc/conn.php");
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/inc/style.css">
<style type="text/css">
A:link{color: #000000; TEXT-DECORATION: none;}
A:visited {COLOR: #000000; TEXT-DECORATION: none}
A:active {COLOR: #3333ff; TEXT-DECORATION: none}
A:hover {COLOR: #ff0000; TEXT-DECORATION: none}
</style>
</head>
<?
$connection=OpenConnection();
$query = "SELECT * from USER where USER_ID='$LOGIN_USER_ID'";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
$USER_NAME=$ROW["USER_NAME"];
$BKGROUND=$ROW["BKGROUND"];
$MENU_HIDE=$ROW["MENU_HIDE"];
$PWD=$ROW["PASSWORD"];
}
?>
<body topmargin="3" leftmargin="0" rightMargin="0" bgcolor="#D9E8FF" marginwidth="0" marginheight="0">
<!-- OA树开始-->
<table class="small" border="0" width="100%" cellspacing="0" cellpadding="0" align="center"><tr><td>
<!-- OA树标题 -->
<table class="small" border="0" cellspacing="0" cellpadding="0" height="25" width="100%" >
<tr>
<td valign="top"><img src="/images/avatar/<?=$LOGIN_AVATAR?>.gif"> <b>[<?=$USER_NAME?>]</b>
<a href="#A" onclick="openURL('/general/table_index.php')"><u>我的办公桌</u></a>
</td>
</tr>
</table>
<?
$query = "SELECT * from USER_PRIV where USER_PRIV=$LOGIN_USER_PRIV";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
$USER_FUNC_ID_STR=$ROW["FUNC_ID_STR"];
if($LOGIN_USER_ID=="admin")
$USER_FUNC_ID_STR.="32,33,56,";
$query = "SELECT * from SYS_MENU order by MENU_ID";
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$MENU_COUNT1++;
$MENU_ID1=$ROW["MENU_ID"];
$MENU_NAME=$ROW["MENU_NAME"];
$IMAGE=$ROW["IMAGE"];
$query1 = "SELECT * from SYS_FUNCTION where MENU_ID like '$MENU_ID1%' and length(MENU_ID)=4 order by MENU_ID";
$cursor1= exequery($connection,$query1);
$SUB_MENU_COUNT=0;
while($ROW=mysql_fetch_array($cursor1))
{
$MENU_ID2=$ROW["MENU_ID"];
$FUNC_ID=$ROW["FUNC_ID"];
$FUNC_NAME=$ROW["FUNC_NAME"];
$FUNC_CODE=$ROW["FUNC_CODE"];
if(strstr($FUNC_CODE,"/"))
$FUNC_IMAGE=substr($FUNC_CODE,0,strpos($FUNC_CODE,"/"));
else
$FUNC_IMAGE=$FUNC_CODE;
if(find_id($USER_FUNC_ID_STR,$FUNC_ID))
{
$SUB_MENU_COUNT++;
//--- 检查是否是1级菜单最后 ---
$query_next = "SELECT * from SYS_FUNCTION where MENU_ID not like '$MENU_ID1%' and length(MENU_ID)=4 and MENU_ID>'$MENU_ID1'";
$cursor_next= exequery($connection,$query_next);
$FOUND=0;
$MENU_END1=0;
while($ROW=mysql_fetch_array($cursor_next))
{
$FUNC_ID=$ROW["FUNC_ID"];
if(find_id($USER_FUNC_ID_STR,$FUNC_ID))
{
$FOUND=1;
break;
}
}
if($FOUND==0)
{
$MENU_END1=1;
}
//--- 检查是否是2级菜单最后 ---
$query_next = "SELECT * from SYS_FUNCTION where MENU_ID like '$MENU_ID1%' and length(MENU_ID)=4 and MENU_ID>'$MENU_ID2'";
$cursor_next= exequery($connection,$query_next);
$FOUND=0;
$MENU_END2=0;
while($ROW=mysql_fetch_array($cursor_next))
{
$FUNC_ID=$ROW["FUNC_ID"];
if(find_id($USER_FUNC_ID_STR,$FUNC_ID))
{
$FOUND=1;
break;
}
}
if($FOUND==0)
{
$MENU_END2=1;
}
//---- 第一个,显示主菜单项 ----
if($SUB_MENU_COUNT==1)
{
?>
<table class="small" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/menu/<?if($MENU_END1)echo "tree_plusl";else echo "tree_plus";?>.gif" id="MEMU_<?=$MENU_ID1?>" class="outline" style="cursor:hand"></td>
<td><img src="/images/menu/<?=$IMAGE?>.gif" border="0" WIDTH="19" HEIGHT="17" alt="<?=$MENU_NAME?>"></td>
<td colspan="3"><a href="#A" onclick="MEMU_<?=$MENU_ID1?>.click();"> <?=$MENU_NAME?></a></td>
</tr>
</table>
<table class="small" border="0" cellspacing="0" cellpadding="0" id="MEMU_<?=$MENU_ID1?>d" style="display:none">
<tr><td>
<?
}
//--- 判断是否是子菜单 ----
if(substr($FUNC_CODE,0,1)!="@")
{
?>
<table class="small" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/menu/<?if($MENU_END1)echo "tree_transp";else echo "tree_line";?>.gif" border="0"></td>
<td><img src="/images/menu/<?if($MENU_END2)echo "tree_blankl";else echo "tree_blank";?>.gif"></td>
<td><img src="/images/menu/<?=$FUNC_IMAGE?>.gif" border="0" WIDTH="19" HEIGHT="17" alt="<?=$FUNC_NAME?>"></td>
<td colspan="2"><a href="#A" onclick="openURL('/general/<?=$FUNC_CODE?>')"> <?=$FUNC_NAME?></a></td>
</tr>
</table>
<?
}
else
{
?>
<table class="small" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/menu/<?if($MENU_END1)echo "tree_transp";else echo "tree_line";?>.gif" border="0"></td>
<td><img src="/images/menu/<?if($MENU_END2)echo "tree_plusl";else echo "tree_plus";?>.gif" id="MEMU_<?=$MENU_ID2?>" class="outline" style="cursor:hand"></td>
<td><img src="/images/menu/<?=$FUNC_IMAGE?>.gif" border="0" WIDTH="19" HEIGHT="17" alt="<?=$FUNC_NAME?>"></td>
<td colspan="2"><a href="#A" onclick="MEMU_<?=$MENU_ID2?>.click();"> <?=$FUNC_NAME?></a></td>
</tr>
</table>
<table class="small" border="0" cellspacing="0" cellpadding="0" id="MEMU_<?=$MENU_ID2?>d" style="display:none">
<tr>
<td>
<?
$query2 = "SELECT * from SYS_FUNCTION where MENU_ID like '$MENU_ID2%' and length(MENU_ID)=6 order by MENU_ID";
$cursor2= exequery($connection,$query2);
while($ROW=mysql_fetch_array($cursor2))
{
$MENU_ID3=$ROW["MENU_ID"];
$FUNC_ID=$ROW["FUNC_ID"];
$FUNC_NAME=$ROW["FUNC_NAME"];
$FUNC_CODE=$ROW["FUNC_CODE"];
if(strstr($FUNC_CODE,"/"))
$FUNC_IMAGE=substr($FUNC_CODE,0,strpos($FUNC_CODE,"/"));
else
$FUNC_IMAGE=$FUNC_CODE;
if($FUNC_CODE=="bbs2/admin")
$FUNC_IMAGE="system";
if(find_id($USER_FUNC_ID_STR,$FUNC_ID))
{
//--- 检查是否是3级菜单最后 ---
$query_next = "SELECT * from SYS_FUNCTION where MENU_ID like '$MENU_ID2%' and length(MENU_ID)=6 and MENU_ID>'$MENU_ID3'";
$cursor_next= exequery($connection,$query_next);
$FOUND=0;
$MENU_END3=0;
while($ROW=mysql_fetch_array($cursor_next))
{
$FUNC_ID=$ROW["FUNC_ID"];
if(find_id($USER_FUNC_ID_STR,$FUNC_ID))
{
$FOUND=1;
break;
}
}
if($FOUND==0)
{
$MENU_END3=1;
}
?>
<table class="small" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/menu/<?if($MENU_END1)echo "tree_transp";else echo "tree_line";?>.gif"></td>
<td><img src="/images/menu/<?if($MENU_END2)echo "tree_transp";else echo "tree_line";?>.gif" border="0"></td>
<td><img src="/images/menu/<?if($MENU_END3)echo "tree_blankl";else echo "tree_blank";?>.gif"></td>
<td><img src="/images/menu/<?=$FUNC_IMAGE?>.gif" border="0" WIDTH="19" HEIGHT="17" alt="<?=$FUNC_NAME?>"></td>
<td colspan="2"><a href="#A" onclick="openURL('/general/<?=$FUNC_CODE?>')"> <?=$FUNC_NAME?></a></td>
</tr>
</table>
<?
}
}//while sub_menu
?>
</td>
</tr>
</table>
<?
}//if sub_menu
}//if(find_id
}//while
?>
</td>
</tr>
</table>
<?
}//while
?>
<script language="JavaScript">
var openedid;
var openedid_ft;
var flag=0,sflag=0;
function clickHandler()
{
var targetid,srcelement,targetelement;
var strbuf;
srcelement=window.event.srcElement;
//-------- 如果点击了展开或收缩按钮---------
if(srcelement.className=="outline")
{
targetid=srcelement.id+"d";
targetelement=document.all(targetid);
if (targetelement.style.display=="none")
{
targetelement.style.display='';
strbuf=srcelement.src;
if(strbuf.indexOf("plus.gif")>-1)
srcelement.src="/images/menu/tree_minus.gif";
else
srcelement.src="/images/menu/tree_minusl.gif";
}
else
{
targetelement.style.display="none";
strbuf=srcelement.src;
if(strbuf.indexOf("minus.gif")>-1)
srcelement.src="/images/menu/tree_plus.gif";
else
srcelement.src="/images/menu/tree_plusl.gif";
}
}
}
document.onclick = clickHandler;
function openURL(URL)
{
mytop=(screen.availHeight-400)/2-30;
myleft=(screen.availWidth-600)/2;
window.open("go.php?LOGIN_USER_ID=<?=$LOGIN_USER_ID?>&PWD=<?=$PWD?>&URL="+URL,"","height=400,width=600,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -