equipment_searchresult.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:10k
源码类别:
电子政务应用
开发平台:
Java
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <%@ page import="java.util.*"%>
- <%@ page import="java.sql.*"%>
- <%@ page import="com.vnex.intranet.util.*"%>
- <%@ page import="com.vnex.intranet.util.FieldUtil"%>
- <%@ page import="com.vnex.intranet.equipment.value.*"%>
- <%@ page import="com.vnex.intranet.equipment.process.*"%>
- <%
- HttpSession sess;
- String navBar;
- int start = 1;
- int rows = 10;
- EquipmentListValueBean equipmentlist;
- Collection eList;
- String action;
- String categoryId="";
- String categoryName="";
- String categoryName2="";
- String keyword = "";
- %>
- <jsp:useBean id="KeywordSearchProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="Application" />
- <%
- sess = request.getSession( false );
- if (request.getParameter("categoryId") != null )
- {
- categoryId = request.getParameter("categoryId");
- keyword = request.getParameter("categoryId");
- sess.setAttribute("categoryId",keyword);
- }
- if (request.getParameter("categoryName") != null)
- {
- categoryName2 = (request.getParameter("categoryName"));
- sess.setAttribute("categoryName",categoryName2);
- categoryName = categoryName2;
- }
- if ("true".equals(request.getParameter("cache")))
- {
- equipmentlist = (EquipmentListValueBean)sess.getAttribute("slist");
- start = Integer.parseInt(request.getParameter("start"));
- categoryName = (String)sess.getAttribute("categoryName");
- categoryId = (String)sess.getAttribute("categoryId");
- equipmentlist = KeywordSearchProxy.searchEquipmentByKeyword(categoryId);
- sess.setAttribute("slist",equipmentlist);
- }
- else
- {
- equipmentlist = KeywordSearchProxy.searchEquipmentByKeyword(keyword);
- sess.setAttribute("slist",equipmentlist);
- }
- eList = equipmentlist.getEquipmentList();
- if (eList.size() < start && start > 10 )
- start = start - 10;
- %>
- <script language=JavaScript>
- function includeInvalid(str)
- {
- if (str.indexOf("'") == -1)
- {
- return false;
- }
- else
- {
- alert("包括非法字符’" );
- return true;
- }
- }
- function toSearch()
- {
- if (!(includeInvalid(myForm.keyword.value)))
- {
- myForm.action= "/mainctrl/equipmentSearchResult";
- return true;
- }
- else
- {
- return false;
- }
- }
- function toCategory()
- {
- myForm.action="/mainctrl/categoryList?pageName=equipmentSearchResult";
- myForm.submit();
- }
- function toDelete()
- {
- if (<%=eList.size()%> == 0)
- {
- alert("没有可供删除的项!");
- return false;
- }
- var j = -1;
- var sign = 1;
- if (myForm.check1.length>1)
- {
- for (i=0;i < myForm.check1.length;i++)
- {
- if (myForm.check1[i].checked)
- j = i;
- }
- if (j == -1)
- {
- alert ("没有可供删除的选项!" );
- sign = 0;
- }
- }
- else
- {
- if (myForm.check1.checked)
- sign = 1;
- else
- {
- alert ("没有可供删除的选项!" );
- sign = 0
- }
- }
- if (sign == 1)
- {
- if (!confirm("真的删除这些记录吗?"))
- return false;
- myForm.action= "/mainctrl/equipmentsDeleteSuccess?categoryId=<%=categoryId%>&categoryName=<%=categoryName%>";
- myForm.submit();
- }
- }
- function checkAll(checkbox_select,checkbox_names)
- {
- var items=checkbox_names.length;
- if(items>1)
- {
- for(i=0;i<items;i++) checkbox_names[i].checked=checkbox_select.checked;
- }
- else
- {
- checkbox_names.checked=checkbox_select.checked;
- }
- }
- </script>
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
- <form name="myForm" method="post" action="" >
- <DIV align=center>
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center"><br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr bgcolor="#fafafa">
- <td>
- <table width="600" border="0" cellspacing="0" cellpadding="2">
- <tr bgcolor="#666666">
- <td colspan="2" height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>>>固定资产管理</font></td>
- </tr>
- <tr>
- <td colspan="2" height="30"><font class="strong" > 类别:</font>
- <input type="hidden" name="keyword" class="file" value="<%=categoryId%>">
- <input type="test" name="categoryName" class="file" readonly value="<%=categoryName%>">
- <input type="button" name="Submit2" value="选择" class="file" onClick="toCategory()")>
- <input type="button" name="SubmitA" value="高级查询" class="file" style="width:60px" onClick="location='/mainctrl/equipmentAdvancedSearch'">
- <input type="button" name="SubmitS" value="统计汇总" class="file" style="width:60px" onClick="location='/mainctrl/equipmentStat'">
- </td>
- </tr>
- </table>
- <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>
- <tr bgcolor="#FFFFFF">
- <td colspan="6" height="30">
- <input type="button" name="bAdd" value="新建" class="file" onClick="location='/mainctrl/equipmentAdd'">
- <input type="button" name="bDelete" value="删除" class="file" onClick=toDelete()>
- <input type="button" name="bBatch" value="批量增加" class="file" style="width: 60px" onClick="location='/mainctrl/equipmentBatchAdd'">
- <input type="button" name="bBatchUse" value="批量增加使用者" class="file" style="width: 95px" onClick="location='/mainctrl/equipmentBatchSearchResult'">
- </td>
- </tr>
- <tr align=middle>
- <td width="7%"><font class="strong">选择</font></td>
- <td width="10%"><font class="strong">编号</font></td>
- <td width="19%"><font class="strong">名称</font></td>
- <td width="23%"><font class="strong">资产编号 </font></td>
- <td width="18%"><font class="strong">类别 </font></td>
- <td width="23%"><font class="strong">购入时间 </font></td>
- </tr>
- <%
- int i = 0;
- int r;
- if (start > eList.size() - (eList.size() % rows))
- r = eList.size() % rows;
- else
- r = 10;
- Iterator it = eList.iterator();
- while(i < start - 1)
- {
- it.next();
- i ++;
- }
- i = 0;
- while(i < r)
- {
- EquipmentValueBean eInfo= (EquipmentValueBean)it.next();
- if (i % 2 == 0)
- {
- %>
- <tr align=middle bgColor="#e0e0e0">
- <%
- }
- else
- {
- %>
- <tr align=middle bgColor="#fafafa">
- <%}%>
- <td width="7%">
- <input type="checkbox" name="check1" value=<%=eInfo.getId()%>><br>
- </td>
- <td width="10%" ><a href="/mainctrl/equipmentDetail?equipmentId=<%=eInfo.getId()%>&simple=true&start=<%=start%>"><%=eInfo.getId()%></a></td>
- <td width="19%" ><%=FieldUtil.shortenString(FieldUtil.filterScriptTag("" + eInfo.getEquipmentName()),15)%><br>
- </td>
- <td width="23%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag("" + eInfo.getEquipmentCode()),15)%></td>
- <td width="18%" ><%=FieldUtil.filterScriptTag("" + eInfo.getCategoryName())%></td>
- <td width="23%" ><%
- if (eInfo.getBuyDate() != null) out.print(eInfo.getBuyDate().toString().substring(0,10));
- %>
- </td>
- </tr>
- <%
- i ++;
- }
- %>
- <%
- if (eList.size() > 0)
- {
- %>
- <tr align=middle>
- <td colspan="6" bgcolor="#fafafa">
- <div align="left">
- <input type="checkbox" name="selectAll" value="checkbox" onClick= checkAll(selectAll,check1)>
- 全选</div>
- </td>
- </tr>
- <%
- }
- %>
- <%
- action = "/mainctrl/equipmentSearchResult?cache=true&categoryId="+categoryId+"&categoryName="+categoryName;
- navBar = NavBar.makeNavbar(start,eList.size(),rows,action);
- %>
- <tr align=middle>
- <td colspan="6" bgcolor="#e0e0e0">
- <div align="left"> <%=navBar%>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- </form>
- </DIV>
- </BODY>
- </HTML>