⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit_priv.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 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";
echo "<s";
echo "cript>\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";
echo "()\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\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    ";
echo "    }\r\n    }\r\n  }\r\n\r\n  location=\"update_priv.php?FUNC_ID_STR=\"+ func_id_str +\"&USER_PRIV=";
echo $USER_PRIV;
echo "\";\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    <td class=\"Big\"><img src=\"/images/edit.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\">";
echo "<s";
echo "pan class=\"big3\"> 编辑角色权限 - (";
echo $PRIV_NAME;
echo ")</span>&nbsp;&nbsp;\r\n    <input type=\"button\" value=\"确定\" class=\"BigButton\" onclick=\"mysubmit();\">&nbsp;&nbsp;\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<table border=\"0\" cellspacing=\"2\" class=\"small\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableContent\">\r\n\r\n";
$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'];
	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 "\" onClick=\"check_all(this,'";
	echo $MENU_ID;
	echo "');\">\r\n        <img src=\"/images/menu/";
	echo $IMAGE;
	echo ".gif\" width=19 height=17>&nbsp;&nbsp;<b>";
	echo $MENU_NAME;
	echo "</b>\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;
		}
		echo "        <tr title=\"";
		echo $FUNC_NAME;
		echo "\">\r\n          <td class=\"TableData\" nowrap>\r\n          <input type=\"checkbox\" name=\"";
		echo $MENU_ID;
		echo "\" value=\"";
		echo $FUNC_ID;
		echo "\" ";
		if ( find_id( $USER_FUNC_ID_STR, $FUNC_ID ) )
		{
			echo "checked";
		}
		echo ">\r\n          <img src=\"/images/menu/";
		echo $FUNC_IMAGE;
		echo ".gif\" width=19 height=17>&nbsp;&nbsp;";
		echo $FUNC_NAME;
		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";
				}
				echo "          <br>&nbsp;&nbsp;&nbsp;&nbsp;\r\n          <input type=\"checkbox\" name=\"";
				echo $MENU_ID;
				echo "\" value=\"";
				echo $FUNC_ID;
				echo "\" ";
				if ( find_id( $USER_FUNC_ID_STR, $FUNC_ID ) )
				{
					echo "checked";
				}
				echo ">\r\n          <img src=\"/images/menu/";
				echo $FUNC_IMAGE;
				echo ".gif\" width=19 height=17>&nbsp;&nbsp;";
				echo $FUNC_NAME;
			}
		}
		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();\">&nbsp;&nbsp;\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 + -