📄 set.php
字号:
<?php
include_once( "inc/auth.php" );
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\r\n<script>\r\n\r\nvar MENU_ID_ARRAY = new Array();\r\n\r\n";
$query = "SELECT * from SYS_MENU";
$cursor = exequery( $connection, $query );
$MENU_ID_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
echo " MENU_ID_ARRAY[";
echo $MENU_ID_COUNT;
echo "]=\"";
echo $ROW['MENU_ID'];
echo "\";\r\n";
++$MENU_ID_COUNT;
}
$query = "SELECT * from USER_PRIV where USER_PRIV='".$USER_PRIV."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRIV_NO = $ROW['PRIV_NO'];
$PRIV_NAME = $ROW['PRIV_NAME'];
$USER_FUNC_ID_STR = $ROW['FUNC_ID_STR'];
}
echo "\r\nfunction check_all(menu_all,MENU_ID)\r\n{\r\n\r\n for (i=0;i<document.all(MENU_ID).length;i++)\r\n {\r\n if(menu_all.checked)\r\n document.all(MENU_ID).item(i).checked=true;\r\n else\r\n document.all(MENU_ID).item(i).checked=false;\r\n }\r\n\r\n if(i==0)\r\n {\r\n if(menu_all.checked)\r\n document.all(MENU_ID).checked=true;\r\n else\r\n document.all(MENU_ID).checked=false;\r\n }\r\n}\r\n\r\nfunction mysubmit()\r\n{\r\n func_id_str=\"\";\r\n\r\n for(j=1;j<=";
echo $MENU_ID_COUNT;
echo ";j++)\r\n {\r\n menu_id=MENU_ID_ARRAY[j-1]+'';\r\n \tif(!document.all(menu_id))\r\n \t continue;\r\n\r\n for(i=0;i<document.all(menu_id).length;i++)\r\n {\r\n el=document.all(menu_id).item(i);\r\n if(el.checked)\r\n { val=el.value;\r\n func_id_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(i==0)\r\n {\r\n el=document.all(menu_id);\r\n if(el.checked)\r\n { val=el.value;\r\n func_id_str+=val + \",\";\r\n }\r\n }\r\n }\r\n\r\n location=\"update_set.php?FUNC_ID_STR=\"+ func_id_str +\"&USER_PRIV=\"+document.form1.PRIV_ID.value+\"&OP=\"+document.form1.OP.value;\r\n}\r\n\r\nfunction LoadPrivWindow()\r\n{\r\n URL=\"/module/priv_select\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX;\r\n loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:250px;dialogHeight:300px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <form action=\"set.php\" method=\"post\" name=\"form1\">\r\n <td class=\"Big\"><img src=\"/images/edit.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 角色权限:<input type=\"hidden\" name=\"PRIV_ID\" value=\"\">\r\n <input type=\"text\" name=\"PRIV_NAME\" value=\"\" class=\"BStatic\" wrap=\"yes\" readonly size=\"40\">\r\n <input type=\"button\" value=\"选 择\" class=\"BigButton\" onClick=\"LoadPrivWindow()\" title=\"选择角色\" name=\"button\">\r\n \t 操作方式: <select name=\"OP\" class=\"BigSelect\">\r\n \t \t <option value=\"1\" >添加</option>\r\n \t \t <option value=\"0\" >清除</option>\r\n </select>\r\n <input type=\"button\" value=\"确定\" class=\"BigButton\" onclick=\"mysubmit();\"> \r\n <input type=\"button\" value=\"返回\" class=\"BigButton\" onclick=\"location='index.php'\">\r\n </span>\r\n </td> \r\n </form>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" cellspacing=\"2\" class=\"small\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableContent\">\r\n\r\n";
$COUNT_FUNC = 0;
$query = "SELECT * from SYS_MENU order by MENU_ID";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$MENU_ID = $ROW['MENU_ID'];
$MENU_NAME = $ROW['MENU_NAME'];
$FUNC_ID_STR = $ROW['FUNC_ID_STR'];
$IMAGE = $ROW['IMAGE'];
++$COUNT_FUNC;
echo "\r\n<td valign=\"top\">\r\n <table border=\"0\" cellspacing=\"1\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n <tr class=\"TableHeader\" title=\"";
echo $MENU_NAME;
echo "\">\r\n <td nowrap>\r\n <input type=\"checkbox\" name=\"MENU_";
echo $MENU_ID;
echo "\" id=\"MENU_";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\" onClick=\"check_all(this,'";
echo $MENU_ID;
echo "');\">\r\n <img src=\"/images/menu/";
echo $IMAGE;
echo ".gif\" width=19 height=17> <label for=\"MENU_";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\"><b>";
echo $MENU_NAME;
echo "</b></label>\r\n </td>\r\n </tr>\r\n";
$query1 = "SELECT * from SYS_FUNCTION where MENU_ID like '".$MENU_ID."%' and length(MENU_ID)=4 order by MENU_ID";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$MENU_ID1 = $ROW['MENU_ID'];
$FUNC_ID = $ROW['FUNC_ID'];
$FUNC_NAME = $ROW['FUNC_NAME'];
$FUNC_CODE = $ROW['FUNC_CODE'];
if ( strstr( $FUNC_CODE, "http://" ) )
{
$FUNC_IMAGE = "menu_url";
}
else if ( strstr( $FUNC_CODE, "file://" ) )
{
$FUNC_IMAGE = "winexe";
}
else if ( strstr( $FUNC_CODE, "/" ) )
{
$FUNC_IMAGE = substr( $FUNC_CODE, 0, strpos( $FUNC_CODE, "/" ) );
}
else
{
$FUNC_IMAGE = $FUNC_CODE;
}
++$COUNT_FUNC;
echo " <tr title=\"";
echo $FUNC_NAME;
echo "\">\r\n <td class=\"TableData\" nowrap>\r\n <input type=\"checkbox\" name=\"";
echo $MENU_ID;
echo "\" id=\"";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\" value=\"";
echo $FUNC_ID;
echo "\">\r\n <img src=\"/images/menu/";
echo $FUNC_IMAGE;
echo ".gif\" width=19 height=17> <label for=\"";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\">";
echo $FUNC_NAME;
echo "</label>\r\n";
if ( substr( $FUNC_CODE, 0, 1 ) == "@" )
{
$query2 = "SELECT * from SYS_FUNCTION where MENU_ID like '".$MENU_ID1."%' and length(MENU_ID)=6 order by MENU_ID";
$cursor2 = exequery( $connection, $query2 );
while ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$FUNC_ID = $ROW['FUNC_ID'];
$FUNC_NAME = $ROW['FUNC_NAME'];
$FUNC_CODE = $ROW['FUNC_CODE'];
if ( strstr( $FUNC_CODE, "http://" ) )
{
$FUNC_IMAGE = "menu_url";
}
else if ( strstr( $FUNC_CODE, "file://" ) )
{
$FUNC_IMAGE = "winexe";
}
else 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";
}
++$COUNT_FUNC;
echo " <br> \r\n <input type=\"checkbox\" name=\"";
echo $MENU_ID;
echo "\" id=\"";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\" value=\"";
echo $FUNC_ID;
echo "\">\r\n <img src=\"/images/menu/";
echo $FUNC_IMAGE;
echo ".gif\" width=19 height=17> <label for=\"";
echo $MENU_ID;
echo "_";
echo $COUNT_FUNC;
echo "\">";
echo $FUNC_NAME;
echo "</label>\r\n";
}
}
echo " </td>\r\n </tr>\r\n";
}
echo " </table>\r\n </td>\r\n";
}
echo " </tr>\r\n <tr>\r\n <td class=\"TableControl\" align=\"center\" colspan=\"50\">\r\n <input type=\"hidden\" value=\"";
echo $USER_PRIV;
echo "\" name=\"USER_PRIV\">\r\n <input type=\"button\" value=\"确定\" class=\"BigButton\" onclick=\"mysubmit();\"> \r\n <input type=\"button\" value=\"返回\" class=\"BigButton\" onclick=\"location='index.php'\">\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -