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

📄 user_define.php

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<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
{
   $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()
{
  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;
       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()
{
  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")
    {
       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));
       }
    }
  }
}

function set_user()
{
  URL="set_user.php";
  myleft=(screen.availWidth-600)/2;
  window.open(URL,null,"height=450,width=600,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
<body class="panel" topmargin="0" leftmargin="0" onload="begin_set()">

<?
//============================ 显示已定义用户 =======================================
$query = "SELECT * from USER_GROUP where GROUP_ID=$GROUP_ID";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
   $GROUP_NAME=$ROW["GROUP_NAME"];
   $USER_STR=$ROW["USER_STR"];
}
$USER_ID_ARRAY=explode(",",$USER_STR);
$USER_COUNT=sizeof($USER_ID_ARRAY)-1;
?>
<table border="1" cellspacing="0" width="100%" class="small" cellpadding="3"  bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr class="TableHeader">
  <td colspan="2" align="center"><?=$GROUP_NAME?></td>
</tr>
<?
if($USER_COUNT==0)
{
?>
<tr class="TableContent">
  <td style="cursor:hand" align="center" colspan="2">尚未添加用户</td>
</tr>
<?
   exit;
}
?>
<tr class="TableContent">
  <td onclick="javascript:add_all();" style="cursor:hand" align="center" colspan="2">全部添加</td>
</tr>
<tr class="TableContent">
  <td onclick="javascript:del_all();" style="cursor:hand" align="center" colspan="2">全部删除</td>
</tr>
<?
for($I=0;$I<$USER_COUNT;$I++)
{
 $query = "SELECT * from USER where USER_ID='$USER_ID_ARRAY[$I]'";
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
 {
    $DEPT_ID=$ROW["DEPT_ID"];
    $USER_NAME=$ROW["USER_NAME"];
 }

 $query = "SELECT * from DEPARTMENT where DEPT_ID='$DEPT_ID'";
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
    $DEPT_NAME=$ROW["DEPT_NAME"];
?>
<tr id="<?=$USER_ID_ARRAY[$I]?>" name="<?=$USER_NAME?>"  onclick="javascript:click_user('<?=$USER_ID_ARRAY[$I]?>')" class="menulines" style="cursor:hand" align="center">
  <td><?=$DEPT_NAME?></td><td><?=$USER_NAME?></td>
</tr>
<?
}
?>
</table>
</body>
</html>

⌨️ 快捷键说明

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