<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="cm" uri="/commons-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>员工离职率分析</title>
<link href="../resources/style/base.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="../resources/js/calendar/calendar.js"></script>
<s:include value="../common/head.jsp" />
</head>

<body>
<div class="body_list">
<s:include value="../common/body.jsp" />
<s:form action="emplReportTotalLeave" onsubmit="return checkForm(this)">

 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
    <tr class="form_title">
      <td colspan="3">统计条件</td>
    </tr>
    <tr class="form_item">
      <td width="39%"><span class="required">•</span>统计类型：
   		<s:select cssStyle="width:100px;" name="type.id" title="统计类型 为必填项" 
				list='#request.SysCodeFinder.find("REPORT_EMPL_LEAVE_TOTAL_TYPE")' headerKey="" headerValue="" 
				listKey="id" listValue="codeName"/>	  </td>
      <td width="47%" align="left"><span class="required">•</span>时间范围：
	   <s:textfield title="时间范围 为必填项" name="begin" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
      		<s:param name="value"><s:date name="begin" format="yyyy-MM-dd"/></s:param>
      </s:textfield>
      至
      <s:textfield title="时间范围 为必填项" name="end" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
      		<s:param name="value"><s:date name="end" format="yyyy-MM-dd"/></s:param>
      </s:textfield>
	   </td>
      <td width="14%" align="center">
	  <input name="q" value="统 计" type="submit" />
	  </td>
    </tr>
  </table>
</s:form>

<s:if test="leaveList!=null && leaveList.size()>0">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_line" style="margin:15px 0 5px 0;" >
		  <tr class="list_title">
		    <td width="16%"><s:property value="type.codeName"/></td>
		    <td width="16%">期初人数</td>
		    <td width="18%">入职人数</td>
		    <td width="17%">离职人数</td>
			<td width="17%">
		    期末人数</td>
			<td width="16%">离职率</td>
		  </tr>
		  <s:set name="bn" value="0"/>
		  <s:set name="in2" value="0"/>
		  <s:set name="ln" value="0"/>
		  <s:set name="en" value="0"/>
		  <s:set name="lr" value="0"/>
		  <s:iterator value="leaveList"status="st">
			  <s:set name="row_cls" value=""/><s:if test="#st.Even"><s:set name="row_cls" value="%{'row_a'}"/></s:if>
			  <tr class="list_data <s:property value='#row_cls'/>">
				<td class="center"><s:property value="group"/></td>
				<td class="center"><s:property value="beginNum"/> 人</td>
				<td class="center"><s:property value="incompNum"/> 人</td>
				<td class="center"><s:property value="leaveNum"/> 人</td>
				<td class="center"><s:property value="endNum"/> 人</td>
				<td class="center"><s:property value="leaveRate"/> %</td>
			  </tr>
			  <s:set name="bn" value="#bn+beginNum"/>
			  <s:set name="in2" value="#in2+incompNum"/>
			  <s:set name="ln" value="#ln+leaveNum"/>
			  <s:set name="en" value="#en+endNum"/>
			  <s:set name="lr" value="#lr+leaveRate"/>
		  </s:iterator>
		  <tr class="list_title">
		    <td class="center">合 计</td>
		    <td class="center"><s:property value="#bn"/> 人</td>
		    <td class="center"><s:property value="#in2"/> 人</td>
		    <td class="center"><s:property value="#ln"/> 人</td>
			<td class="center"><s:property value="#en"/> 人</td>
			<td class="center"><s:property value="#lr"/> %</td>
		  </tr>		  
	</table>
</s:if>
</div>  
</body>
</html>