📄 menu_main.php
字号:
<?php
include_once( "inc/conn.php" );
include_once( "inc/auth.php" );
$connection = openconnection( );
$user_id = $_SESSION['LOGIN_USER_ID'];
$theme = $_SESSION['LOGIN_THEME'];
$sql = "\r\n SELECT up.FUNC_ID_STR FROM user u,user_priv up\r\n\t WHERE u.USER_ID='".$user_id."'\r\n\t\t AND u.user_priv=up.user_priv \r\n ";
$rs = exequery( $connection, $sql );
$ar = mysql_fetch_array( $rs );
if ( $ar['FUNC_ID_STR'] == "" )
{
message( "警告", "你没有任何权限!" );
exit( );
}
$webroot = get_cfg_var( "doc_root" );
$themedir = $webroot."/images/menu";
$func_id_str = substr( $ar['FUNC_ID_STR'], 0, -1 );
$func_id_str_a = ",".$func_id_str.",";
$menu_str = "";
echo "\r\n<html>\r\n<head>\r\n<title></title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<s";
echo "cript language=\"JavaScript\">\r\nfunction clickMenu(ID)\r\n{\r\n\r\n targetelement=document.all(ID);\r\n if (targetelement.style.display==\"none\")\r\n targetelement.style.display='';\r\n else\r\n targetelement.style.display=\"none\";\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"1\" leftmargin=\"0\">\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"5\" align=\"";
echo "center\">\r\n\r\n";
$sql = "\r\n SELECT FUNC_ID,MENU_ID,FUNC_NAME,FUNC_CODE,FUNC_ISSYS FROM user_menu \r\n\t WHERE LENGTH(MENU_ID)=2 \r\n\t\t\t AND USER_ID='".$user_id."' \r\n\t\t\t AND FUNC_ISSHOW=1 \r\n\t\t\t AND FUNC_ISSYS=1 \r\n\t\t ORDER BY ORDER_ID ASC;\r\n ";
$rs = exequery( $connection, $sql );
$count_menu = 0;
while ( $ar = mysql_fetch_array( $rs ) )
{
$func_id = $ar['FUNC_ID'];
$menu_id = $ar['MENU_ID'];
$menu_name = $ar['FUNC_NAME'];
$menu_code = $ar['FUNC_CODE'];
$func_issys = $ar['FUNC_ISSYS'];
$levelid = $func_id;
$src = "/images/menu/".$theme."/icon/".$func_id.".gif";
$filepath = $themedir."/".$theme."/icon/".$func_id.".gif";
if ( !file_exists( $filepath ) )
{
$src = "/images/menu/1/icon/95.gif";
if ( 999 < $func_id )
{
$src = "/images/menu/".$theme."/icon/sysdefinemenu.gif";
}
if ( 1999 < $func_id )
{
$src = "/images/menu/".$theme."/icon/mydefinemenu.gif";
}
}
$name = $menu_name;
$cdata = $cdata;
$realvalue = true;
if ( $func_issys == 1 && strpos( $func_id_str_a, ",".$func_id."," ) === false )
{
$realvalue = false;
}
if ( $realvalue )
{
echo "\t<tr class=\"tableLine2\"> \r\n\t <td align=\"center\" style=\"cursor:hand\" onClick=\"javascript:parent.menuname.location='menu_name.php?id=";
echo $levelid;
echo "'\"><img src=\"";
echo $src;
echo "\">\r\n";
echo $name;
echo "\t </td>\r\n\t</tr>\r\n\r\n";
}
}
echo " \r\n</table> \r\n \r\n \r\n \r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -