dept_edit.php

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

PHP
176
字号
<?
  include_once 'inc/reg_check.php';
  if (($OA_REG_ON != 2008))
  {
    exit ();
  }
  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.DEPT_NO.value=="")
   { alert("部门排序号不能为空!");
     return (false);
   }
   if(document.form1.DEPT_NAME.value=="")
   { alert("部门名称不能为空!");
     return (false);
   }
}
function delete_dept(DEPT_ID)
{
  msg=\'确认要删除该部门/成员单位么?这将同时删除所有下级部门和部门中的用户!\';
  if(window.';
  echo 'confirm(msg))
  {
    url="delete.php?DEPT_ID="+DEPT_ID;
    location=url;
  }
}
</script>
</head>
<body class="bodycolor" topmargin="5" onload="document.form1.DEPT_NO.focus();">
';
  $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'];
  }
  $query = ((''.'SELECT * from DEPARTMENT where DEPT_ID=').$DEPT_ID);
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $DEPT_NAME = $ROW['DEPT_NAME'];
    $TEL_NO = $ROW['TEL_NO'];
    $FAX_NO = $ROW['FAX_NO'];
    $DEPT_NO = $ROW['DEPT_NO'];
    $DEPT_PARENT = $ROW['DEPT_PARENT'];
    $DEPT_FUNC = $ROW['DEPT_FUNC'];
  }
  $query = (((''.'SELECT * from DEPARTMENT where DEPT_ID=').$DEPT_ID).' order by DEPT_NO');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $LOCATION_NAME = $ROW['DEPT_NAME'];
  }
  echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/edit.gif" width="20" HEIGHT="22">';
  echo '<s';
  echo 'pan class="big3"> 编辑部门/成员单位 - [';
  echo $LOCATION_NAME;
  echo ']</span>
    </td>
  </tr>
</table>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center" >
  <form action="update.php"  method="post" name="form1" onsubmit="return CheckForm();">
   <tr>
    <td nowrap class="TableData">部门排序号:</td>
    <td nowrap class="TableData">
        <input type="text" name="DEPT_NO" class="BigInput" size="10" max';
  echo 'length="200" value="';
  echo $DEPT_NO;
  echo '">&nbsp;用于处于同一层次部门的排序,以及用户列表的排序
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">部门名称:</td>
    <td nowrap class="TableData">
        <input type="text" name="DEPT_NAME" class="BigInput" size="25" maxlength="25" value="';
  echo $DEPT_NAME;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">电话:</td>
    <td nowrap class="TableData">
        <input type="text" name="TEL_NO" class="BigInput" size="25" maxlength="25" value="';
  echo $TEL_NO;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">传真:</td>
    <td nowrap class="TableData">
        <input type="text" name="FAX_NO" class="BigInput" size="25" maxlength="25" value="';
  echo $FAX_NO;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">上级部门:</td>
      <td class="TableData">
        ';
  echo '<s';
  echo 'elect name="DEPT_PARENT" class="BigSelect">
';
  if (($POST_PRIV == 1))
  {
    echo '           <option value="0">无</option>
';
  }
  $DEPT_STR = my_dept_tree (0, $DEPT_PARENT, 1, $DEPT_ID);
  $POS1 = strpos ($DEPT_STR, (((''.'<option value=').$DEPT_ID).'>'));
  $POS2 = strpos ($DEPT_STR, '</option>', $POS1);
  $DEPT_STR1 = substr ($DEPT_STR, $POS1, (($POS2 - $POS1) + 9));
  $DEPT_STR = str_replace ($DEPT_STR1, '', $DEPT_STR);
  echo $DEPT_STR;
  echo '        </select>
      </td>
   </tr>
   <tr>
    <td nowrap class="TableData">部门职能:</td>
    <td nowrap class="TableData">
        <textarea name="DEPT_FUNC" class="BigInput" cols="40" rows="3">';
  echo $DEPT_FUNC;
  echo '</textarea>
    </td>
   </tr>
   <tr>
    <td nowrap  class="TableControl" colspan="2" align="center">
        <input type="hidden" name="DEPT_ID" value="';
  echo $DEPT_ID;
  echo '">
        <input type="submit" value="保存修改" class="BigButton" title="保存修改" name="button">
    </td>
  </form>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
 <tr>
   <td background="/images/dian1.gif" width="100%"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img sr';
  echo 'c="/images/menu/system.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 当前部门/成员单位 - 相关操作</span>
    </td>
  </tr>
</table>
<br>
<div align="center">
   <input type="button" value="新建下级部门/成员单位" class="BigButton" onClick="location=\'dept_new.php?DEPT_ID=';
  echo $DEPT_ID;
  echo '\';" title="新建下级部门/成员单位"><br><br>
   <input type="button" value="删除当前部门/成员单位" class="BigButton" onClick="delete_dept(\'';
  echo $DEPT_ID;
  echo '\')" title="删除当前部门/成员单位">
</div>
</body>
</html>';
?>

⌨️ 快捷键说明

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