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

电子政务应用

开发平台:

Java

  1. <%
  2. /**
  3.  * $RCSfile: department_training_plan_main.jsp $
  4.  * $Revision: 1.0 $
  5.  * Date: 2001/05/17 16:59:46 $
  6.  * /training/main
  7.  */
  8. %>
  9. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  10. <%@ page import="com.vnex.intranet.hr.util.*" %>
  11. <%@ page import="com.vnex.intranet.hr.value.*" %> 
  12. <%@ page import="com.vnex.intranet.util.*" %>
  13. <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader" %>
  14. <%@ page import="java.util.*"%>
  15. <jsp:useBean id="trainingProxy" class="com.vnex.intranet.hr.process.HRTrainingProcessBean" scope="page" />
  16. <jsp:useBean id="navBar" scope="request" class="com.vnex.intranet.util.NavBar" />
  17. <jsp:useBean id="transferHRTrainingValueBean" class="com.vnex.intranet.hr.value.HRTrainingValueBean" scope="page" />
  18. <jsp:setProperty name="transferHRTrainingValueBean" property="*"/>
  19. <%     
  20.      String pageFlow = "";
  21.      int start = 1;
  22.      String action = "/mainctrl/training/main?a";
  23.      
  24.      if(request.getParameter("start") != null)
  25.         start = Integer.parseInt(request.getParameter("start"));
  26.      // judgement if page flow is from create training.
  27.      if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINCREATEPAGEFLOW))
  28.      {
  29.         pageFlow = ( String )request.getParameter("pageFlow");
  30.         String startDate = request.getParameter("startDate");
  31.         String endDate = request.getParameter("endDate");
  32.          
  33.         startDate += " 00:00:00";
  34.         endDate += " 00:00:00";
  35.          
  36.         transferHRTrainingValueBean.setTrain_startdate(TimeStamp.toTimestamp(startDate));
  37.         transferHRTrainingValueBean.setTrain_enddate(TimeStamp.toTimestamp(endDate));
  38.         trainingProxy.addTraining(transferHRTrainingValueBean);
  39.      }
  40.      
  41.      // judgement if page flow is from create training.
  42.      if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINMODIFYPAGEFLOW))
  43.      {
  44.          pageFlow = ( String )request.getParameter("pageFlow");
  45.          String startDate = request.getParameter("startDate");
  46.          String endDate = request.getParameter("endDate");
  47.          
  48.          startDate += " 00:00:00";
  49.          endDate += " 00:00:00";
  50.          
  51.          transferHRTrainingValueBean.setTrain_startdate(TimeStamp.toTimestamp(startDate));
  52.          transferHRTrainingValueBean.setTrain_enddate(TimeStamp.toTimestamp(endDate));
  53.          
  54.          trainingProxy.modifyTraining(transferHRTrainingValueBean);
  55.      }
  56.      
  57.      // judgement if page flow is from delete training.
  58.      if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINDELETEPAGEFLOW))
  59.      {
  60.          if ( request.getParameter("trainId") !=null )
  61.          {
  62.              trainingProxy.deleteTraining( Integer.parseInt(request.getParameter("trainId")) );      
  63.          }  
  64.      }
  65.      
  66.      
  67.      Collection tmpList = null;
  68.      HRTrainingListBean tmpHRTrainingListBean= trainingProxy.getTrainingList();
  69.      tmpList = tmpHRTrainingListBean.getHRTrainingInfos();
  70.      int rowPerPage = ConfigParaLoader.getParameterByInt("rowNum");
  71.      int size = tmpList.size(); 
  72.      String nav = navBar.makeNavbar(start,  size, rowPerPage, action); 
  73.      
  74. %>
  75. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  76. <HTML>
  77. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  78. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  79. <script language="JavaScript" src="/vnex/menu/dockmenu_hr.js"></script>
  80. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  81. <script language="JavaScript" src="/vnex/util/strUtil.js"></script>
  82. <script language=JavaScript>
  83.     function createTraining(){
  84. main.action="/mainctrl/training/maintain?pageFlow=<%=HRPayAndTrainingConstant.TRAINCREATEPAGEFLOW%>";
  85.         main.submit();
  86.     }
  87.     
  88.     function deleteThem(form)
  89.     {
  90.        if(form.trainIds == null)
  91.        {
  92.           alert("目前尚未有任何数据可供删除");
  93.           return;
  94.        }
  95.        if(!isChecked(form.trainIds))
  96.        {
  97.           alert("请至少选择一条数据进行删除");
  98.           return;
  99.        }
  100.        if(confirm("是否删除所选数据?"))
  101.        {
  102.           form.action="/mainctrl/training/delete";
  103.           form.submit();
  104.        }
  105.     }
  106.     
  107.     function removeTraining(trainId){
  108.         //alert("now I'm in the delete the training.");
  109. main.action="/mainctrl/training/main?trainId="+trainId+"&pageFlow=<%=HRPayAndTrainingConstant.TRAINDELETEPAGEFLOW%>";
  110.         main.submit();
  111.     }
  112.     
  113.     function modifyTraining(trainId){
  114.         //alert("now im in the trainsit.");
  115. main.action="/mainctrl/training/maintain?trainId="+trainId+"&pageFlow=<%=HRPayAndTrainingConstant.TRAINMODIFYPAGEFLOW%>";
  116.         main.submit();
  117.     }
  118. function SelectAll(form)
  119. {
  120.   for (var i=0;i<form.elements.length;i++)
  121.   {
  122.     var e = form.elements[i];
  123.     if (e.name != 'C1')
  124.        e.checked = form.C1.checked;
  125.   }
  126. }
  127. </script>
  128. <DIV align=center>
  129. <form name="main" method=POST>
  130.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  131.     <tbody>
  132.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  133.     <TR> 
  134.         <TD colSpan=3 align="center"> 
  135.           <br>
  136.           <!--休假事件表开始 -->
  137.            <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  138.             <tr>
  139.               <td> 
  140.                 <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
  141.                   <tr> 
  142.                     <td bgcolor="#666666"><font class="strongw">
  143.                       <a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;
  144.                       <a href="/mainctrl/hr/main"><font color="#FFFFFF">人力资源</font></a>&gt;&gt;
  145.                       员工培训</font></td>
  146.                   </tr>
  147.                 </table>  
  148.                 <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
  149.                     <tr bgcolor="#fafafa" height="30">
  150.                        <td colspan="8">&nbsp;
  151.            <input type="button" value="新增" name="add" onclick="return createTraining()" class=text>
  152.            &nbsp;&nbsp;
  153.            <input type="button" value="删除" name="deleteIt" onclick="deleteThem(this.form)" class="text">
  154.                   </td>
  155.               </tr>
  156.                   <tr align="center"> 
  157.                     <td width="7%"><font class=strong>选择</font></td>
  158.                     <td width="14%"><font class=strong>培训主题</font></td>
  159.                     <td width="13%"><font class=strong>部门名称</font></td>
  160.                     <td width="20%"><font class=strong>开始时间</font></td>
  161.                     <td width="20%"><font class=strong>结束时间</font></td>
  162.                     <td width="8%"><font class=strong>状态</font></td>
  163.                     <td width="8%"><font class=strong>参加人</font></td>
  164.                   </tr>
  165. <%
  166.       if(tmpList.size() > 0)
  167.       {              
  168.         Iterator it = tmpList.iterator();
  169.         int i = 0;
  170.         while( it.hasNext() && i < size && i < ( start+rowPerPage-1) )
  171.            {              
  172.              i++;
  173.              Object obj = it.next();
  174.              if(i<start) continue;
  175.              HRTrainingValueBean tmpHRTrainingValueBean = ( HRTrainingValueBean )obj;  
  176.              tmpHRTrainingValueBean.setDepartmentsName(); 
  177.              tmpHRTrainingValueBean.setPersonsName();
  178.              String startDate = "未知";
  179.              if(tmpHRTrainingValueBean.getTrain_startdate() != null)
  180.              {
  181.                 startDate = tmpHRTrainingValueBean.getTrain_startdate().toString();
  182.                 startDate = startDate.substring(0, startDate.indexOf(" "));
  183.              }
  184.              String endDate = "未知";
  185.              if(tmpHRTrainingValueBean.getTrain_enddate() != null)
  186.              {
  187.                 endDate = tmpHRTrainingValueBean.getTrain_enddate().toString();
  188.                 endDate = endDate.substring(0, endDate.indexOf(" "));
  189.              }
  190.              String bgcolor = "#e0e0e0";
  191.              if( i%2 == 0)
  192.                 bgcolor = "#fafafa";
  193.             %> 
  194.                           <tr align="center" bgcolor="<%=bgcolor%>"> 
  195.                             <td width="7%"><input type="checkbox" name="trainIds" value="<%=tmpHRTrainingValueBean.getTrain_id()%>"></td>
  196.                             <td width="14%"><a href="/mainctrl/training/detail?trainId=<%=tmpHRTrainingValueBean.getTrain_id()%>"><%=FieldUtil.filterQuotTag(FieldUtil.filterScriptTag(tmpHRTrainingValueBean.getTrain_name()))%></a></td>
  197.                             <td width="13%"><%=tmpHRTrainingValueBean.getTrain_division()%> </td>
  198.                             <td width="20%"><%=startDate%></td>
  199.                             <td width="20%"><%=endDate%></td>
  200.                             <td width="8%"><%=tmpHRTrainingValueBean.getTrain_status()%></td> 
  201.                             <td width="8%"><a href="/mainctrl/training/list?trainId=<%=tmpHRTrainingValueBean.getTrain_id()%>">
  202.                             <%=tmpHRTrainingValueBean.getPersonNumber()%></a></td> 
  203.                           </tr>
  204. <%          } // end of while.%>
  205.                  <tr bgcolor="<%=i++%2==0? "#fafafa":"#e0e0e0"%>">
  206.                     <td width="7%" align="center">
  207.                        <input type="checkbox" name="C1" onclick="SelectAll(this.form)">
  208.                     </td>
  209.                     <td colspan="6">&nbsp;&nbsp;全选</td>
  210.                  </tr>
  211.                  <tr bgcolor="<%=i%2==0? "#fafafa":"#e0e0e0"%>">
  212.                     <td colspan="7">&nbsp;<%=nav%></td>
  213.                  </tr>
  214. <%     } // end of if    
  215.   %> 
  216.                 </table>
  217.               </td>
  218.             </tr>
  219.             
  220.           </table>
  221.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  222.         </TD>
  223.     </TR>
  224.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  225.     </TBODY> 
  226.     </TABLE>
  227.   <BR>
  228.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  229.   </form></DIV>
  230. </BODY></HTML>