index.php

来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 168 行

PHP
168
字号
<?
  function dept_tree_list ($DEPT_ID, $PRIV_OP)
  {
    global $DEEP_COUNT;
    global $connection;
    $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 = htmlspecialchars ($DEPT_NAME);
      $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\' width=\'200\' id=\''.$DEPT_ID).'\' name=\'').$DEPT_NAME).'\' onclick=javascript:click_dept(\'').$DEPT_ID).'\') style=cursor:hand>').$DEEP_COUNT1).'├').$DEPT_NAME).'</a></td><td class=TableData>'));
        $query1 = (((''.'SELECT * from USER,USER_PRIV where DEPT_ID=').$DEPT_ID).' and USER.USER_PRIV=USER_PRIV.USER_PRIV');
        ($query1 .= ' order by PRIV_NO,USER_NO,USER_NAME');
        $cursor1 = exequery ($connection, $query1);
        while ($ROW = mysql_fetch_array ($cursor1))
        {
          $USER_ID = $ROW['USER_ID'];
          $USER_NAME = $ROW['USER_NAME'];
          $USER_NAME = htmlspecialchars ($USER_NAME);
          $USER_NAME = str_replace ('"', '&quot;', $USER_NAME);
          $USER_NAME = stripslashes ($USER_NAME);
          ($OPTION_TEXT .= (((((((('<U class=\'menulines\' id=\'USER_'.$USER_ID).'\' name=\'').$USER_NAME).'\' onclick="javascript:click_dept(\'USER_').$USER_ID).'\')" style=\'cursor:hand\'>').$USER_NAME).'</U>&nbsp;'));
        }
        ($OPTION_TEXT .= '&nbsp;</td></tr>');
      }
      if (($OPTION_TEXT_CHILD != ''))
      {
        ($OPTION_TEXT .= $OPTION_TEXT_CHILD);
        continue;
      }
    }
    $DEEP_COUNT = $DEEP_COUNT1;
    return $OPTION_TEXT;
  }
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>部门人员选择</title>
';
  echo '<s';
  echo 'tyle>
.menulines{}
</style>
';
  echo '<s';
  echo 'cript Language="JavaScript">
var parent_window = parent.dialogArguments;
function click_dept(dept_id)
{
  TO_VAL=parent_window.form1.';
  echo $ITEM;
  echo '.value;
  targetelement=document.all(dept_id);
  dept_name=targetelement.name;
  if(TO_VAL.indexOf(","+dept_name+",")>0 || TO_VAL.indexOf(dept_name+",")==0)
  {
    if(TO_VAL.indexOf(dept_name+",")==0)
    {
       parent_window.form1.';
  echo $ITEM;
  echo '.value=parent_window.form1.';
  echo $ITEM;
  echo '.value.replace(dept_name+",","");
       borderize_off(targetelement);
    }
    if(TO_VAL.indexOf(","+dept_name+",")>0)
    {
       parent_window.form1.';
  echo $ITEM;
  echo '.value=parent_window.form1.';
  echo $ITEM;
  echo '.value.replace(","+dept_name+",",",");
       borderize_off(targetelement);
    }
  }
  else
  {
    parent_window.form1.';
  echo $ITEM;
  echo '.value+=dept_name+",";
    borderize_on(targetelement);
  }
}
function borderize_on(targetelement)
{
 color="#003FBF";
 targetelement.style.borderColor="black";
 targetelement.style.backgroundColor=color;
 targetelement.style.color="white";
 targetelement.style.fontWeight="bold";
}
function borderize_off(targetelement)
{
  targetelement.style.backgroundColor="";
  targetelement.';
  echo 'style.borderColor="";
  targetelement.style.color="";
  targetelement.style.fontWeight="";
}
function begin_set()
{
  TO_VAL=parent_window.form1.';
  echo $ITEM;
  echo '.value;
  for (step_i=0; step_i<document.all.length; step_i++)
  {
    if(document.all(step_i).className=="menulines")
    {
       dept_name=document.all(step_i).name;
       if(TO_VAL.indexOf(","+dept_name+",")>0 || TO_VAL.indexOf(dept_name+",")==0)
          borderize_on(document.all(step_i));
    }
  }
}
</script>
</head>
<body topmargin="1" leftmargin="0" class="bodycolor" onlo';
  echo 'ad="begin_set()">
';
  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>
';
  }
  else
  {
    echo ' <table border="1" cellspacing="0" width="95%" class="small" cellpadding="3"  bordercolorlight="#000000" bordercolordark="#FFFFFF"  align="center">
';
    echo $OPTION_TEXT;
    if (($DEPT_ID != 0))
    {
      echo '   <tr class="TableContent">
     <td onclick="javascript:location=\'dept_list.php?PRIV_OP=';
      echo $PRIV_OP;
      echo '\';" style="cursor:hand" align="center">返回</td>
   </tr>
</table>
';
    }
  }
  echo '
</body>
</html>
';
?>

⌨️ 快捷键说明

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