book_add.jsp
上传用户:ycdfsj258
上传日期:2022-08-04
资源大小:1094k
文件大小:6k
源码类别:

图形图象

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="com.dao.BookDAO" %>
  3. <%@ page import="com.dao.BookTypeDAO" %>
  4. <%@ page import="com.actionForm.BookForm" %>
  5. <%@ page import="com.actionForm.BookTypeForm"%>
  6. <%@ page import="com.dao.BookCaseDAO" %>
  7. <%@ page import="com.actionForm.BookCaseForm" %>
  8. <%@ page import="com.dao.PublishingDAO" %>
  9. <%@ page import="com.actionForm.PublishingForm" %>
  10. <%@ page import="java.util.*"%>
  11. <html>
  12. <%
  13. String str=null;
  14. BookTypeDAO bookTypeDAO=new BookTypeDAO();
  15. Collection coll_type=(Collection)bookTypeDAO.query(str);
  16. if(coll_type==null || coll_type.isEmpty()){
  17. out.println("<script>alert('请先录入图书类型信息!');history.back(-1);</script>");
  18. }else{
  19.   Iterator it_type=coll_type.iterator();
  20.   int typeID=0;
  21.   String typename="";
  22.   BookCaseDAO bookcaseDAO=new BookCaseDAO();
  23.   String str1=null;
  24.   Collection coll_bookcase=(Collection)bookcaseDAO.query(str1);
  25.   if(coll_bookcase==null || coll_bookcase.isEmpty()){
  26.    out.println("<script>alert('请先录入书架信息!');history.back(-1);</script>");
  27.   }else{
  28.    Iterator it_bookcase=coll_bookcase.iterator();
  29.    int bookcaseID=0;
  30.    String bookcasename="";
  31.   PublishingDAO pubDAO=new PublishingDAO();
  32.   String str2=null;
  33.   Collection coll_pub=(Collection)pubDAO.query(str2);
  34.   if(coll_pub==null || coll_pub.isEmpty()){
  35.    out.println("<script>alert('请先录入出版社信息!');history.back(-1);</script>");
  36.   }else{
  37.    Iterator it_pub=coll_pub.iterator();
  38.    String isbn="";
  39.    String pubname="";   
  40. %>
  41. <script language="jscript">
  42. function check(form){
  43. if(form.barcode.value==""){
  44. alert("请输入条形码1!");form.barcode.focus();return false;
  45. }
  46. if(form.bookName.value==""){
  47. alert("请输入图书姓名!");form.bookName.focus();return false;
  48. }
  49. if(form.price.value==""){
  50. alert("请输入图书定价!");form.price.focus();return false;
  51. }
  52. }
  53. </script>
  54. <head>
  55. <title>图书馆管理系统</title>
  56. <link href="CSS/style.css" rel="stylesheet">
  57. </head>
  58. <body onLoad="clockon(bgclock)">
  59. <table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
  60.   <tr>
  61.     <td height="183">
  62. <%@include file="navigation.jsp"%>
  63. </td>
  64. </tr>
  65. <td>
  66. <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  67.   <tr>
  68.     <td valign="top" bgcolor="#FFFFFF"><table width="99%" height="510"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder_gray">
  69.   <tr>
  70.     <td height="510" valign="top" style="padding:5px;"><table width="98%" height="487"  border="0" cellpadding="0" cellspacing="0">
  71.       <tr>
  72.         <td height="22" valign="top" class="word_orange">当前位置:图书管理 &gt; 图书档案管理 &gt; 添加图书信息 &gt;&gt;&gt;</td>
  73.       </tr>
  74.       <tr>
  75.         <td align="center" valign="top"><table width="100%" height="493"  border="0" cellpadding="0" cellspacing="0">
  76.   <tr>
  77.     <td align="center" valign="top">
  78. <form name="form1" method="post" action="book.do?action=bookAdd">
  79. <table width="600" height="432"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  80.       <tr>
  81.         <td width="173" align="center">条&nbsp;形&nbsp;码:</td>
  82.         <td width="427" height="39">
  83.           <input name="barcode" type="text" id="barcode"></td>
  84.       </tr>
  85.       <tr>
  86.         <td align="center">图书名称:</td>
  87.         <td height="39"><input name="bookName" type="text" id="bookName" size="50">
  88.           * </td>
  89.       </tr>
  90.       <tr>
  91.         <td align="center">图书类型:</td>
  92.         <td>
  93. <select name="typeId" class="wenbenkuang" id="typeId">
  94. <%
  95.   while(it_type.hasNext()){
  96.     BookTypeForm bookTypeForm=(BookTypeForm)it_type.next();
  97. typeID=bookTypeForm.getId().intValue();
  98. typename=chStr.toChinese(bookTypeForm.getTypeName());
  99. %> 
  100.           <option value="<%=typeID%>"><%=typename%></option>
  101. <%}%> 
  102.         </select>        </td>
  103.       </tr>
  104.       <tr>
  105.         <td align="center">作者:</td>
  106.         <td><input name="author" type="text" id="author" size="40"></td>
  107.       </tr>
  108.       <tr>
  109.         <td align="center">译者:</td>
  110.         <td><input name="translator" type="text" id="translator" size="40"></td>
  111.       </tr>
  112.       <tr>
  113.         <td align="center">出版社:</td>
  114.         <td><select name="isbn" class="wenbenkuang">
  115. <%
  116.   while(it_pub.hasNext()){
  117.     PublishingForm pubForm=(PublishingForm)it_pub.next();
  118. isbn=pubForm.getIsbn();
  119. pubname=chStr.toChinese(pubForm.getPubname());
  120. %> 
  121.           <option value="<%=isbn%>"><%=pubname%></option>
  122. <%}%> 
  123.         </select> </td>
  124.       </tr>
  125.       <tr>
  126.         <td align="center">价格:</td>
  127.         <td><input name="price" type="text" id="price"> 
  128.           (元) </td>
  129.       </tr>
  130.       <tr>
  131.         <td align="center">页码:</td>
  132.         <td><input name="page" type="text" id="page"></td>
  133.       </tr>
  134.       <tr>
  135.         <td align="center">书架:</td>
  136.         <td><select name="bookcaseid" class="wenbenkuang" id="bookcaseid">
  137. <%
  138.   while(it_bookcase.hasNext()){
  139.     BookCaseForm bookCaseForm=(BookCaseForm)it_bookcase.next();
  140. bookcaseID=bookCaseForm.getId().intValue();
  141. bookcasename=chStr.toChinese(bookCaseForm.getName());
  142. %> 
  143.           <option value="<%=bookcaseID%>"><%=bookcasename%></option>
  144. <%}%> 
  145.         </select>
  146.           <input name="operator" type="hidden" id="operator" value="<%=chStr.toChinese(manager)%>"></td>
  147.       </tr>
  148.       <tr>
  149.         <td align="center">库存总量:</td>
  150.         <td><input name="storage" type="text" id="storage"></td>
  151.       </tr>
  152.       <tr>
  153.         <td align="center">&nbsp;</td>
  154.         <td><input name="Submit" type="submit" class="btn_grey" value="保存" onClick="return check(form1)">
  155. &nbsp;
  156. <input name="Submit2" type="button" class="btn_grey" value="返回" onClick="history.back()"></td>
  157.       </tr>
  158.     </table>
  159. </form>
  160. </td>
  161.   </tr>
  162. </table></td>
  163.       </tr>
  164.     </table>
  165. </td>
  166.   </tr>
  167. </table><%@ include file="copyright.jsp"%></td>
  168.   </tr>
  169. </table>
  170. </td>
  171.  
  172. </table>
  173. <%}
  174. }
  175. }%>
  176. </body>
  177. </html>