📄 index.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>选择部门</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.menulines{}
</style>
<script Language="JavaScript">
var parent_window = dialogArguments;
function click_dept(dept_id)
{
targetelement=document.all(dept_id);
dept_name=targetelement.name;
parent_window.form1.<?=$ID?>.value=dept_id;
parent_window.form1.<?=$DESC?>.value=dept_name;
window.close();
}
function borderize_on(targetelement)
{
color="#003FBF";
targetelement.style.borderColor="black";
targetelement.style.backgroundColor=color;
targetelement.style.color="white";
targetelement.style.fontWeight="bold";
}
function begin_set()
{
TO_VAL=parent_window.form1.<?=$ID?>.value;
for (step_i=0; step_i<document.all.length; step_i++)
{
if(document.all(step_i).className=="menulines")
{
dept_id=document.all(step_i).id;
if(TO_VAL==dept_id)
borderize_on(document.all(step_i));
}
}
}
</script>
</head>
<body topmargin="1" leftmargin="0" class="bodycolor" onload="begin_set()">
<?
//------ 递归显示部门列表,支持按管理范围显示 --------
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("<","<",$DEPT_NAME);
$DEPT_NAME=str_replace(">",">",$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.="
<tr class=TableControl>
<td class='menulines' id='".$DEPT_ID."' name='".$DEPT_NAME."' onclick=javascript:click_dept('".$DEPT_ID."') style=cursor:hand>".$DEEP_COUNT1."├".$DEPT_NAME."</a></td>
</tr>";
}
if($OPTION_TEXT_CHILD!="")
$OPTION_TEXT.=$OPTION_TEXT_CHILD;
}//while
$DEEP_COUNT=$DEEP_COUNT1;
return $OPTION_TEXT;
}
if($DEPT_ID=="")
$DEPT_ID=0;
$OPTION_TEXT=dept_tree_list($DEPT_ID,$PRIV_OP);
if($OPTION_TEXT=="")
{
Message("提示","未定义或无可管理部门");
?>
<div align="center"><input type="button" class="BigButton" value="返回" onclick="javascript:location='dept_list.php?PRIV_OP=<?=$PRIV_OP?>';"></div>
<?
}
else
{
?>
<table border="1" cellspacing="0" width="95%" class="small" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="center">
<?
echo $OPTION_TEXT;
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -