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

📄 user.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once("inc/auth.php");
?>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.menulines{}
</style>

<script Language="JavaScript">
var parent_window = parent.dialogArguments;


<?
if($ID==1)
{
   $TO_ID="SECRET_TO_ID";
   $TO_NAME="SECRET_TO_NAME";
}
else if($ID==2)
{
   $TO_ID="COPY_TO_ID";
   $TO_NAME="COPY_TO_NAME";
}
else if($ID==3)
{
   $TO_ID="TO_ID3";
   $TO_NAME="TO_NAME3";
}
else
{
   $TO_ID="TO_ID";
   $TO_NAME="TO_NAME";
}
?>

function click_user(user_id)
{
  TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
  targetelement=document.all(user_id);
  user_name=targetelement.name;
  if(TO_VAL.indexOf(","+user_id+",")>0 || TO_VAL.indexOf(user_id+",")==0)
  {
    if(TO_VAL.indexOf(user_id+",")==0)
    {
       parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(user_id+",","");
       parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(user_name+",","");
       borderize_off(targetelement);
    }
    if(TO_VAL.indexOf(","+user_id+",")>0)
    {
       parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(","+user_id+",",",");
       parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(","+user_name+",",",");
       borderize_off(targetelement);
    }
  }
  else
  {
    parent_window.form1.<?=$TO_ID?>.value+=user_id+",";
    parent_window.form1.<?=$TO_NAME?>.value+=user_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.style.borderColor="";
  targetelement.style.color="";
  targetelement.style.fontWeight="";
}

function begin_set()
{
  TO_VAL=parent_window.form1.<?=$TO_ID?>.value;

  for (step_i=0; step_i<document.all.length; step_i++)
  {
    if(document.all(step_i).className=="menulines")
    {
       user_id=document.all(step_i).id;
       if(TO_VAL.indexOf(","+user_id+",")>0 || TO_VAL.indexOf(user_id+",")==0)
          borderize_on(document.all(step_i));
    }
  }
}

function add_all(flag)
{
  TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
  for (step_i=0; step_i<document.all.length; step_i++)
  {
    if(document.all(step_i).className=="menulines")
    {
       if(flag!=document.all(step_i).flag)
          continue;
       user_id=document.all(step_i).id;
       user_name=document.all(step_i).name;

       if(TO_VAL.indexOf(","+user_id+",")<0 && TO_VAL.indexOf(user_id+",")!=0)
       {
         parent_window.form1.<?=$TO_ID?>.value+=user_id+",";
         parent_window.form1.<?=$TO_NAME?>.value+=user_name+",";
         borderize_on(document.all(step_i));
       }
    }
  }
}

function del_all(flag)
{
  for (step_i=0; step_i<document.all.length; step_i++)
  {
    TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
    if(document.all(step_i).className=="menulines")
    {
       if(flag!=document.all(step_i).flag)
          continue;
       user_id=document.all(step_i).id;
       user_name=document.all(step_i).name;
       if(TO_VAL.indexOf(user_id+",")==0)
       {
          parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(user_id+",","");
          parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(user_name+",","");
          borderize_off(document.all(step_i));
       }
       if(TO_VAL.indexOf(","+user_id+",")>0)
       {
          parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(","+user_id+",",",");
          parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(","+user_name+",",",");
          borderize_off(document.all(step_i));
       }
    }
  }
}
</script>
</head>

<body class="bodycolor" topmargin="1" leftmargin="0" onload="begin_set()">

<?
 if($DEPT_ID=="")
    $DEPT_ID=$LOGIN_DEPT_ID;

 //============================ 显示人员信息 =======================================
 if($USER_PRIV=="")
 {
    if($MANAGE_FLAG)
       $query = "SELECT * from USER,USER_PRIV where DEPT_ID=$DEPT_ID and USER.USER_PRIV=USER_PRIV.USER_PRIV order by PRIV_NO,USER_NO,USER_NAME";
    else
       $query = "SELECT * from USER,USER_PRIV where DEPT_ID=$DEPT_ID and USER.USER_PRIV=USER_PRIV.USER_PRIV and NOT_LOGIN!='1' order by PRIV_NO,USER_NO,USER_NAME";
    $query1 = "select * from DEPARTMENT where DEPT_ID=$DEPT_ID";
    $cursor1= exequery($connection,$query1);
    if($ROW=mysql_fetch_array($cursor1))
       $TITLE=$ROW["DEPT_NAME"];
 }
 else
 {
    if($MANAGE_FLAG)
       $query = "SELECT * from USER where USER_PRIV='$USER_PRIV' and DEPT_ID!=0 order by USER_NO,USER_NAME";
    else
       $query = "SELECT * from USER where USER_PRIV='$USER_PRIV' and DEPT_ID!=0 and NOT_LOGIN!='1' order by USER_NO,USER_NAME";
    $query1 = "select * from USER_PRIV where USER_PRIV='$USER_PRIV'";
    $cursor1= exequery($connection,$query1);
    if($ROW=mysql_fetch_array($cursor1))
       $TITLE=$ROW["PRIV_NAME"];
 }
?>

<table border="1" cellspacing="0" width="100%" class="small" cellpadding="3"  bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr class="TableHeader">
  <td colspan="2" align="center"><b><?=$TITLE?></b></td>
</tr>

<?
 $cursor= exequery($connection,$query);
 $USER_COUNT=0;
 while($ROW=mysql_fetch_array($cursor))
 {
    $USER_COUNT++;
    $USER_ID=$ROW["USER_ID"];
    $USER_NAME=$ROW["USER_NAME"];

    if($USER_COUNT==1)
    {
?>
<tr class="TableContent">
  <td onclick="javascript:add_all('1');" style="cursor:hand" align="center">全部添加</td>
</tr>
<tr class="TableContent">
  <td onclick="javascript:del_all('1');" style="cursor:hand" align="center">全部删除</td>
</tr>
<?
    }
?>

<tr class="TableControl">
  <td class="menulines" id="<?=$USER_ID?>" name="<?=$USER_NAME?>" flag="1" align="center" onclick="javascript:click_user('<?=$USER_ID?>')" style="cursor:hand">
  <?=$USER_NAME?>
  </td>
</tr>

<?
 }


//============================ 显示辅助角色 =======================================
if($USER_PRIV!="")
{
   $query = "SELECT * from USER where (USER_PRIV_OTHER like '$USER_PRIV,%' or USER_PRIV_OTHER like '%,$USER_PRIV,%') and USER_PRIV!='$USER_PRIV' and DEPT_ID!=0 ";
   if(!$MANAGE_FLAG)
       $query.= " and NOT_LOGIN!='1'";
   $query.= " order by USER_NO,USER_NAME";
  
   $cursor= exequery($connection,$query);
   $USER_COUNT1=0;
   while($ROW=mysql_fetch_array($cursor))
   {
      $USER_COUNT++;
      $USER_COUNT1++;
      $USER_ID=$ROW["USER_ID"];
      $USER_NAME=$ROW["USER_NAME"];
  
      if($USER_COUNT1==1)
      {
?>
<tr class="TableHeader">
  <td colspan="2" align="center"><b>辅助角色</b></td>
</tr>
<tr class="TableContent">
  <td onclick="javascript:add_all('2');" style="cursor:hand" align="center">全部添加</td>
</tr>
<tr class="TableContent">
  <td onclick="javascript:del_all('2');" style="cursor:hand" align="center">全部删除</td>
</tr>
<?
      }
?>

<tr class="TableControl">
  <td class="menulines" id="<?=$USER_ID?>" name="<?=$USER_NAME?>" flag="2" align="center" onclick="javascript:click_user('<?=$USER_ID?>')" style="cursor:hand">
  <?=$USER_NAME?>
  </td>
</tr>

<?
   }//while
}//if

if($USER_COUNT==0)
{
?>
<tr class="TableControl">
  <td align="center">未定义用户</td>
</tr>
<?
}
?>

</table>
</body>
</html>

⌨️ 快捷键说明

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