department_training_plan_main.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:10k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: department_training_plan_main.jsp $
- * $Revision: 1.0 $
- * Date: 2001/05/17 16:59:46 $
- * /training/main
- */
- %>
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.hr.util.*" %>
- <%@ page import="com.vnex.intranet.hr.value.*" %>
- <%@ page import="com.vnex.intranet.util.*" %>
- <%@ page import="com.vnex.intranet.system.loader.ConfigParaLoader" %>
- <%@ page import="java.util.*"%>
- <jsp:useBean id="trainingProxy" class="com.vnex.intranet.hr.process.HRTrainingProcessBean" scope="page" />
- <jsp:useBean id="navBar" scope="request" class="com.vnex.intranet.util.NavBar" />
- <jsp:useBean id="transferHRTrainingValueBean" class="com.vnex.intranet.hr.value.HRTrainingValueBean" scope="page" />
- <jsp:setProperty name="transferHRTrainingValueBean" property="*"/>
- <%
- String pageFlow = "";
- int start = 1;
- String action = "/mainctrl/training/main?a";
- if(request.getParameter("start") != null)
- start = Integer.parseInt(request.getParameter("start"));
- // judgement if page flow is from create training.
- if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINCREATEPAGEFLOW))
- {
- pageFlow = ( String )request.getParameter("pageFlow");
- String startDate = request.getParameter("startDate");
- String endDate = request.getParameter("endDate");
- startDate += " 00:00:00";
- endDate += " 00:00:00";
- transferHRTrainingValueBean.setTrain_startdate(TimeStamp.toTimestamp(startDate));
- transferHRTrainingValueBean.setTrain_enddate(TimeStamp.toTimestamp(endDate));
- trainingProxy.addTraining(transferHRTrainingValueBean);
- }
- // judgement if page flow is from create training.
- if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINMODIFYPAGEFLOW))
- {
- pageFlow = ( String )request.getParameter("pageFlow");
- String startDate = request.getParameter("startDate");
- String endDate = request.getParameter("endDate");
- startDate += " 00:00:00";
- endDate += " 00:00:00";
- transferHRTrainingValueBean.setTrain_startdate(TimeStamp.toTimestamp(startDate));
- transferHRTrainingValueBean.setTrain_enddate(TimeStamp.toTimestamp(endDate));
- trainingProxy.modifyTraining(transferHRTrainingValueBean);
- }
- // judgement if page flow is from delete training.
- if ( request.getParameter("pageFlow") !=null && request.getParameter("pageFlow").equals(HRPayAndTrainingConstant.TRAINDELETEPAGEFLOW))
- {
- if ( request.getParameter("trainId") !=null )
- {
- trainingProxy.deleteTraining( Integer.parseInt(request.getParameter("trainId")) );
- }
- }
- Collection tmpList = null;
- HRTrainingListBean tmpHRTrainingListBean= trainingProxy.getTrainingList();
- tmpList = tmpHRTrainingListBean.getHRTrainingInfos();
- int rowPerPage = ConfigParaLoader.getParameterByInt("rowNum");
- int size = tmpList.size();
- String nav = navBar.makeNavbar(start, size, rowPerPage, action);
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="JavaScript" src="/vnex/menu/dockmenu_hr.js"></script>
- <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
- <script language="JavaScript" src="/vnex/util/strUtil.js"></script>
- <script language=JavaScript>
- function createTraining(){
- main.action="/mainctrl/training/maintain?pageFlow=<%=HRPayAndTrainingConstant.TRAINCREATEPAGEFLOW%>";
- main.submit();
- }
- function deleteThem(form)
- {
- if(form.trainIds == null)
- {
- alert("目前尚未有任何数据可供删除");
- return;
- }
- if(!isChecked(form.trainIds))
- {
- alert("请至少选择一条数据进行删除");
- return;
- }
- if(confirm("是否删除所选数据?"))
- {
- form.action="/mainctrl/training/delete";
- form.submit();
- }
- }
- function removeTraining(trainId){
- //alert("now I'm in the delete the training.");
- main.action="/mainctrl/training/main?trainId="+trainId+"&pageFlow=<%=HRPayAndTrainingConstant.TRAINDELETEPAGEFLOW%>";
- main.submit();
- }
- function modifyTraining(trainId){
- //alert("now im in the trainsit.");
- main.action="/mainctrl/training/maintain?trainId="+trainId+"&pageFlow=<%=HRPayAndTrainingConstant.TRAINMODIFYPAGEFLOW%>";
- main.submit();
- }
- function SelectAll(form)
- {
- for (var i=0;i<form.elements.length;i++)
- {
- var e = form.elements[i];
- if (e.name != 'C1')
- e.checked = form.C1.checked;
- }
- }
- </script>
- <DIV align=center>
- <form name="main" method=POST>
- <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>
- <td>
- <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
- <tr>
- <td bgcolor="#666666"><font class="strongw">
- <a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>>
- <a href="/mainctrl/hr/main"><font color="#FFFFFF">人力资源</font></a>>>
- 员工培训</font></td>
- </tr>
- </table>
- <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
- <tr bgcolor="#fafafa" height="30">
- <td colspan="8">
- <input type="button" value="新增" name="add" onclick="return createTraining()" class=text>
-
- <input type="button" value="删除" name="deleteIt" onclick="deleteThem(this.form)" class="text">
- </td>
- </tr>
- <tr align="center">
- <td width="7%"><font class=strong>选择</font></td>
- <td width="14%"><font class=strong>培训主题</font></td>
- <td width="13%"><font class=strong>部门名称</font></td>
- <td width="20%"><font class=strong>开始时间</font></td>
- <td width="20%"><font class=strong>结束时间</font></td>
- <td width="8%"><font class=strong>状态</font></td>
- <td width="8%"><font class=strong>参加人</font></td>
- </tr>
- <%
- if(tmpList.size() > 0)
- {
- Iterator it = tmpList.iterator();
- int i = 0;
- while( it.hasNext() && i < size && i < ( start+rowPerPage-1) )
- {
- i++;
- Object obj = it.next();
- if(i<start) continue;
- HRTrainingValueBean tmpHRTrainingValueBean = ( HRTrainingValueBean )obj;
- tmpHRTrainingValueBean.setDepartmentsName();
- tmpHRTrainingValueBean.setPersonsName();
- String startDate = "未知";
- if(tmpHRTrainingValueBean.getTrain_startdate() != null)
- {
- startDate = tmpHRTrainingValueBean.getTrain_startdate().toString();
- startDate = startDate.substring(0, startDate.indexOf(" "));
- }
- String endDate = "未知";
- if(tmpHRTrainingValueBean.getTrain_enddate() != null)
- {
- endDate = tmpHRTrainingValueBean.getTrain_enddate().toString();
- endDate = endDate.substring(0, endDate.indexOf(" "));
- }
- String bgcolor = "#e0e0e0";
- if( i%2 == 0)
- bgcolor = "#fafafa";
- %>
- <tr align="center" bgcolor="<%=bgcolor%>">
- <td width="7%"><input type="checkbox" name="trainIds" value="<%=tmpHRTrainingValueBean.getTrain_id()%>"></td>
- <td width="14%"><a href="/mainctrl/training/detail?trainId=<%=tmpHRTrainingValueBean.getTrain_id()%>"><%=FieldUtil.filterQuotTag(FieldUtil.filterScriptTag(tmpHRTrainingValueBean.getTrain_name()))%></a></td>
- <td width="13%"><%=tmpHRTrainingValueBean.getTrain_division()%> </td>
- <td width="20%"><%=startDate%></td>
- <td width="20%"><%=endDate%></td>
- <td width="8%"><%=tmpHRTrainingValueBean.getTrain_status()%></td>
- <td width="8%"><a href="/mainctrl/training/list?trainId=<%=tmpHRTrainingValueBean.getTrain_id()%>">
- <%=tmpHRTrainingValueBean.getPersonNumber()%></a></td>
- </tr>
- <% } // end of while.%>
- <tr bgcolor="<%=i++%2==0? "#fafafa":"#e0e0e0"%>">
- <td width="7%" align="center">
- <input type="checkbox" name="C1" onclick="SelectAll(this.form)">
- </td>
- <td colspan="6"> 全选</td>
- </tr>
- <tr bgcolor="<%=i%2==0? "#fafafa":"#e0e0e0"%>">
- <td colspan="7"> <%=nav%></td>
- </tr>
- <% } // end of if
- %>
- </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>