new.php

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

PHP
453
字号
<?
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  echo '
<html>
<head>
<title>新建用户</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript Language="JavaScript">
function CheckForm()
{
   if(document.form1.USER_ID.value=="")
   { alert("用户名不能为空!");
     return (false);
   }
   if(document.form1.USER_PRIV.value=="")
   { alert("角色不能为空!");
     return (false);
   }
   if(document.form1.USER_NAME.value=="")
   { alert("真实姓名不能为空!");
     return (false);
   }
   if(document.form1.USER_ID.';
  echo 'value==document.form1.BYNAME.value)
   { alert("用户名和别名不能相同!");
     return (false);
   }
   if(document.form1.THEME.value=="")
   { alert("界面主题不能为空!");
     return (false);
   }
}
function clear_dept()
{
  document.form1.TO_ID.value="";
  document.form1.TO_NAME.value="";
}
function LoadWindow()
{
  URL="/module/dept_select?PRIV_OP=1";
  loc_x=document.bod';
  echo 'y.scrollLeft+event.clientX-event.offsetX-100;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
  window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function select_dept()
{
   if (form1.POST_PRIV.value=="2")
       dept.style.display=\'\';
   else
       de';
  echo 'pt.style.display="none";
}
function clear_priv()
{
  document.form1.PRIV_ID.value="";
  document.form1.PRIV_NAME.value="";
}
function LoadPrivWindow()
{
  URL="/module/priv_select?PRIV_OP=1";
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;
  window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;';
  echo 'help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function select_priv()
{
   if(priv.style.display=="none")
      priv.style.display="";
   else
   	  priv.style.display="none";
}
function td_calendar(fieldname)
{
  myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
  mytop=document.body.scrollTop+event.clientY-eve';
  echo 'nt.offsetY+140;
  window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
';
  $query = (((''.'SELECT * from USER where USER_ID=\'').$LOGIN_USER_ID).'\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $POST_PRIV = $ROW['POST_PRIV'];
    $POST_DEPT = $ROW['POST_DEPT'];
  }
  $query = ((''.'SELECT * from USER_PRIV where USER_PRIV=').$LOGIN_USER_PRIV);
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $PRIV_NO = $ROW['PRIV_NO'];
  }
  $query = ((''.'SELECT * from DEPARTMENT where DEPT_ID=').$DEPT_ID);
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $DEPT_NAME = $ROW['DEPT_NAME'];
  }
  if (($DEPT_ID == 0))
  {
    $DEPT_NAME = '离职人员/外部人员';
  }
  echo '
<body class="bodycolor" topmargin="5" onload="document.form1.USER_ID.focus();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 新建用户 (';
  echo $DEPT_NAME;
  echo ')</span>
    </td>
  </tr>
</table>
<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3" align="center" >
  <form action="add.php"  method="post" name="form1" onsubmit="return CheckForm();">
   <tr>
    <td nowrap class="TableHeader" colspan="2"><img src="/images/green_arrow.gif" align="absMiddle"> 以下选项由管理员设置:</td>
   </tr>
   <tr>
    <td nowrap';
  echo ' class="TableContent" width="120">用户名:</td>
    <td nowrap class="TableContent">
        <input type="text" name="USER_ID" class="BigInput" size="10" maxlength="20">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableContent">真实姓名:</td>
    <td nowrap class="TableContent">
        <input type="text" name="USER_NAME" class="BigInput" size="10" maxlength="10">&nbsp;
    </td>
   </tr';
  echo '>
   <tr>
    <td nowrap class="TableContent">主角色:</td>
    <td nowrap class="TableContent">
        ';
  echo '<s';
  echo 'elect name="USER_PRIV" class="BigSelect">
';
  if (($LOGIN_USER_PRIV != '1'))
  {
    $query = (((''.'SELECT * from USER_PRIV where PRIV_NO>').$PRIV_NO).' and USER_PRIV!=1 order by PRIV_NO desc');
  }
  else
  {
    $query = 'SELECT * from USER_PRIV order by PRIV_NO desc';
  }
  $cursor = exequery ($connection, $query);
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $USER_PRIV1 = $ROW['USER_PRIV'];
    $PRIV_NAME = $ROW['PRIV_NAME'];
    echo '          <option value="';
    echo $USER_PRIV1;
    echo '">';
    echo $PRIV_NAME;
    echo '</option>
';
  }
  echo '      </select>&nbsp;&nbsp;<a href="javascript:select_priv()">指定辅助角色</a>
    </td>
   </tr>
   <tr id="priv" style="display:none;">
      <td nowrap class="TableData">辅助角色:</td>
      <td class="TableData">
        <input type="hidden" name="PRIV_ID" value="';
  echo $USER_PRIV_OTHER;
  echo '">
        <textarea cols=30 name="PRIV_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
  echo $USER_PRIV_OTHER_NAME;
  echo '</textarea>
        &nbsp;<input type="button" value="选 择" class="SmallButton" onClick="LoadPrivWindow()" title="选择角色" name="button">
        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_priv()" title="清空角色" name="button">
        <br>辅助角色仅用于扩展主角色的模块权限
      </td>
   </tr>
   <tr>
    <td nowrap class="TableContent">部门:</td>
    <td nowrap';
  echo ' class="TableContent">
        ';
  echo '<s';
  echo 'elect name="DEPT_ID" class="BigSelect">
';
  echo my_dept_tree (0, $DEPT_ID, 1);
  echo '         <option value="0" ';
  if (($DEPT_ID == 0))
  {
    echo 'selected';
  }
  echo '>离职人员/外部人员</option>
        </select>
        ';
  if (($DEPT_ID == 0))
  {
    echo '<br>如设置为离职人员/外部人员,将对其他用户不可见';
  }
  echo '    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">用户排序号:</td>
    <td nowrap class="TableData">
        <input type="text" name="USER_NO" class="BigInput" size="10" value="10" value="';
  echo $USER_NO;
  echo '">&nbsp;
        用于同角色用户的排序
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">管理范围:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="POST_PRIV" class="BigSelect" OnChange="select_dept()">
          <option value="0">本部门</option>
';
  if (($POST_PRIV == '1'))
  {
    echo '          <option value="1">全体</option>
          <option value="2">指定部门</option>
';
  }
  else
  {
    if (($POST_PRIV == '2'))
    {
      echo '          <option value="2">指定部门</option>
';
    }
  }
  echo '        </select>
        在管理型模块中起约束作用
    </td>
   </tr>
';
  if (($POST_PRIV != '0'))
  {
    echo '   <tr id="dept" style="display:none;">
      <td nowrap class="TableData">管理范围(部门):</td>
      <td class="TableData">
        <input type="hidden" name="TO_ID" value="';
    echo $TO_ID;
    echo '">
        <textarea cols=30 name="TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
    echo $TO_NAME;
    echo '</textarea>
        &nbsp;<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow()" title="选择部门" name="button">
        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_dept()" title="清空部门" name="button">
      </td>
    </tr>
';
  }
  echo '   <tr>
    <td nowrap class="TableData">访问控制:</td>
    <td nowrap class="TableData">
    	  <input type="checkbox" name="NOT_LOGIN" id="NOT_LOGIN" ';
  if ($NOT_LOGIN)
  {
    echo 'checked';
  }
  echo '><label for="NOT_LOGIN">禁止登录OA系统</label>&nbsp;
    	  <input type="checkbox" name="NOT_VIEW_USER" id="NOT_VIEW_USER" ';
  if ($NOT_VIEW_USER)
  {
    echo 'checked';
  }
  echo '><label for="NOT_VIEW_USER">禁止查看用户列表</label>&nbsp;
    	  <input type="checkbox" name="NOT_VIEW_TABLE" id="NOT_VIEW_TABLE" ';
  if ($NOT_VIEW_TABLE)
  {
    echo 'checked';
  }
  echo '><label for="NOT_VIEW_TABLE">禁止显示桌面</label>
        <input type="checkbox" name="USEING_KEY" id="USEING_KEY" ';
  if ($USEING_KEY)
  {
    echo 'checked';
  }
  echo '><label for="USEING_KEY">使用USB KEY登录</label>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">考勤排班类型:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="DUTY_TYPE" class="BigSelect">
';
  $query = 'SELECT * from ATTEND_CONFIG order by DUTY_TYPE';
  $cursor = exequery ($connection, $query);
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $DUTY_TYPE = $ROW['DUTY_TYPE'];
    $DUTY_NAME = $ROW['DUTY_NAME'];
    echo '          <option value="';
    echo $DUTY_TYPE;
    echo '">';
    echo $DUTY_NAME;
    echo '</option>
';
  }
  echo '        </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">IMA广播权限:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="CANBROADCAST" class="BigSelect">
          <option value="0">无</option>
