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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.util.*"%>
  3. <%@ page import = "cn.js.fan.web.*"%>
  4. <%@ page import = "cn.js.fan.db.*"%>
  5. <%@ page import = "cn.js.fan.util.*"%>
  6. <%@ page import = "com.redmoon.oa.archive.*"%>
  7. <%@ page import = "com.redmoon.oa.person.*"%>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>奖励列表</title>
  13. <link href="../common.css" rel="stylesheet" type="text/css">
  14. </head>
  15. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  16. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  17. <jsp:useBean id="archivePrivilege" scope="page" class="com.redmoon.oa.archive.ArchivePrivilege"/>
  18. <% 
  19. String userName = ParamUtil.get(request,"userName");
  20. if (!privilege.isUserPrivValid(request, "archive.rewards")||!archivePrivilege.canAdminUser(request,userName)) {
  21. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "pvg_invalid")));
  22. return;
  23. }
  24. %>
  25. <%@ include file="archive_inc_menu_top.jsp"%>
  26. <br>
  27. <%
  28. String op = ParamUtil.get(request, "op");
  29. if (op.equals("del")) {
  30.    UserRewardsMgr urm = new UserRewardsMgr();
  31.    boolean re = false;
  32.    try {  
  33.  re = urm.del(request);
  34.    }
  35.    catch(ErrMsgException e){
  36.  out.print(StrUtil.Alert(e.getMessage()));
  37.    }
  38.    if (re) {
  39.   out.print(StrUtil.Alert(SkinUtil.LoadString(request,"res.module.archive", "success_del_rewards")));
  40.    } 
  41. }
  42. %>
  43. <table width="494" border="0" align="center" cellpadding="0" cellspacing="0" class="main">
  44.   <tr> 
  45.     <td height="23" valign="middle" class="right-title">奖励信息管理</td>
  46.   </tr>
  47.   <tr> 
  48.     <td valign="top" background="images/tab-b-back.gif">
  49. <%
  50. String sql;
  51. String userRealName = "";
  52. String myname = privilege.getUser(request);
  53. if(userName.equals("")){
  54. sql = "select id from archive_rewards";
  55. }else{
  56. sql = "select id from archive_rewards where username = " + StrUtil.sqlstr(userName);
  57. }
  58. String querystr = "";
  59. int pagesize = 10;
  60. Paginator paginator = new Paginator(request);
  61. int curpage = paginator.getCurPage();
  62. UserRewardsDb urd = new UserRewardsDb();
  63. ListResult lr = urd.listResult(sql, curpage, pagesize);
  64. int total = lr.getTotal();
  65. Vector v = lr.getResult();
  66.     Iterator ir = null;
  67. if (v!=null)
  68. ir = v.iterator();
  69. paginator.init(total, pagesize);
  70. // 设置当前页数和总页数
  71. int totalpages = paginator.getTotalPages();
  72. if (totalpages==0)
  73. {
  74. curpage = 1;
  75. totalpages = 1;
  76. }
  77. %>
  78.       <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  79.         <tr> 
  80.           <td width="47">&nbsp;</td>
  81.           <td align="right" backgroun="images/title1-back.gif">找到符合条件的记录 <b><%=paginator.getTotal() %></b> 条 每页显示 <b><%=paginator.getPageSize() %></b> 条 页次 <b><%=curpage %>/<%=totalpages %></td>
  82.         </tr>
  83.       </table> 
  84. <form name="form1" action="archive_rewards_add.jsp" method="post"> 
  85.       <table width="97%" border="0" align="center" cellpadding="2" cellspacing="0">
  86.         <tr align="center" bgcolor="#C4DAFF"> 
  87.           <td width="17%">姓名</td>
  88.           <td width="16%" bgcolor="#C4DAFF"><span class="TableContent">何时</span></td>
  89.           <td width="14%" bgcolor="#C4DAFF"><span class="TableContent">何地</span></td>
  90.           <td width="14%" bgcolor="#C4DAFF"><span class="TableContent">何种奖励</span></td>
  91.           <td width="12%"><span class="TableContent">主要事迹</span></td>
  92.           <td width="14%">备注</td>
  93.           <td width="13%">操作</td>
  94.         </tr>
  95.       </table>
  96.       <%
  97.    int i = 0;
  98. UserInfoDb uid = new UserInfoDb();
  99. while (ir!=null && ir.hasNext()) {
  100. urd = (UserRewardsDb)ir.next();
  101. i++;
  102. int id = urd.getId();
  103. uid = uid.getUserInfoDb(urd.getUserName());
  104. userRealName = uid.getUserRealName();
  105. String myDate = DateUtil.format(urd.getMyDate(), "yyyy-MM-dd");
  106.  %>
  107.       <table width="97%" border="0" align="center" cellpadding="2" cellspacing="0">
  108.         <tr align="center"> 
  109.           <td width="17%"><%=userRealName%></td>
  110.           <td width="16%"><%=myDate%></td>
  111.           <td width="14%"><%=urd.getPlace()%> </td>
  112.           <td width="14%"><%=urd.getRewards()%></td>
  113.           <td width="12%"><%=urd.getReason()%></td>
  114.           <td width="14%"><%=urd.getRemark()%></td>
  115.           <td width="13%"><a href="archive_rewards_edit.jsp?id=<%=id%>&userName=<%=StrUtil.UrlEncode(userName)%>">编辑</a>&nbsp;&nbsp;<a href="?op=del&id=<%=id%>&userName=<%=StrUtil.UrlEncode(uid.getUserName())%>">删除</a></td>
  116.         </tr>
  117.       </table>
  118.        <%}%>
  119.  <input type="hidden" name="userName" value="<%=userName%>">
  120.  </form>
  121.       <br>
  122.       <table width="98%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  123.         <tr> 
  124.           <td width="1%" height="23">&nbsp;</td>
  125.           <td height="23" valign="baseline"> 
  126.             <div align="right"> 
  127.             <%
  128. out.print(paginator.getCurPageBlock("?"+querystr));
  129. %>
  130.               &nbsp;</div></td>
  131.         </tr>
  132.       </table>
  133.     </td>
  134.   </tr>
  135.   <tr> 
  136.     <td height="30" colspan="2" align="center">
  137.       <input name="button" type="submit" class="button1"  value="添加奖励信息" onClick="form1.submit()">
  138.     </td>
  139.   </tr>
  140. </table>
  141. </body>
  142. </html>