borrowQuery.jsp
上传用户:toby828
上传日期:2015-06-26
资源大小:8558k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="com.dao.BorrowDAO" %>
  3. <%@ page import="com.actionForm.BorrowForm" %>
  4. <%@ page import="java.util.*"%>
  5. <html>
  6. <%
  7. Collection coll=(Collection)request.getAttribute("borrowQuery");
  8. %>
  9. <head>
  10. <title>图书馆管理系统</title>
  11. <link href="CSS/style.css" rel="stylesheet">
  12. <script src="JS/function.js"></script>
  13. <script language="javascript">
  14. function check(myform){
  15. if(myform.flag[0].checked==false && myform.flag[1].checked==false){
  16. alert("请选择查询方式!");return false;
  17. }
  18. if (myform.flag[1].checked){
  19. if(myform.sdate.value==""){
  20. alert("请输入开始日期");myform.sdate.focus();return false;
  21. }
  22. if(CheckDate(myform.sdate.value)){
  23. alert("您输入的开始日期不正确(如:2006-07-05)n 请注意闰年!");myform.sDate.focus();return false;
  24. }
  25. if(myform.edate.value==""){
  26. alert("请输入结束日期");myform.edate.focus();return false;
  27. }
  28. if(CheckDate(myform.edate.value)){
  29. alert("您输入的结束日期不正确(如:2006-07-05)n 请注意闰年!");myform.edate.focus();return false;
  30. }
  31. }
  32. }
  33. </script>
  34. </head>
  35. <body onLoad="clockon(bgclock)">
  36. <table width="778" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
  37.   <tr>
  38.     <td height="183">
  39. <%@include file="navigation.jsp"%>
  40. </td>
  41. </tr>
  42. <td>
  43. <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  44.   <tr>
  45.     <td valign="top" bgcolor="#FFFFFF"><table width="99%" height="510"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder_gray">
  46.   <tr>
  47.     <td height="510" valign="top" style="padding:5px;"><table width="98%" height="487"  border="0" cellpadding="0" cellspacing="0">
  48.       <tr>
  49.         <td height="22" valign="top" class="word_orange">当前位置:系统查询 &gt; 图书借阅查询 &gt;&gt;&gt;</td>
  50.       </tr>
  51.       <tr>
  52.         <td align="center" valign="top">
  53. <form name="myform" method="post" action="borrow.do?action=borrowQuery">
  54.           <table width="98%" height="67"  border="0" cellpadding="0" cellspacing="0" bgcolor="#E3F4F7" class="tableBorder_gray">
  55.             <tr>
  56.               <td rowspan="2" align="center">&nbsp;<img src="Images/search.gif" width="45" height="28"></td>
  57.               <td height="29"><input name="flag" type="checkbox" class="noborder" value="a" checked>
  58.                 请选择查询依据:
  59.                 <select name="f" class="wenbenkuang" id="f">
  60.                   <option value="barcode">图书条形码</option>
  61.                   <option value="bookname">图书名称</option>
  62.                   <option value="readerbarcode">读者条形码</option>
  63.                   <option value="readername">读者名称</option>
  64.                   </select>
  65.                   <input name="key" type="text" id="key" size="50">
  66.                   <input name="Submit" type="submit" class="btn_grey" value="查询" onClick="return check(myform)"></td>
  67.             </tr>
  68.             <tr>
  69.               <td height="26">
  70.                 <input name="flag" type="checkbox" class="noborder" value="b">
  71.                 借阅时间:                从
  72.                 <input name="sdate" type="text" id="sdate">
  73.                 到
  74.                 <input name="edate" type="text" id="edate">
  75.                 (日期格式为:2006-07-05)</td>
  76.             </tr>
  77.           </table>
  78. </form>
  79. <%
  80. if(coll==null || coll.isEmpty()){
  81. %>
  82.           <table width="100%" height="30"  border="0" cellpadding="0" cellspacing="0">
  83.             <tr>
  84.               <td height="36" align="center">暂无图书借阅信息!</td>
  85.             </tr>
  86.           </table>
  87.           <%
  88. }else{
  89.   //通过迭代方式显示数据
  90.   Iterator it=coll.iterator();
  91.   String bookname="";
  92.   String bookbarcode="";
  93.   String readerbar="";
  94.   String readername="";
  95.   String borrowTime="";
  96.   String backTime="";
  97.   int ifback=0;
  98.   String ifbackstr="";
  99.   %>
  100.           <table width="98%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolordark="#D2E3E6" bordercolorlight="#FFFFFF">
  101.   <tr align="center" bgcolor="#e3F4F7">
  102.     <td width="11%">图书条形码</td>
  103.     <td width="29%">图书名称</td>
  104.     <td width="15%">读者条形码</td>
  105.     <td width="13%">读者名称</td>
  106.     <td width="12%">借阅时间</td>
  107.     <td width="12%">应还时间</td>
  108.     <td width="8%">是否归还</td>
  109.   </tr>
  110. <%
  111.   while(it.hasNext()){
  112.     BorrowForm borrowForm=(BorrowForm)it.next();
  113. bookname=chStr.toChinese(borrowForm.getBookName());
  114. bookbarcode=borrowForm.getBookBarcode();
  115. readerbar=chStr.toChinese(borrowForm.getReaderBarcode());
  116. readername=chStr.toChinese(borrowForm.getReaderName());
  117. borrowTime=borrowForm.getBorrowTime();
  118. backTime=borrowForm.getBackTime();
  119. ifback=borrowForm.getIfBack();
  120. if(ifback==0){
  121. ifbackstr="未归还";
  122. }else{
  123. ifbackstr="已归还";
  124. }
  125. %>
  126.   <tr>
  127.     <td style="padding:5px;">&nbsp;<%=bookbarcode%></td>
  128.     <td style="padding:5px;"><%=bookname%></td>
  129.     <td style="padding:5px;">&nbsp;<%=readerbar%></td>
  130.     <td style="padding:5px;">&nbsp;<%=readername%></td>
  131.     <td style="padding:5px;">&nbsp;<%=borrowTime%></td>
  132.     <td style="padding:5px;">&nbsp;<%=backTime%></td>
  133.     <td align="center" style="padding:5px;">&nbsp;<%=ifbackstr%></td>
  134.   </tr>
  135. <%
  136.   }
  137. }
  138. %>
  139. </table>
  140.           </td>
  141.       </tr>
  142.     </table>
  143. </td>
  144.   </tr>
  145. </table><%@ include file="copyright.jsp"%></td>
  146.   </tr>
  147. </table>
  148. </td>
  149.   </tr>
  150. </table>
  151. </body>
  152. </html>