';
  if (($POST_PRIV == '1'))
  {
    echo '          <option value="1">有</option>
';
  }
  echo '        </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">内部邮箱容量:</td>
    <td nowrap class="TableData">
        <input type="text" name="EMAIL_CAPACITY" class="BigInput" size="5" maxlength="11" value="100">&nbsp;MB
        为空则表示不限制大小
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">个人文件柜容量:</td>
    <td nowrap class="TableData">
        <input';
  echo ' type="text" name="FOLDER_CAPACITY" class="BigInput" size="5" maxlength="11" value="100">&nbsp;MB
        为空则表示不限制大小
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">绑定IP地址:</td>
    <td nowrap class="TableData">
        <input type="text" name="BIND_IP" class="BigInput" size="23" maxlength="23" value="">&nbsp;
        为空则该用户不绑定固定的IP地址
    </td>
   </tr>
 ';
  echo '  <tr>
    <td nowrap class="TableHeader" colspan="2"><img src="/images/green_arrow.gif" align="absMiddle"> 以下选项用户可自行设置:</td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">别名:</td>
    <td nowrap class="TableData">
        <input type="text" name="BYNAME" class="BigInput" size="10" maxlength="20"><br>
        用户可用此别名登录系统,别名不能与其他用户的别名或用户名相同
