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

图形图象

开发平台:

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 typename1="";
  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. BookForm bookForm=(BookForm)request.getAttribute("bookQueryif"); 
  41. %>
  42. <script language="jscript">
  43. function check(form){
  44. if(form.barcode.value==""){
  45. alert("请输入条形码!");form.barcode.focus();return false;
  46. }
  47. if(form.bookName.value==""){
  48. alert("请输入图书姓名!");form.bookName.focus();return false;
  49. }
  50. if(form.price.value==""){
  51. alert("请输入图书定价!");form.price.focus();return false;
  52. }
  53. }
  54. </script>
  55. <head>
  56. <title>图书馆管理系统</title>
  57. <link href="CSS/style.css" rel="stylesheet">
  58. </head>
  59. <body onLoad="clockon(bgclock)">
  60. <table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
  61.   <tr>
  62.     <td height="183">
  63. <%@include file="navigation.jsp"%>
  64. </td>
  65. </tr>
  66. <td>
  67. <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  68.   <tr>
  69.     <td valign="top" bgcolor="#FFFFFF"><table width="99%" height="510"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder_gray">
  70.   <tr>
  71.     <td height="510" valign="top" style="padding:5px;"><table width="98%" height="487"  border="0" cellpadding="0" cellspacing="0">
  72.       <tr>
  73.         <td height="22" valign="top" class="word_orange">当前位置:图书管理 &gt; 图书档案管理 &gt; 修改图书信息 &gt;&gt;&gt;</td>
  74.       </tr>
  75.       <tr>
  76.         <td align="center" valign="top"><table width="100%" height="493"  border="0" cellpadding="0" cellspacing="0">
  77.   <tr>
  78.     <td align="center" valign="top">
  79. <form name="form1" method="post" action="book.do?action=bookModify">
  80. <% int ID=bookForm.getId().intValue();
  81. String bookname=chStr.toChinese(bookForm.getBookName());
  82. String barcode=bookForm.getBarcode();
  83. if(barcode==null) barcode="";
  84. int TypeId=bookForm.getTypeId();
  85. String typename=chStr.toChinese(bookForm.getTypeName());
  86. String author=chStr.toChinese(bookForm.getAuthor());
  87. String translator=chStr.toChinese(bookForm.getTranslator());
  88. String ISBN=bookForm.getIsbn();
  89. String publishing=chStr.toChinese(bookForm.getPublishing());
  90. Float price=bookForm.getPrice();
  91. int pages=bookForm.getPage();
  92. int bookcaseid=bookForm.getBookcaseid();
  93. String bookcase=chStr.toChinese(bookForm.getBookcaseName());
  94. int storage=bookForm.getStorage();
  95. String inTime=bookForm.getInTime();
  96. String operator=chStr.toChinese(bookForm.getOperator());
  97.   %>
  98. <table width="600" height="432"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  99.       <tr>
  100.         <td width="173" align="center"><input name="id" type="hidden" id="id" value="<%=ID%>">
  101.           条&nbsp;形&nbsp;码:</td>
  102.         <td width="427" height="39">
  103.           <input name="barcode" type="text" id="barcode" value="<%=barcode%>"></td>
  104.       </tr>
  105.       <tr>
  106.         <td align="center">图书名称:</td>
  107.         <td height="39"><input name="bookName" type="text" id="bookName" value="<%=bookname%>" size="60">
  108.           * </td>
  109.       </tr>
  110.       <tr>
  111.         <td align="center">图书类型:</td>
  112.         <td>
  113. <select name="typeId" class="wenbenkuang" id="typeId">
  114. <%
  115.   while(it_type.hasNext()){
  116.     BookTypeForm bookTypeForm=(BookTypeForm)it_type.next();
  117. typeID=bookTypeForm.getId().intValue();
  118. typename1=chStr.toChinese(bookTypeForm.getTypeName());
  119. %> 
  120.           <option value="<%=typeID%>" <%if(TypeId==typeID) out.println("selected");%>><%=typename1%></option>
  121. <%}%> 
  122.         </select>        </td>
  123.       </tr>
  124.       <tr>
  125.         <td align="center">作者:</td>
  126.         <td><input name="author" type="text" id="author" value="<%=author%>"></td>
  127.       </tr>
  128.       <tr>
  129.         <td align="center">译者:</td>
  130.         <td><input name="translator" type="text" id="translator" value="<%=translator%>"></td>
  131.       </tr>
  132.       <tr>
  133.         <td align="center">出版社:</td>
  134.         <td><select name="isbn" class="wenbenkuang">
  135. <%
  136.   while(it_pub.hasNext()){
  137.     PublishingForm pubForm=(PublishingForm)it_pub.next();
  138. isbn=pubForm.getIsbn();
  139. pubname=chStr.toChinese(pubForm.getPubname());
  140. %> 
  141.           <option value="<%=isbn%>" <%if(isbn.equals(ISBN)) out.println("selected");%>><%=pubname%></option>
  142. <%}%> 
  143.         </select> </td>
  144.       </tr>
  145.       <tr>
  146.         <td align="center">价格:</td>
  147.         <td><input name="price" type="text" id="price" value="<%=price%>"> 
  148.           (元) </td>
  149.       </tr>
  150.       <tr>
  151.         <td align="center">页码:</td>
  152.         <td><input name="page" type="text" id="page" value="<%=pages%>"></td>
  153.       </tr>
  154.       <tr>
  155.         <td align="center">书架:</td>
  156.         <td><select name="bookcaseid" class="wenbenkuang" id="bookcaseid">
  157. <%
  158.   while(it_bookcase.hasNext()){
  159.     BookCaseForm bookCaseForm=(BookCaseForm)it_bookcase.next();
  160. bookcaseID=bookCaseForm.getId().intValue();
  161. bookcasename=chStr.toChinese(bookCaseForm.getName());
  162. %> 
  163.           <option value="<%=bookcaseID%>" <%if(bookcaseid==bookcaseID) out.println("selected");%>><%=bookcasename%></option>
  164. <%}%> 
  165.         </select>
  166.           <input name="operator" type="hidden" id="operator" value="<%=chStr.toChinese(manager)%>"></td>
  167.       </tr>
  168.       <tr>
  169.         <td align="center">库存总量:</td>
  170.         <td><input name="storage" type="text" id="storage" value="<%=storage%>"></td>
  171.       </tr>
  172.       <tr>
  173.         <td align="center">&nbsp;</td>
  174.         <td><input name="Submit" type="submit" class="btn_grey" value="保存" onClick="return check(form1)">
  175. &nbsp;
  176. <input name="Submit2" type="button" class="btn_grey" value="返回" onClick="history.back()"></td>
  177.       </tr>
  178.     </table>
  179. </form>
  180. </td>
  181.   </tr>
  182. </table></td>
  183.       </tr>
  184.     </table>
  185. </td>
  186.   </tr>
  187. </table><%@ include file="copyright.jsp"%></td>
  188.   </tr>
  189. </table>
  190. </td>
  191.  
  192. </table>
  193. <%}
  194. }
  195. }%>
  196. </body>
  197. </html>