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

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  4. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  5. <STYLE>
  6. #ssm2 A {
  7. FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana; TEXT-DECORATION: none
  8. }
  9. #ssm2 A:hover {
  10. COLOR: red
  11. }
  12. </STYLE>
  13. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  14. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  15. <script language = "javascript" >
  16. function checkoffOnly()
  17. {
  18.      form1.action= "/mainctrl/attendance/attendance/checkOffOnly";
  19.      form1.submit();
  20. }
  21. function checkOffOverDay()
  22.      form1.action= "/mainctrl/attendance/attendance/addOverDayCheckOff";
  23.      form1.submit();
  24. }
  25. function cancleOper()
  26. {
  27.     form1.action= "/mainctrl/attendance/attendance/employeeAttendance";
  28.     form1.submit();
  29. }
  30. function forWardIndex()
  31. {
  32.     window.location = "/vnex/index.jsp";
  33. }
  34. </script>
  35. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  36. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  37. <%@ page import = "com.vnex.intranet.attendance.attendance.proxy.AttendanceProxyBean" %>
  38. <%@ page import = "com.vnex.intranet.hr.employer_info.proxy.DivAttTimeProxy"%>
  39. <%
  40.     AttendanceProxyBean attProxy = new AttendanceProxyBean(); 
  41.     int empId = -1;
  42.     if ( BusinessName.getEmpId() != 0)
  43.         empId = BusinessName.getEmpId();
  44. %>
  45. <DIV align=center>
  46. <form name="form1" method="post" action="">
  47.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  48.     <TBODY> 
  49.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  50.     <TR> 
  51.         <TD colSpan=3 align="center" class="iframestyle" valign="top"> <br>
  52.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  53.             <tr valign="top">
  54.               <td >
  55.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  56.                   <tr> 
  57.                       
  58.                     <td colspan="6" bgcolor="#666666"><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/attendance/attendance/employeeAttendance"><font color="#FFFFFF">登记考勤</font></a>&gt;&gt;下班登记</font> 
  59.                     </td>
  60.                     </tr>
  61.                     <tr bgcolor="#fafafa"> 
  62.                       <td colspan="6"></td>
  63.                     </tr>
  64.                   </table> 
  65.                  <table width="100%" cellpadding="0" cellspacing="0">
  66.                  
  67.                   <tr align="center" bgcolor="#fafafa"> 
  68.                     <td colspan="6"> 
  69.                       <table class=title width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  70.                         <tr bgcolor="#e0e0e0"> 
  71.                           <td width="25%"><font class=strong>&nbsp;你好: </font></td>
  72.                           <td width="75%"><font class=strong><%=BusinessName.getEmpName()%></font></td>
  73.                         </tr>
  74.                          <%
  75.                             String checkOffNotes = "";
  76.                             checkOffNotes = request.getParameter("Notes");
  77.                         %>
  78.                         <input type = "hidden" value = "<%=checkOffNotes%>" name = "checkOffNotes">
  79.                         
  80.                          <%
  81.                             //判断用户是否已经登录过上班.
  82.                             Calendar nowTime=Calendar.getInstance();
  83.                             int nowHour = 0;
  84.                             int nowMinute = 0;
  85.                             String amPm = "";
  86.                             String whetherCheckOff = "";
  87.                             String whetherCheckIn = "";
  88.                             String lastNotOffDate = "";
  89.                             int lateCount= 0;                          
  90.                             whetherCheckOff  = attProxy.judgeWhetherAlreadyCheckOff( empId ); 
  91.                             whetherCheckIn  = attProxy.judgeWhetherAlreadyCheckIn( empId ); 
  92.                           
  93.                             boolean whetherWorkOverDay = false;
  94.                             whetherWorkOverDay = attProxy.judgeWhetherWorkOverDay( empId );
  95.     
  96.                             if (whetherCheckOff.equals("Yes"))
  97.                             {   
  98.                                %>
  99.                                    <tr bgcolor="#fafafa"> 
  100.                           <td width="25%"><font class=strong>&nbsp;登录下班失败:</font> 
  101.                           </td>
  102.                           <td width="75%"> 今天您已经登录了一次下班.</td>
  103.                         </tr>
  104.                             <%
  105.                             } 
  106.                             if( whetherCheckOff.equals("No")  && whetherCheckIn.equals("No"))
  107.                             {
  108.                                 %>
  109.                         <tr bgcolor="#fafafa"> 
  110.                         <td width="25%"><font class=strong>&nbsp;登录下班失败:</font> 
  111.                         </td>
  112.                         <td width="75%"><font class=strong>您今天没有登录上班.</font></td>
  113.                         </tr>
  114.                         </table>
  115.                         <table class=title width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  116.                          <tr bgcolor="#e0e0e0"> 
  117.                         <td width="75%"><font class=strong>&nbsp;如果您今天忘记登上班,现在仅能登录您今天的下班记录, 下班登记请单
  118.                         <br>&nbsp;击:<br>&nbsp;系统将记录当前时间为您今天的下班时间.</font> 
  119.                         </td>
  120.                         <td width="25%"><font class=strong> <input type="button" value="登记下班" name="button" onclick = "checkoffOnly()" class=text></font></td>
  121.                         </tr>
  122.                       
  123.                  <%String bgColor3 = "";
  124.                             System.out.println("nnBefore getLastNotOffWorkDay()");
  125.                             try
  126.                             {  
  127.                   System.out.println("attProxy.getLastNotOffWorkDay( empId ):"+attProxy.getLastNotOffWorkDay( empId ));            
  128.                                 if( !attProxy.getLastNotOffWorkDay( empId ).equals( "everOff" ))
  129.                                 {
  130.                                   bgColor3 = "#e0e0e0";
  131.                                   System.out.println("nnBefore getLastNotOffWorkDay()");
  132.                                   lastNotOffDate = attProxy.getLastNotOffWorkDay( empId ).substring(0,10);
  133.                                   System.out.println("nn"+lastNotOffDate);
  134.                             
  135.                         %>
  136.                        <tr bgcolor="#fafafa"> 
  137.                        <td  width="25%"><font class=strong>
  138.                        &nbsp;您最晚一次没有登录下班的上班日期是:&nbsp;&nbsp;&nbsp;<%=lastNotOffDate%><br>
  139.                        
  140.                        <font class=strong>&nbsp;您如果是从&nbsp;&nbsp;<%=lastNotOffDate%> &nbsp;日工作到现在,&nbsp;&nbsp;&nbsp; 请单击:<br>  &nbsp;系统将把您现在的下班时间记录为<%=lastNotOffDate%>的下班时间.</strong></td><td><input type="button" value="确认下班" onclick = "checkOffOverDay()" name="button" class=text></td></tr>
  141.                        <input type = "hidden" name = "lastNotOffYear" value ="<%=lastNotOffDate.substring(0,4)%>">
  142.                        <input type = "hidden" name = "lastNotOffMonth" value ="<%=lastNotOffDate.substring(5,7)%>">
  143.                        <input type = "hidden" name = "lastNotOffDay" value = "<%=lastNotOffDate.substring(8,10)%>">
  144.                        <%
  145.                            }
  146.                            else
  147.                            {
  148.                                bgColor3 = "#fafafa";
  149.                            }
  150.                            }
  151.                             catch(Exception e)
  152.                             {
  153.                      System.out.println("nnException at JSP: "+e+"n");       
  154.                      e.printStackTrace();
  155.                     }
  156.                        %>
  157.                        <tr bgcolor="<%=bgColor3%>"> 
  158.                        <td width="75%"><font class=strong>&nbsp;其他情况请单击:</font></td>
  159.                        <td><input type="button" value="取消操作" name="button" onclick = "cancleOper()" class=text></td>
  160.                        </tr>
  161.                               <%
  162.                                } 
  163.                                
  164.                                if ( whetherCheckIn.equals("Yes") &&  whetherCheckOff.equals("No"))
  165.                                {       
  166.                                    nowHour = nowTime.get( Calendar.HOUR_OF_DAY );
  167.                                    nowMinute = nowTime.get( Calendar.MINUTE ); 
  168.                                    amPm = "";
  169.                                    if (nowHour < 12 )
  170.                                    {
  171.                                        amPm = "AM";
  172.                                    } 
  173.                                    if( nowHour >= 12)
  174.                                    {
  175.                                        amPm = "PM";
  176.                                    }
  177.                           %>    
  178.                         
  179.                         <tr bgcolor="#fafafa"> 
  180.                           <td width="25%"><font class=strong>&nbsp;您登录的下班时间是:</font> 
  181.                           </td>
  182.                           <td width="75%"><%=nowHour%>:<%=nowMinute%> <%=amPm%> </td>
  183.                         </tr>
  184.                           <%
  185.                                 }
  186.                            %>
  187.                            <tr bgcolor="#e0e0e0"> 
  188.                           <td width="25%"><font class=strong>&nbsp;您的规定下班时间是:</font> 
  189.                           </td>
  190.                           <%
  191.                            DivAttTimeProxy datProxy = new DivAttTimeProxy();
  192.                            int setOffDutyHour = datProxy.getOffDutyHour(empId);
  193.                           %>
  194.                           <td width="75%">&nbsp;<%=setOffDutyHour%>&nbsp;:&nbsp;<%=datProxy.getOffDutyMinute(empId)%>&nbsp;&nbsp;<%=setOffDutyHour>11?"PM":"AM"%></td>
  195.                         </tr>
  196.                            
  197.                              <%
  198.                            if ( whetherCheckIn.equals("Yes") && whetherCheckOff.equals("No") )
  199.                            {       
  200.                                lateCount = attProxy.calculateEarlyLeaveTime(empId);
  201.                                if(lateCount > 0)
  202.                                {
  203.                                   %>
  204.                                    <tr valign="top" bgcolor="#fafafa"> 
  205.                           <td width="25%"> <font class=strong>&nbsp;状态:</font> 
  206.                           </td>
  207.                           <td width="75%">早退<%=lateCount%>分钟</td>
  208.                           </tr>
  209.                                   <%
  210.                                } 
  211.                              
  212.                                 if( checkOffNotes != null)
  213.                                    %>
  214.                                    
  215.                                   <tr valign="top" bgcolor="#e0e0e0"> 
  216.                           <td width="25%"> <font class=strong>&nbsp;您的备注是:</font> 
  217.                           </td>
  218.                           <td width="75%"> <%=FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(checkOffNotes))%>
  219.                           </td>
  220.                         </tr>
  221.                                <%
  222.                                    attProxy.addCheckOffRecord( empId,checkOffNotes);
  223.                             }   
  224.                       %>
  225.                        
  226.                         <tr bgcolor="#fafafa"> 
  227.                           <td height="30" bgcolor="#fafafa" align="center" colspan="2"> 
  228.                             <input onClick="location='/mainctrl/personal/main'" type="button" value="返回" name="Button" class="file">
  229.                           </td>
  230.                         </tr>
  231.                       </table>
  232.                         </td>
  233.                     </tr>
  234.                   </table>
  235.               </td>
  236.             </tr>
  237.           </table>
  238.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  239. </TD>
  240.     </TR>
  241.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  242.     </TBODY> 
  243.   </TABLE>
  244.   <BR>
  245. <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  246. </form></DIV>
  247. </BODY></HTML>