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

电子政务应用

开发平台:

Java

  1. <jsp:useBean id="hrProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean" scope="application" />
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  5. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  6. <script language="JavaScript" src="/vnex/validate.js"></script>
  7. <script language = "JavaScript">
  8. function do_submit()
  9. {
  10.    var sDate = document.form1.sDate.value;
  11.    var eDate = document.form1.eDate.value;
  12.    if( sDate == "" || eDate == "" ) 
  13.    {
  14.        
  15.        alert("请您选择统计起止日期.");   
  16.        return false;
  17.    }
  18.    if( document.form1.sDate.value > document.form1.eDate.value )
  19.    {
  20.       alert("您选择的起始时间早于结束时间,请重新选择统计起止日期.");
  21.       return false;
  22.    }
  23.    
  24.    
  25.    form1.action="/mainctrl/personal/personal_info/statistic_attendance_result";
  26.    form1.submit();
  27. }
  28. </script>
  29. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff 
  30. topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  31. <script language="JavaScript" src="/vnex/menu/dockmenu_person.js"></script>
  32. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  33. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  34. <%@ page language="java" %>
  35. <%@ page import = "com.vnex.intranet.attendance.statistic.proxy.AttendanceStatisticProxyBean"%>
  36. <%@ page import = "com.vnex.intranet.attendance.statistic.value.AttendanceStatisticValueBean"%>
  37. <%@ page import = "com.vnex.intranet.hr.employer_info.value.MemberInfo"%>
  38. <%@ page import = "com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean"%>
  39. <%
  40.     int empId = -1;
  41.     String strEmpId = request.getParameter("empId");
  42.     if ( strEmpId != null)
  43.         empId = Integer.parseInt( strEmpId ); 
  44.          
  45. %>
  46. <%
  47.     AttendanceStatisticProxyBean statProxy = new AttendanceStatisticProxyBean();
  48.     AttendanceStatisticValueBean statValue = new AttendanceStatisticValueBean();    
  49.     statValue.setStartYear(String.valueOf(request.getParameter("sDate")).substring(0,4));
  50.     statValue.setStartMonth(String.valueOf(request.getParameter("sDate")).substring(5,7));
  51.     statValue.setStartDay(String.valueOf(request.getParameter("sDate")).substring(8,10));
  52.     statValue.setEndYear(String.valueOf(request.getParameter("eDate")).substring(0,4));
  53.     statValue.setEndMonth(String.valueOf(request.getParameter("eDate")).substring(5,7));
  54.     statValue.setEndDay(String.valueOf(request.getParameter("eDate")).substring(8,10));
  55.     int colorNum = 0;
  56.     String bgColor = "";
  57.     MemberInfoProxyBean mbProxy = new MemberInfoProxyBean();
  58.      MemberInfo mbInfo = new MemberInfo();
  59.     if( empId > 0)
  60.         mbInfo = mbProxy.infoFind(empId);
  61.     
  62. %>
  63. <DIV align=center>
  64. <form name="form1"  >
  65. <input type = "hidden" name = "empId" value = <%=empId%>>
  66.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  67.      <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  68.     <TR> 
  69.         <TD colSpan=3 align="center"> 
  70.           <!--菜单开始 -->
  71.           <!--菜单结束 -->
  72.           <br>
  73.           
  74.           <!--个人信息开始 -->
  75.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  76.             <tr>
  77.               <td bgcolor="#fafafa"> 
  78.                <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
  79.                    <tr bgcolor="#666666"> 
  80.                     <td colspan="3"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/personal/main"><font color="#FFFFFF">个人办公</font></a>&gt;&gt;<a href="/mainctrl/personal/personal_info/index"><font color="#FFFFFF">个人信息</font></a>&gt;&gt;<font color="#FFFFFF">考勤统计结果</font></td>
  81.                   </tr>
  82.                 <tr> 
  83.                     <td bgcolor="#fafafa" width="100%" colspan=3 align="left"><font class=strong>&nbsp;选择统计日期区间:</font> 
  84.                         <input type="text" name="sDate" readonly class=text size="20" value="">
  85.                       &nbsp;<img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(sDate);return false"> 
  86.                       至 
  87.                       <input type="text" name="eDate" readonly class=text size="20" value="">
  88.                       <img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(eDate);return false">
  89.                       </td>
  90.                   </tr>
  91.                   <tr bgcolor="#fafafa"> 
  92.                     <td height="30" colspan="3" align="center"> 
  93.                       <input  type="button" value="查找" name="Submit2" onClick = "do_submit()" class=text>&nbsp;&nbsp;
  94.                       <input  type="button" value="返回" name="fanhui" onClick = "location= '/mainctrl/personal/personal_info/index'" class=text>
  95.                     </td>
  96.                   </tr>
  97.                 </table>
  98.  
  99.                 <table class=title cellspacing=1 cellpadding=2 width="600" 
  100. border=0>
  101.                  <%
  102.             int lateTimes = statProxy.getLateTimes(empId ,statValue);
  103.             int lateTotal = statProxy.getLateTotal(empId ,statValue);
  104.             int  earlyLeaveTimes = statProxy.getEarlyLeaveTimes(empId ,statValue);
  105.             int  earlyLeaveTotal = statProxy.getEarlyLeaveTotal(empId ,statValue);
  106.             %>
  107.                  <tr> 
  108.                     <td colspan=5 bgcolor="#e0e0e0">
  109.                     &nbsp;姓名:<%=mbInfo.getName()%>&nbsp;                   
  110.                     统计阶段: <%=statValue.getStartYear()%>.<%=statValue.getStartMonth()%>.<%=statValue.getStartDay()%>-- 
  111.                       <%=statValue.getEndYear()%>.<%=statValue.getEndMonth()%>.<%=statValue.getEndDay()%> 
  112.                          </td>
  113.             </tr> 
  114.             <tr align=middle> 
  115.               <td width="300"><font class=strong>迟到次数</font></td>
  116.               <td width="300"><font class=strong>总计迟到时间</font></td>
  117.             </tr>
  118.          <tr align=middle bgcolor="#e0e0e0"> 
  119.               <td width="300" bgcolor="#e0e0e0"><%=lateTimes%> 次 <br>
  120.               </td>
  121.               <td width="300"><%=lateTotal%> 分钟 <br>
  122.               </td>
  123.             </tr>
  124.             </table>
  125.           
  126.           <table class=title cellspacing=1 cellpadding=2 width="600" 
  127. border=0>
  128. <%
  129.                 String workDate = "";
  130.                 String checkInTime = "";
  131.                 String lateCount = "";
  132.                 java.util.Collection coll = statProxy.getLateRecord(empId ,statValue);
  133.                 java.util.Iterator iter = coll.iterator();
  134.                 String inNotes = "";
  135.                 if(iter.hasNext())
  136.                 {
  137. %>
  138.            <tr> 
  139.                     <td width="146" align="center"><font class=strong>日期</font></td>
  140.                     <td width="140" align="center"><font class=strong>上班时间</font></td>
  141.                     <td width="152" align="center"><font class=strong>迟到时间</font></td>
  142.                     <td colspan="2" width="137" align="center"><font class=strong>备注</font> 
  143.                     </td>
  144.              <%
  145.                
  146.                 bgColor = "#fafafa";
  147.                 while (iter.hasNext())
  148.                 {
  149.                 //交错显示颜色
  150.                 if(bgColor.equals("#fafafa"))
  151.                 {
  152.                   bgColor = "#e0e0e0";
  153.                 }
  154.                 else
  155.                 {
  156.                   bgColor = "#fafafa";
  157.                 }
  158. /*
  159.                 colorNum++;
  160.                 if(colorNum%2==0)
  161.                 {
  162.                     bgColor = "#e0e0e0";
  163.                 }
  164.                 else
  165.                 {
  166.                      bgColor = "#fafafa";
  167.                 }
  168. */
  169.                 com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean bean =
  170.                     (com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean ) iter.next();
  171.                 out.println("<tr bgColor="+bgColor+">");
  172.                 workDate = bean.getWorkDate();
  173.                 workDate = workDate.substring(0,10);
  174.                 
  175.                 if ( workDate.equals("null"))
  176.                 {
  177.                     workDate = "";
  178.                 }
  179.                 
  180.                 if ( bean.getCheckInTime().equals("null" ) )
  181.                 {
  182.                     checkInTime = "";
  183.                 }
  184.                 else
  185.                 {
  186.                     checkInTime = bean.getCheckInTime().toString().substring(0,16);
  187.                 }
  188.                 
  189.                 if ( bean.getLateCount().equals("null" ) )
  190.                 {
  191.                     lateCount = "";
  192.                 }
  193.                 else
  194.                 {
  195.                     lateCount = bean.getLateCount();
  196.                 }
  197.                 
  198.                 if( bean.getInNotes()==null ) 
  199.                 {
  200.                     inNotes = "";
  201.                 }
  202.                 else
  203.                 {
  204.                     inNotes = FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(bean.getInNotes()));
  205.                 }
  206.                 if( !checkInTime.equals("") && !lateCount.equals("") )
  207.                 {
  208.                     out.println(" <td width='23%' align='center'>" + workDate + "</td>");
  209.                     out.println(" <td width='23%' align='center'>" + checkInTime + "</td>");
  210.                     out.println(" <td width='23%' align='center'>" + lateCount + "</td>");
  211.                      
  212.                     out.println(" <td width='23%' align='center'>" +inNotes + "</td>");
  213.                     out.println("</tr>");
  214.                 }
  215.             }   
  216.           }  
  217.             %>
  218.           </table>
  219.          
  220.           <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
  221.           
  222.                   <tr align=middle> 
  223.                     <td width="300"><font class=strong>早退次数</font></td>
  224.                     <td width="300"><font class=strong>总计早退时间</font></td>
  225.             </tr>
  226.             <tr align=middle bgcolor="#e0e0e0"> 
  227.               <td width="300" bgcolor="#e0e0e0"><%=earlyLeaveTimes%> 次 <br>
  228.               </td>
  229.               <td width="300"><%=earlyLeaveTotal%> 分钟<br>
  230.               </td>
  231.             </tr>
  232.          
  233.           </table>
  234.           <table class=title cellspacing=1 cellpadding=2 width="600" 
  235. border=0>
  236. <%
  237.             java.util.Collection earlyLeaveColl = statProxy.getEarlyLeaveRecord(empId ,statValue);
  238.             java.util.Iterator earlyLeaveIter = earlyLeaveColl.iterator();
  239.             String offNotes = "";
  240.             String checkOffTime = "";
  241.             String leaveCount = "";
  242.             String offNote = "";
  243.             if(earlyLeaveIter.hasNext())
  244.             {
  245. %>
  246.                   <tr> 
  247.                     <td width="149" align="center"><font class=strong> 日期</font></td>
  248.                     <td width="139" align="center"><font class=strong>下班时间 </font></td>
  249.                     <td width="152" align="center"><font class=strong>早退时间</font></td>
  250.                     <td colspan="2" width="137" align="center"><font class=strong>备注</font> 
  251.                     </td>
  252.                   </tr>
  253.           
  254.             
  255.             <%
  256.             bgColor = "#fafafa";
  257.             while (earlyLeaveIter.hasNext())
  258.             {
  259.                 if(bgColor.equals("#fafafa"))
  260.                 {
  261.                   bgColor = "#e0e0e0";
  262.                 }
  263.                 else
  264.                 {
  265.                   bgColor = "#fafafa";
  266.                 }
  267. /*
  268.                 colorNum++;
  269.                 if(colorNum%2==0)
  270.                 {
  271.                     bgColor = "#e0e0e0";
  272.                 }
  273.                 else
  274.                 {
  275.                      bgColor = "#fafafa";
  276.                 }
  277. */
  278.                 com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean earlyLeaveBean =
  279.                     (com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean ) earlyLeaveIter.next();
  280.                 out.println("<tr bgColor="+bgColor+">");
  281.                 workDate = earlyLeaveBean.getWorkDate();
  282.                 workDate = workDate.substring(0,10);
  283.                
  284.                 if ( workDate == null )
  285.                 {
  286.                     workDate = "";
  287.                 }
  288.                 
  289.                 if( earlyLeaveBean.getCheckOffTime() == null )
  290.                 {
  291.                     checkOffTime = "";
  292.                 }
  293.                 else
  294.                 {
  295.                     checkOffTime = earlyLeaveBean.getCheckOffTime().toString().substring(0,16);
  296.                 }
  297.                
  298.                 if( earlyLeaveBean.getEarlyLeaveCount() == null )
  299.                 {
  300.                     leaveCount = "";
  301.                 }
  302.                 else
  303.                 {
  304.                     leaveCount = earlyLeaveBean.getEarlyLeaveCount();
  305.                 }
  306.                
  307.                 if( earlyLeaveBean.getOffNotes()== null ) 
  308.                 {
  309.                    offNote = "";
  310.                 }
  311.                 else
  312.                 {
  313.                      offNote = FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(earlyLeaveBean.getOffNotes()));
  314.                 }
  315.                 if ( !checkOffTime.equals("") && !leaveCount.equals("") )
  316.                 {
  317.                     out.println(" <td  width='23%' align='center'>" + workDate + "</td>");
  318.                     out.println(" <td  width='23%' align='center'>" + checkOffTime + "</td>");
  319.                     out.println(" <td  width='23%' align='center'>" + leaveCount + "</td>");
  320.                     out.println(" <td  width='23%' align='center'>" + offNote + "</td>");
  321.                     out.println("</tr>");
  322.                 }
  323.             }
  324.           }  
  325.             %>
  326.              
  327.           </table>
  328.                 </td>
  329.             </tr>
  330.             
  331.           </table>
  332.     
  333.            <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  334. </TD>
  335.     </TR>
  336.    <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  337.     </TABLE>
  338.   <BR>
  339.     <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  340.   </form></DIV>
  341. </BODY></HTML>