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

📄 new.php

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

<html>
<head>
<title>新建图书</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script Language="JavaScript">
function CheckForm()
{
   if(document.form1.BOOK_NAME.value=="")
   { alert("书名不能为空!");
     return (false);
   }
   
   if(document.form1.BOOK_NO.value=="")
   { alert("编号不能为空!");
     return (false);
   }
}

function delete_all()
{
 msg='确认要删除全部图书吗?';
 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=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">

<?
  $connection=OpenConnection();
  $query = "select * from BOOK_TYPE";
  $cursor= exequery($connection,$query);
  if(!$ROW=mysql_fetch_array($cursor))
  {
?>
    <body class="bodycolor" topmargin="5">
<?
    Message("提示","请首先定义图书类别");
    Button_Back();
    exit;
  }
?>

<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"];
    }
?>

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span 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">
        <select name="DEPT_ID" class="BigSelect">
<?
      echo my_dept_tree(0,$LOGIN_DEPT_ID,0);
?>
        </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="<?=$BOOK_NAME?>">&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="<?=$BOOK_NO?>">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">图书类别:</td>
    <td nowrap class="TableData">
        <select 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"];

?>
          <option value="<?=$TYPE_ID1?>" <? if($TYPE_ID1==$TYPE_ID) echo "selected";?>><?=$TYPE_NAME?></option>
<?
      }
?>
        </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="<?=$AUTHOR?>">&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="<?=$ISBN?>">&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="<?=$PUB_HOUSE?>">&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="<?=$PUB_DATE?>">&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="<?=$AREA?>">&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="<?=$AMT?>">&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="<?=$PRICE?>">&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"><?=$BRIEF?></textarea>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">借阅范围:</td>
    <td nowrap class="TableData">
       <select name="OPEN" class="BigSelect">
          <option value="0" <?if($OPEN=="0"||$OPEN=="") echo "selected"?>>本部门 </option>
          <option value="1" <?if($OPEN=="1") echo "selected"?>>全体 </option>
       </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">借阅状态:</td>
    <td nowrap class="TableData">
       <select name="LEND" class="BigSelect">
          <option value="0" <?if($LEND=="0"||$LEND=="") echo "selected"?>>未借出 </option>
          <option value="1" <?if($LEND=="1") echo "selected"?>>已借出 </option>
       </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData" width="120">借阅人:</td>
    <td nowrap class="TableData">
        <input type="text" name="BORR_PERSON" class="BigInput" size="33" maxlength="100" value="<?=$BORR_PERSON?>">&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="<?=$MEMO?>">&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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -