equipment_searchresult.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:10k
源码类别:

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  4. <%@ page import="java.util.*"%>
  5. <%@ page import="java.sql.*"%>
  6. <%@ page import="com.vnex.intranet.util.*"%>
  7. <%@ page import="com.vnex.intranet.util.FieldUtil"%>
  8. <%@ page import="com.vnex.intranet.equipment.value.*"%>
  9. <%@ page import="com.vnex.intranet.equipment.process.*"%>
  10. <%
  11. HttpSession sess;
  12. String navBar;
  13. int start = 1;
  14. int rows = 10;
  15. EquipmentListValueBean equipmentlist;
  16. Collection eList;
  17. String action;
  18. String categoryId="";
  19. String categoryName="";
  20. String categoryName2=""; 
  21. String keyword = "";
  22. %>
  23. <jsp:useBean id="KeywordSearchProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="Application" />
  24. <%
  25. sess = request.getSession( false );
  26. if (request.getParameter("categoryId") != null )
  27. {
  28. categoryId = request.getParameter("categoryId");
  29. keyword = request.getParameter("categoryId");
  30. sess.setAttribute("categoryId",keyword);
  31. }
  32. if (request.getParameter("categoryName") != null)
  33. {
  34. categoryName2 = (request.getParameter("categoryName"));
  35. sess.setAttribute("categoryName",categoryName2);
  36. categoryName = categoryName2;
  37. }
  38. if ("true".equals(request.getParameter("cache")))
  39. {
  40. equipmentlist = (EquipmentListValueBean)sess.getAttribute("slist");    
  41.     start = Integer.parseInt(request.getParameter("start"));
  42.     categoryName = (String)sess.getAttribute("categoryName");
  43.     categoryId = (String)sess.getAttribute("categoryId");
  44.     equipmentlist = KeywordSearchProxy.searchEquipmentByKeyword(categoryId);
  45. sess.setAttribute("slist",equipmentlist);
  46. }
  47. else
  48. {
  49. equipmentlist = KeywordSearchProxy.searchEquipmentByKeyword(keyword);
  50. sess.setAttribute("slist",equipmentlist);
  51. }
  52. eList = equipmentlist.getEquipmentList();
  53. if (eList.size() < start && start > 10 )
  54. start = start - 10;
  55. %>
  56. <script language=JavaScript>
  57. function includeInvalid(str)
  58. {
  59. if (str.indexOf("'") == -1)
  60. {
  61. return false;
  62. }
  63. else
  64. {
  65. alert("包括非法字符’" );
  66. return true;
  67. }
  68. }
  69. function toSearch()
  70. {
  71. if (!(includeInvalid(myForm.keyword.value)))
  72. {
  73. myForm.action= "/mainctrl/equipmentSearchResult";
  74. return true;
  75. }
  76. else
  77. {
  78. return false;
  79. }
  80. }
  81. function toCategory()
  82. {
  83. myForm.action="/mainctrl/categoryList?pageName=equipmentSearchResult";
  84. myForm.submit();
  85. }
  86. function toDelete()
  87. {
  88. if (<%=eList.size()%> == 0)
  89. {
  90. alert("没有可供删除的项!");
  91. return false;
  92. }
  93. var j = -1;
  94. var sign = 1;
  95. if (myForm.check1.length>1)
  96. {
  97. for (i=0;i < myForm.check1.length;i++)
  98. if (myForm.check1[i].checked)
  99. j = i;
  100. }
  101. if (j == -1)
  102. {
  103. alert ("没有可供删除的选项!" );
  104. sign = 0;
  105. }
  106. }
  107. else
  108. {
  109. if (myForm.check1.checked)
  110. sign = 1;
  111. else
  112. {
  113. alert ("没有可供删除的选项!" );
  114. sign = 0
  115. }
  116. }
  117. if (sign == 1)
  118. {
  119. if (!confirm("真的删除这些记录吗?"))
  120. return false;
  121. myForm.action= "/mainctrl/equipmentsDeleteSuccess?categoryId=<%=categoryId%>&categoryName=<%=categoryName%>";
  122. myForm.submit();
  123. }
  124. }
  125. function checkAll(checkbox_select,checkbox_names)
  126. {
  127.       var items=checkbox_names.length;      
  128.       if(items>1)
  129.         {
  130.          for(i=0;i<items;i++) checkbox_names[i].checked=checkbox_select.checked;      
  131.         }
  132.       else
  133.        {
  134.           checkbox_names.checked=checkbox_select.checked;
  135.        }
  136. }  
  137. </script>
  138. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  139. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  140. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  141. <form name="myForm" method="post" action="" >
  142. <DIV align=center>  
  143.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  144.     <TBODY> 
  145.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  146.     <TR> 
  147.         <TD colSpan=3 align="center"><br>
  148.          <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  149.             <tr bgcolor="#fafafa"> 
  150.               <td> 
  151.             
  152.                 
  153.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  154.                    <tr bgcolor="#666666"> 
  155.                       <td colspan="2" height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;固定资产管理</font></td>
  156.                    </tr>  
  157.                    <tr> 
  158.                       <td colspan="2" height="30"><font class="strong" >&nbsp;类别:</font>&nbsp; 
  159.                       <input type="hidden" name="keyword" class="file" value="<%=categoryId%>">&nbsp;
  160.                       <input type="test" name="categoryName" class="file" readonly value="<%=categoryName%>">&nbsp;
  161.                       <input type="button" name="Submit2" value="选择" class="file" onClick="toCategory()")>&nbsp;&nbsp; 
  162.                       <input type="button" name="SubmitA" value="高级查询" class="file" style="width:60px" onClick="location='/mainctrl/equipmentAdvancedSearch'">&nbsp;&nbsp; 
  163.                       <input type="button" name="SubmitS" value="统计汇总" class="file" style="width:60px" onClick="location='/mainctrl/equipmentStat'">
  164.                     </td>
  165.                   </tr>
  166.                 </table>
  167.             
  168.             <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>
  169.             <tr bgcolor="#FFFFFF"> 
  170.                     <td colspan="6" height="30">&nbsp; 
  171.                      <input type="button" name="bAdd" value="新建" class="file" onClick="location='/mainctrl/equipmentAdd'">&nbsp;&nbsp; 
  172.                         <input type="button" name="bDelete" value="删除" class="file" onClick=toDelete()>&nbsp;&nbsp;                         
  173.                         <input type="button" name="bBatch" value="批量增加" class="file" style="width: 60px" onClick="location='/mainctrl/equipmentBatchAdd'">&nbsp;&nbsp; 
  174.                         <input type="button" name="bBatchUse" value="批量增加使用者" class="file" style="width: 95px" onClick="location='/mainctrl/equipmentBatchSearchResult'">
  175.                     </td>
  176.             </tr>
  177.             <tr align=middle> 
  178.               <td width="7%"><font  class="strong">选择</font></td>
  179.               <td width="10%"><font  class="strong">编号</font></td>
  180.               <td width="19%"><font  class="strong">名称</font></td>
  181.               <td width="23%"><font  class="strong">资产编号 </font></td>
  182.               <td width="18%"><font  class="strong">类别 </font></td>
  183.               <td width="23%"><font  class="strong">购入时间 </font></td>
  184.             </tr>
  185.             <%
  186.             
  187.              int i = 0;
  188.              int r;
  189.       if (start > eList.size() - (eList.size() % rows))
  190.       r = eList.size() % rows;
  191.       else
  192.         r = 10;
  193.    Iterator it = eList.iterator();
  194. while(i < start - 1) 
  195. {
  196. it.next();
  197. i ++;
  198. }
  199. i = 0;
  200.          while(i < r)
  201.             {
  202.             EquipmentValueBean eInfo= (EquipmentValueBean)it.next();
  203.             if (i % 2 == 0)
  204.             {
  205.             %>
  206.             <tr align=middle bgColor="#e0e0e0">
  207.             <%
  208.             }
  209.             else
  210.             {
  211.             %> 
  212.             <tr align=middle bgColor="#fafafa">
  213.             <%}%>
  214.               <td width="7%"> 
  215.                <input type="checkbox" name="check1" value=<%=eInfo.getId()%>><br>                
  216.               </td>
  217.               <td width="10%" ><a href="/mainctrl/equipmentDetail?equipmentId=<%=eInfo.getId()%>&simple=true&start=<%=start%>"><%=eInfo.getId()%></a></td>
  218.               <td width="19%" ><%=FieldUtil.shortenString(FieldUtil.filterScriptTag("" + eInfo.getEquipmentName()),15)%><br>
  219.               </td>
  220.               <td width="23%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag("" + eInfo.getEquipmentCode()),15)%></td>
  221.               <td width="18%" ><%=FieldUtil.filterScriptTag("" + eInfo.getCategoryName())%></td>
  222.               <td width="23%" ><%
  223.               if (eInfo.getBuyDate() != null) out.print(eInfo.getBuyDate().toString().substring(0,10));
  224.               %>
  225.               </td>
  226.             </tr>  
  227.                    
  228.             <%
  229.             i ++;
  230.             }
  231.             
  232.             %>
  233.             <%
  234.             if (eList.size() > 0)
  235.             {
  236.             %>
  237.             <tr align=middle>
  238.               <td colspan="6" bgcolor="#fafafa"> 
  239.                 <div align="left">
  240.                   &nbsp;&nbsp;<input type="checkbox" name="selectAll" value="checkbox" onClick= checkAll(selectAll,check1)>
  241.                   全选</div>
  242.               </td>
  243.             </tr>
  244.             <%
  245.             }
  246.             %>
  247.             <%
  248.                 action = "/mainctrl/equipmentSearchResult?cache=true&categoryId="+categoryId+"&categoryName="+categoryName;
  249. navBar = NavBar.makeNavbar(start,eList.size(),rows,action);  
  250.             %>
  251.             <tr align=middle> 
  252.               <td colspan="6" bgcolor="#e0e0e0"> 
  253.                 <div align="left">&nbsp;<%=navBar%>  
  254.                 </div>
  255.               </td>
  256.             </tr>             
  257.             
  258.           </table>
  259.           
  260.           </td>         
  261.           </tr>                              
  262.           </table>          
  263.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  264.        </TD>
  265.      </TR>
  266.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  267.     </TBODY> 
  268.   </TABLE>
  269.     <BR>
  270.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  271. </form>
  272. </DIV>
  273. </BODY>
  274. </HTML>