new.php

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

PHP
270
字号
<?
  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.BOOK_NAME.value=="")
   { alert("书名不能为空!");
     return (false);
   }
   if(document.form1.BOOK_NO.value=="")
   { alert("编号不能为空!");
     return (false);
   }
   if(document.form1.AMT.value=="")
   { alert("数量不能为空!");
     return (false);
   }
}
function delete_all()
{
 msg=\'确认要';
  echo '删除全部图书吗?\';
 if(window.confirm(msg))
 {
  URL="delete_all.php";
  window.location=URL;
 }
}
function td_calendar(fieldname)
{
  myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
  mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
  //window.open("/inc/calendar.php?FIELDNAME="+fieldname,"td_calendar","height=176,width=240,status=0,toolbar=no,menubar=';
  echo 'no,location=no,scrollbars=no,top="+mytop+",left="+myleft+",resizable=yes");
  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 BOOK_TYPE';
  $cursor = exequery ($connection, $query);
  if (!$ROW = mysql_fetch_array ($cursor))
  {
    echo '    <body class="bodycolor" topmargin="5">
';
    message ('提示', '请首先定义图书类别');
    button_back ();
    exit ();
  }
  echo '
<body class="bodycolor" topmargin="5" onload="document.form1.BOOK_NAME.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'];
    $POST_DEPT = $ROW['POST_DEPT'];
  }
  echo '
<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"> 新建图书</span>
    </td>
  </tr>
</table>
<table border="0" cellspacing="1" width="500" class="small" bgcolor="#000000" cellpadding="3" align="center" >
  <form action="add.php"  method="post" name="form1" onsubmit="return CheckForm();">
   <tr>
    <td nowrap class="TableData">部门:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="DEPT_ID" class="BigSelect">
';
  echo my_dept_tree (0, $LOGIN_DEPT_ID, 0);
  echo '        </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">书名:</td>
    <td nowrap class="TableData">
        <input type="text" name="BOOK_NAME" class="BigInput" size="33" maxlength="100" value="';
  echo $BOOK_NAME;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">图书编号:</td>
    <td nowrap class="TableData">
        <input type="text" name="BOOK_NO" class="BigInput" size="33" maxlength="100" value="';
  echo $BOOK_NO;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">图书类别:</td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="TYPE_ID" class="BigSelect">
';
  $query = 'SELECT * from BOOK_TYPE order by TYPE_ID';
  $cursor = exequery ($connection, $query);
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $TYPE_ID1 = $ROW['TYPE_ID'];
    $TYPE_NAME = $ROW['TYPE_NAME'];
    echo '          <option value="';
    echo $TYPE_ID1;
    echo '" ';
    if (($TYPE_ID1 == $TYPE_ID))
    {
      echo 'selected';
    }
    echo '>';
    echo $TYPE_NAME;
    echo '</option>
';
  }
  echo '        </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">作者:</td>
    <td nowrap class="TableData">
        <input type="text" name="AUTHOR" class="BigInput" size="33" maxlength="100" value="';
  echo $AUTHOR;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">ISBN号:</td>
    <td nowrap class="TableData">
        <input type="text" name="ISBN" class="BigInput" size="33" maxlength="100" value="';
  echo $ISBN;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">出版社:</td>
    <td nowrap class="TableData">
        <input type="text" name="PUB_HOUSE" class="BigInput" size="33" maxlength="100" value="';
  echo $PUB_HOUSE;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">出版日期:</td>
    <td nowrap class="TableData">
        <input type="text" name="PUB_DATE" class="BigInput" size="30" maxlength="10" value="';
  echo $PUB_DATE;
  echo '">&nbsp;
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.PUB_DATE\');">
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">存放地点:</td>
    <td nowrap class="TableData">
        <input type="text" name="AREA" class="BigInput" size="33" maxlength="100" value="';
  echo $AREA;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">数量:</td>
    <td nowrap class="TableData">
        <input type="text" name="AMT" class="BigInput" size="25" maxlength="11" value="';
  echo $AMT;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">价格:</td>
    <td nowrap class="TableData">
        <input type="text" name="PRICE" class="BigInput" size="25" maxlength="10" value="';
  echo $PRICE;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">内容简介:</td>
    <td nowrap class="TableData">
      <textarea cols=37 rows=3 name="BRIEF" class="BigInput" wrap="yes">';
  echo $BRIEF;
  echo '</textarea>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">借阅范围:</td>
    <td nowrap class="TableData">
       ';
  echo '<s';
  echo 'elect name="OPEN" class="BigSelect">
          <option value="0" ';
  if ((($OPEN == '0') OR ($OPEN == '')))
  {
    echo 'selected';
  }
  echo '>本部门 </option>
          <option value="1" ';
  if (($OPEN == '1'))
  {
    echo 'selected';
  }
  echo '>全体 </option>
       </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">借阅状态:</td>
    <td nowrap class="TableData">
       ';
  echo '<s';
  echo 'elect name="LEND" class="BigSelect">
          <option value="0" ';
  if ((($LEND == '0') OR ($LEND == '')))
  {
    echo 'selected';
  }
  echo '>未借出 </option>
          <option value="1" ';
  if (($LEND == '1'))
  {
    echo 'selected';
  }
  echo '>已借出 </option>
       </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">录入人:</td>
    <td nowrap class="TableData">
        <input type="text" name="BORR_PERSON" class="BigStatic" size="33" maxlength="100" value="';
  echo $LOGIN_USER_NAME;
  echo '" readonly>&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">备注:</td>
    <td nowrap class="TableData">
        <input type="text" name="MEMO" class="BigInput" size="33" maxlength="100" value="';
  echo $MEMO;
  echo '">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap  class="TableControl" colspan="2" align="center">
        <input type="submit" value="添加" class="BigButton" title="添加图书" name="button">&nbsp;
        <input type="button" value="返回" class="BigButton" onclick="location=\'index.php\'">
    </td>
   </tr>
  </form>
</table>
</body>
</html>
';
?>

⌨️ 快捷键说明

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