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

📄 dept_list.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 PHP
字号:
<?php

function dept_tree_list( $DEPT_ID, $PRIV_OP )
{
	global $DEEP_COUNT;
	$connection = openconnection( );
	$query = "SELECT * from DEPARTMENT where DEPT_PARENT={$DEPT_ID} order by DEPT_NO";
	$cursor = exequery( $connection, $query );
	$OPTION_TEXT = "";
	$DEEP_COUNT1 = $DEEP_COUNT;
	$DEEP_COUNT .= " ";
	while ( $ROW = mysql_fetch_array( $cursor ) )
	{
		++$COUNT;
		$DEPT_ID = $ROW['DEPT_ID'];
		$DEPT_NAME = $ROW['DEPT_NAME'];
		$DEPT_PARENT = $ROW['DEPT_PARENT'];
		$DEPT_NAME = str_replace( "<", "&lt", $DEPT_NAME );
		$DEPT_NAME = str_replace( ">", "&gt", $DEPT_NAME );
		$DEPT_NAME = stripslashes( $DEPT_NAME );
		if ( $PRIV_OP == 1 )
		{
			$DEPT_PRIV = is_dept_priv( $DEPT_ID );
		}
		else
		{
			$DEPT_PRIV = 1;
		}
		$OPTION_TEXT_CHILD = dept_tree_list( $DEPT_ID, $PRIV_OP );
		if ( $DEPT_PRIV == 1 )
		{
			$OPTION_TEXT .= "\r\n  <tr class=TableControl>\r\n    <td class='menulines' id='".$DEPT_ID."' name='".$DEPT_NAME."' onclick=javascript:click_dept('".$DEPT_ID."') style=cursor:hand>".$DEEP_COUNT1."├".$DEPT_NAME."</a></td>\r\n  </tr>";
		}
		if ( $OPTION_TEXT_CHILD != "" )
		{
			$OPTION_TEXT .= $OPTION_TEXT_CHILD;
		}
	}
	$DEEP_COUNT = $DEEP_COUNT1;
	return $OPTION_TEXT;
}

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
echo "\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<s";
echo "tyle>\r\n.menulines{}\r\n</style>\r\n\r\n";
echo "<s";
echo "cript Language=\"JavaScript\">\r\nvar parent_window = parent.dialogArguments;\r\n\r\nfunction click_dept(dept_id)\r\n{\r\n  TO_VAL=parent_window.form1.TO_ID.value;\r\n  targetelement=document.all(dept_id);\r\n  dept_name=targetelement.name;\r\n\r\n  if(TO_VAL.indexOf(\",\"+dept_id+\",\")<0 && TO_VAL.indexOf(dept_id+\",\")!=0)\r\n  {\r\n    parent_window.form1.TO_ID.value+=dept_id+\",\";\r\n    parent_window.form1.TO_NAME.value+=dep";
echo "t_name+\",\";\r\n    borderize_on(targetelement);\r\n  }\r\n  else\r\n  {\r\n    parent_window.form1.TO_ID.value=parent_window.form1.TO_ID.value.replace(dept_id+\",\",\"\");\r\n    parent_window.form1.TO_NAME.value=parent_window.form1.TO_NAME.value.replace(dept_name+\",\",\"\");\r\n    borderize_off(targetelement);\r\n  }\r\n}\r\n\r\nfunction borderize_on(targetelement)\r\n{\r\n color=\"#003FBF\";\r\n targetelement.style.borderColor=\"bl";
echo "ack\";\r\n targetelement.style.backgroundColor=color;\r\n targetelement.style.color=\"white\";\r\n targetelement.style.fontWeight=\"bold\";\r\n}\r\n\r\nfunction borderize_off(targetelement)\r\n{\r\n  targetelement.style.backgroundColor=\"\";\r\n  targetelement.style.borderColor=\"\";\r\n  targetelement.style.color=\"\";\r\n  targetelement.style.fontWeight=\"\";\r\n}\r\n\r\nfunction begin_set()\r\n{\r\n  TO_VAL=parent_window.form1.TO_ID.value";
echo ";\r\n  \r\n  if(TO_VAL==\"ALL_DEPT\")\r\n  {\r\n     parent_window.form1.TO_ID.value=\"\";\r\n     parent_window.form1.TO_NAME.value=\"\";\r\n  }\r\n\r\n  for (step_i=0; step_i<document.all.length; step_i++)\r\n  {\r\n    if(document.all(step_i).className==\"menulines\")\r\n    {\r\n       dept_id=document.all(step_i).id;\r\n       if(TO_VAL.indexOf(\",\"+dept_id+\",\")>0 || TO_VAL.indexOf(dept_id+\",\")==0)\r\n          borderize_on(docum";
echo "ent.all(step_i));\r\n    }\r\n  }\r\n}\r\n\r\nfunction add_all()\r\n{\r\n  TO_VAL=parent_window.form1.TO_ID.value;\r\n  for (step_i=0; step_i<document.all.length; step_i++)\r\n  {\r\n    if(document.all(step_i).className==\"menulines\")\r\n    {\r\n       dept_id=document.all(step_i).id;\r\n       dept_name=document.all(step_i).name;\r\n\r\n       if(TO_VAL.indexOf(\",\"+dept_id+\",\")<0 && TO_VAL.indexOf(dept_id+\",\")!=0)\r\n       {\r\n ";
echo "        parent_window.form1.TO_ID.value+=dept_id+\",\";\r\n         parent_window.form1.TO_NAME.value+=dept_name+\",\";\r\n         borderize_on(document.all(step_i));\r\n       }\r\n    }\r\n  }\r\n}\r\n\r\nfunction add_all_dept()\r\n{\r\n    parent_window.form1.TO_ID.value=\"ALL_DEPT\";\r\n    parent_window.form1.TO_NAME.value=\"所有部门\";\r\n    parent.close();\r\n}\r\n\r\nfunction del_all()\r\n{\r\n  for (step_i=0; step_i<document.all";
echo ".length; step_i++)\r\n  {\r\n    if(document.all(step_i).className==\"menulines\")\r\n    {\r\n       dept_id=document.all(step_i).id;\r\n       dept_name=document.all(step_i).name;\r\n       parent_window.form1.TO_ID.value=parent_window.form1.TO_ID.value.replace(dept_id+\",\",\"\");\r\n       parent_window.form1.TO_NAME.value=parent_window.form1.TO_NAME.value.replace(dept_name+\",\",\"\");\r\n       borderize_off(document";
echo ".all(step_i));\r\n    }\r\n  }\r\n}\r\n\r\n</script>\r\n</head>\r\n\r\n<body topmargin=\"1\" leftmargin=\"0\" class=\"bodycolor\" onload=\"begin_set()\">\r\n\r\n\r\n";
if ( $DEPT_ID == "" )
{
	$DEPT_ID = 0;
}
$OPTION_TEXT = dept_tree_list( $DEPT_ID, $PRIV_OP );
if ( $OPTION_TEXT == "" )
{
	message( "提示", "未定义或无可管理部门" );
	echo "   <div align=\"center\"><input type=\"button\" class=\"BigButton\" value=\"返回\" onclick=\"javascript:location='dept_list.php?PRIV_OP=";
	echo $PRIV_OP;
	echo "';\"></div>\r\n";
}
else
{
	echo " <table border=\"1\" cellspacing=\"0\" width=\"95%\" class=\"small\" cellpadding=\"3\"  bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\"  align=\"center\">\r\n\r\n";
	if ( $PRIV_OP == "" )
	{
		echo "   <tr class=\"TableContent\">\r\n     <td onclick=\"javascript:add_all_dept();\" style=\"cursor:hand\" align=\"center\">所有部门</td>\r\n   </tr>\r\n";
	}
	echo "   <tr class=\"TableContent\">\r\n     <td onclick=\"javascript:add_all();\" style=\"cursor:hand\" align=\"center\">全部添加</td>\r\n   </tr>\r\n   <tr class=\"TableContent\">\r\n     <td onclick=\"javascript:del_all();\" style=\"cursor:hand\" align=\"center\">全部删除</td>\r\n   </tr>\r\n";
	echo $OPTION_TEXT;
	if ( $DEPT_ID != 0 )
	{
		echo "   <tr class=\"TableContent\">\r\n     <td onclick=\"javascript:location='dept_list.php?PRIV_OP=";
		echo $PRIV_OP;
		echo "';\" style=\"cursor:hand\" align=\"center\">返回</td>\r\n   </tr>\r\n</table>\r\n";
	}
}
echo "\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -