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

📄 add_book.php

📁 一个小型图书管理系统
💻 PHP
字号:
<? 
//######################管理员添加图书##########################
include "config.php";
include "admin_auth.php";
 include "header.php";
 ?>
<link rel="stylesheet" href="style.css" type="text/css">

<table width="75%" border="0" cellspacing="1" cellpadding="0" height="314" bgcolor="#000000" align="center">
  <!--DWLayoutTable-->
  <tr> 
    <td width="24" bgcolor="#FFFFFF"> <div align="center" class="title"> 
        <p>&nbsp;</p>
      </div></td>
    <td width="557" bgcolor="#FFFFFF" height="24"> <div align="center" class="title">添加图书<font color="#FF0000" size="1">(为方便查询,请按以下格式填写)</font></div></td>
  </tr>
  <tr> 
    <td height="287" align="center" valign="middle" bgcolor="#FFFFFF" class="biao1">&nbsp; 
    </td>
    <td align="left" valign="top" bgcolor="#FFFFFF"> <table width="82%" border="0" cellspacing="1" cellpadding="0" height="287" class="text" bgcolor="#000000">
        <!--DWLayoutTable-->
        <form name="addbook" method="post" action="add_book.php">
          <tr> 
            <td width="85" class="dao3" height="28" bgcolor="#E4E4E4">书名:</td>
            <td width="334" bgcolor="#E4E4E4"> <input name="book_name" type="text" value="书的名字" size="25">
              * </td>
            <td width="100" valign="top" bgcolor="#E4E4E4"><!--DWLayoutEmptyCell-->&nbsp;</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td class="biao2" height="25">作者:</td>
            <td class="biao2" height="25"> <input name="author" type="text" value="书的作者" size="25">
              *</td>
            <td></td>
          </tr>
          <tr bgcolor="#E4E4E4"> 
            <td class="dao3" height="27">出版社:</td>
            <td height="27"> <input name="pub_addr" type="text" id="pub_addr" value="出版社" size="25">
              * </td>
            <td bgcolor="#E4E4E4"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td class="biao2" height="24">出版日期:</td>
            <td class="biao2" height="24"> <input name="pub_date" type="text" id="pub_date" value="1982-02-15" size="25">
              * </td>
            <td></td>
          </tr>
          <tr bgcolor="#E4E4E4"> 
            <td class="dao3" height="24">价格:</td>
            <td height="24"> <input name="price" type="text" id="price" value="¥" size="25">
              * </td>
            <td></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td class="biao2" height="27">册数:</td>
            <td class="biao2" height="27"> <input name="volumes" type="text" id="volumes" value="xx" size="25">
              * </td>
            <td></td>
          </tr>
          <tr bgcolor="#E4E4E4"> 
            <td class="dao3" height="22">分类号:</td>
            <td height="22" bgcolor="#E4E4E4"> <input name="sort_id" type="text" id="sort_id" size="25">
              * </td>
            <td></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" valign="top" class="biao2">状态:</td>
            <td valign="top" class="biao2"> <select name="status" id="status">
                <option selected>在架</option>
                <option>不在架</option>
              </select>
              * </td>
            <td></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="37" valign="top" bgcolor="#E4E4E4"><!--DWLayoutEmptyCell-->&nbsp;</td>
            <td valign="top" bgcolor="#E4E4E4" class="dao3"> <input type="hidden" name="add_book" value="添加图书"> 
              <input type="submit"  value="添加图书"> </td>
            <td></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="28"></td>
            <td><div align="center"><a href="admin.php"><font color="#000000" size="4"><strong>返回</strong></font></a></div></td>
            <td></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<?
 if ($book_name=="" || $author=="" || $pub_addr=="" || $pub_date=="" || $price=="" || $volumes=="" || $sort_id=="" || $status=="" ) 
{
	echo"<p align=\"center\"><font color=\"#FF0000\"><b><big>请把资料写完整</big></b></font></p>";
	exit;	
}
 else
 {
 $query=mysql_query("insert into $book_table values('','$book_name','$author','$pub_addr','$pub_date','$price','$volumes','$sort_id','$status')");
 if($query==true){
  echo "<p align=\"center\"><font color=\"#FF0000\"><b><big>图书添加成功!</big></b></font></p>";
  }
 }
?>
<? include "foot.php";?>

⌨️ 快捷键说明

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