user_archive_list.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="java.util.*"%>
  5. <%@ page import="cn.js.fan.web.*"%>
  6. <%@ page import="com.redmoon.oa.pvg.*"%>
  7. <%@ page import="com.redmoon.oa.archive.*"%>
  8. <%@ page import="java.util.Calendar" %>
  9. <%@ page import="com.redmoon.oa.flow.*"%>
  10. <html><head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <link href="../common.css" rel="stylesheet" type="text/css">
  13. <%@ include file="../inc/nocache.jsp"%>
  14. <jsp:useBean id="strutil" scope="page" class="cn.js.fan.util.StrUtil"/>
  15. <title>档案列表</title>
  16. </head>
  17. <body bgcolor="#FFFFFF" text="#000000">
  18. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  19. <%
  20. String priv="read";
  21. if (!privilege.isUserPrivValid(request,priv))
  22. {
  23. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  24. return;
  25. }
  26. %>
  27. <%
  28. String action = ParamUtil.get(request, "action");
  29. String cond = ParamUtil.get(request, "cond");
  30. String what = ParamUtil.get(request, "what");
  31. String op = ParamUtil.get(request, "op");
  32. if (op.equals("del")) {
  33. }
  34. %>
  35. <TABLE width="98%" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0 class="main">
  36.   <TR valign="top" bgcolor="#FFFFFF">
  37.     <TD width="" height="430" colspan="2" style="background-attachment: fixed; background-image: url(../images/bg_bottom.jpg); background-repeat: no-repeat">
  38.           <TABLE cellSpacing=0 cellPadding=0 width="100%">
  39.             <TBODY>
  40.               <TR>
  41.                 <TD class=right-title>
  42.   &nbsp;档案列表 </TD>
  43.               </TR>
  44.             </TBODY>
  45.           </TABLE>
  46.           <table width="58%" border="0" align="center">
  47.   <form name=form1 action="?op=search" method=post>
  48.             <tr>
  49.               <td align="center">按
  50.     <select name="cond">
  51.   <option value="name">姓名</option>
  52.   <option value="idcard">身份证</option>
  53.   <option value="xuelie">学历</option>
  54.   <option value="zhiwu">职务</option>
  55.     </select>
  56.     <input name="what">   
  57.     <input type=submit value="搜索">
  58. <script>
  59. form1.cond.value = "<%=cond.equals("")?"name":cond%>";
  60. </script>
  61. <a href="?action=invalid">显示已禁用用户</a></td>
  62.             </tr>
  63.   </form>
  64.           </table>
  65.           <table border="0" cellspacing="1" width="100%" cellpadding="2" align="center">
  66.             <tr align="center" bgcolor="#F2F2F2">
  67.               <td width="15%" height="20" align=center>用户名</td>
  68.               <td width="24%" align=center>真实姓名</td>
  69.               <td width="19%" align=center>出生日期</td>
  70.               <td width="28%" align=center>身份证</td>
  71.               <td width="14%" align=center>操作</td>
  72.             </tr>
  73.         </table>
  74. <table width="100%"  border="0">
  75.           <tr>
  76. <td>
  77. <%
  78. UserArchiveDb uad = new UserArchiveDb();
  79. String sql = "select a.name from " + uad.getTableName() + " a, users u where a.name=u.name and u.isValid=1";
  80. if (action.equals("invalid"))
  81. sql = "select a.name from " + uad.getTableName() + " a, users u where a.name=u.name and u.isValid=0";
  82. if (op.equals("search")) {
  83. if (cond.equals("name")) {
  84. sql += " and a.name like " + StrUtil.sqlstr("%" + what + "%");
  85. }
  86. if (cond.equals("idcard")) {
  87. sql += " and a.IDCard like " + StrUtil.sqlstr("%" + what + "%");
  88. }
  89. if (cond.equals("xuelie")) {
  90. sql += " and a.xueLi like " + StrUtil.sqlstr("%" + what + "%");
  91. }
  92. if (cond.equals("zhiwu")) {
  93. sql += " and a.zhiWu like " + StrUtil.sqlstr("%" + what + "%");
  94. }
  95. }
  96. int pagesize = 10;
  97. Paginator paginator = new Paginator(request);
  98. int curpage = paginator.getCurPage();
  99. ListResult lr = uad.listResult(sql, curpage, pagesize);
  100. int total = lr.getTotal();
  101. Vector v = lr.getResult();
  102.         Iterator ir = null;
  103. if (v!=null)
  104. ir = v.iterator();
  105. paginator.init(total, pagesize);
  106. //设置当前页数和总页数
  107. int totalpages = paginator.getTotalPages();
  108. if (totalpages==0)
  109. {
  110. curpage = 1;
  111. totalpages = 1;
  112. }
  113. while (ir!=null && ir.hasNext()) {
  114. uad = (UserArchiveDb)ir.next();
  115. %>
  116. <table border="0" cellspacing="1" width="100%" cellpadding="2" align="center">
  117.               <tr align="center">
  118.                 <td width="15%" height="20" align=center><%=uad.getName()%></td>
  119.                 <td width="24%" align=center><%=uad.getRealName()%></td>
  120.                 <td width="19%" align=center><%=DateUtil.format(uad.getBirthday(), "yyyy-MM-dd HH:mm")%></td>
  121.                 <td width="28%" align=center><%=uad.getIDCard()%></td>
  122.                 <td width="14%" align=center><a href="user_archive_modify.jsp?name=<%=StrUtil.UrlEncode(uad.getName())%>">维护</a></td>
  123.               </tr>
  124.             </table>
  125. <%
  126. }
  127. %>
  128. <table width="98%" border="0" class="p9">
  129.               <tr>
  130.                 <td align="right">找到符合条件的记录 <b><%=paginator.getTotal() %></b> 条 每页显示 <b><%=paginator.getPageSize() %></b> 条 页次 <b><%=curpage %>/<%=totalpages %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  131.                   <%
  132. String querystr = "op=" + op + "&action=" + action + "&cond=" + StrUtil.UrlEncode(cond) + "&what=" + StrUtil.UrlEncode(what);
  133. out.print(paginator.getCurPageBlock("?"+querystr));
  134. %>
  135.                   &nbsp;&nbsp;
  136.                 </b></td>
  137.               </tr>
  138.             </table></td>
  139.           </tr>
  140.         </table>
  141. </TD>
  142.   </TR>
  143. </TABLE>
  144. </body>
  145. <script>
  146. function findObj(theObj, theDoc)
  147. {
  148.   var p, i, foundObj;
  149.   
  150.   if(!theDoc) theDoc = document;
  151.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  152.   {
  153.     theDoc = parent.frames[theObj.substring(p+1)].document;
  154.     theObj = theObj.substring(0,p);
  155.   }
  156.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  157.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  158.     foundObj = theDoc.forms[i][theObj];
  159.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  160.     foundObj = findObj(theObj,theDoc.layers[i].document);
  161.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  162.   
  163.   return foundObj;
  164. }
  165. </script>
  166. </html>