';
  echo '    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">密码:</td>
    <td nowrap class="TableData">
        <input type="password" name="PASSWORD" class="BigInput" size="10" maxlength="10">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">性别:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="SEX" class="BigSelect">
        <option value="0">男</option>
        <option value="1">女</option>
        </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">生日:</td>
    <td nowrap class="TableData">
        <input type="text" name="BIRTHDAY" size="10" maxlength="10" class="BigInput">
        <img src="/images/menu/calendar.gif" border="0" align="absMiddle" style="';
  echo 'cursor:hand" onclick="td_calendar(\'form1.BIRTHDAY\');">
    </td>
   </tr>
   <tr>
      <td nowrap class="TableData">界面主题:</td>
      <td class="TableData">
        ';
  echo '<s';
  echo 'elect name="THEME" class="BigSelect">
';
  $I = 0;
  if ($handle = opendir ('../../../theme'))
  {
    while ((false !== $dir_name = readdir ($handle)))
    {
      if (((($dir_name != '.') AND ($dir_name != '..')) AND is_dir (('../../../theme/'.$dir_name))))
      {
        $DIR_ARRAY[$I++] = $dir_name;
        continue;
      }
    }
    closedir ($handle);
  }
  if ((0 < sizeof ($DIR_ARRAY)))
  {
    sort ($DIR_ARRAY);
    reset ($DIR_ARRAY);
  }
  for ($I = 0; ($I < sizeof ($DIR_ARRAY)); ++$I)
  {
    $THEME_NAME = file_get_contents ((('../../../theme/'.$DIR_ARRAY[$I]).'/theme.ini'));
    echo '  <option value="';
    echo $DIR_ARRAY[$I];
    echo '" ';
    if (($DIR_ARRAY[$I] == $THEME))
    {
      echo 'selected';
    }
    echo '>';
    echo $THEME_NAME;
    echo '</option>
';
  }
  echo '        </select>
      </td>
    </tr>
   <tr>
      <td nowrap class="TableData"> 手机:</td>
      <td class="TableData">
        <input type="text" name="MOBIL_NO" size="16" maxlength="23" class="BigInput" value="';
  echo $MOBIL_NO;
  echo '">
        <input type="checkbox" name="MOBIL_NO_HIDDEN" id="MOBIL_NO_HIDDEN"><label for="MOBIL_NO_HIDDEN">手机号码不公开</label><br>
        填写后可接收OA系统发送的手机短信,手机号码不公开仍可接收短信,小灵通请加106及区号,如 106010xxxxxxxx
      </td>
    </tr>
   <tr>
    <td nowrap  class="TableControl" colspan="2" align="center">
        <input type="submit" value="新 建" class="BigButton" tit';
  echo 'le="新建用户" name="button">&nbsp;&nbsp;
        <input type="button" value="关 闭" class="BigButton" title="关闭窗口" onclick="window.close();">
    </td>
  </form>
</table>
</body>
</html>';
?>

⌨️ 快捷键说明

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