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

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%@ page import="com.vnex.intranet.attendance.statistic.value.*"%>
  3. <%@ page import="com.vnex.intranet.attendance.statistic.proxy.*"%>
  4. <%@ page import="com.vnex.intranet.util.*"%>
  5. <%@ page import="java.util.*" %>
  6. <%@ page import ="java.sql.*" %>
  7. <%
  8. Iterator iter = null;
  9. ArrayList  arrayResult =null;
  10. String model ="";
  11. String selectedDate = null;
  12. String selectedDep = null;
  13. if(request.getParameter("model") != null)
  14. {
  15. model = request.getParameter("model");
  16. selectedDate = request.getParameter("sDate");
  17. selectedDep = request.getParameter("sDep");
  18. AttQueryProxy attProxy = new AttQueryProxy();
  19. try
  20. {
  21. arrayResult =(ArrayList) attProxy.getAttQueryResultByDateProxy(selectedDate,(new Integer(selectedDep)).intValue(),model);
  22. iter = arrayResult.iterator();
  23. }
  24. catch(Exception e)
  25. {
  26. System.out.println("JSP exception :"+e);
  27. throw new RuntimeException("查询出错.");
  28. }
  29. }
  30.  
  31. %>
  32. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  33. <HTML>
  34. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  35. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0" onload = alert("abc")>
  36. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  37. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  38. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  39. <script language="JavaScript" src="/vnex/validate.js"></script>
  40. <script language="JavaScript" src="/vnex/menu/dockmenu_hr.js"></script>
  41. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  42. <script language = "JavaScript">
  43. function do_submit()
  44.    if(form1.sDate.value == "" )   
  45.    {
  46.     alert("请选择查询日期.");
  47.     return false;
  48.    }
  49.    form1.action="/mainctrl/hr/attQueryByDateResult?model="+form1.model.value;
  50.    form1.submit();
  51. }
  52. </script>
  53. <DIV align=center>
  54. <form name="form1" method=POST >
  55.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0 >
  56.     <tbody>
  57.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  58.     <TR> 
  59.         <TD colSpan=3 align="center"> 
  60.           <br>
  61.           <!--休假事件表开始 -->
  62.            <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  63.              <tr bgcolor="#666666"> 
  64.                     <td colspan="3"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/hr/main"><font color="#FFFFFF">人力资源</font></a>&gt;&gt;按日期查看考勤情况</font></td>
  65.              </tr>
  66.             <tr>
  67.               <td> 
  68.               <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
  69.               <tr bgcolor="#fafafa">
  70.              <td >&nbsp;<font class=strong>选择查询日期:</font></td><td>
  71.                       <input type="text" name="sDate" readonly class=text size="20" value="">
  72.                       &nbsp;<img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(sDate);return false"> 
  73.                     </td>
  74.              </tr>      
  75.              <tr bgcolor = "#e0e0e0">
  76.              <td >&nbsp;<font class=strong>选择部门:</font>
  77.              </td>
  78.              <td>
  79.                 <org:DivisionList>
  80. <select name="sDep">
  81. <option value='0'>全部部门</option>
  82. <vnex:items >
  83. <option value="<org:DivisionAttribute attribute="id"/>" >
  84. <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
  85. </option>
  86. </vnex:items>
  87. </select>
  88. </org:DivisionList>
  89.              </td>
  90.              </tr>
  91.              <tr bgcolor = "#fafafa">       
  92.                     <td>
  93.                     &nbsp;<font class=strong>选择查看方式:</font></td><td>
  94.                      <select name = "model">
  95.                      <option value = "AllByDateModel">该日的所有记录</option>
  96.                      <option value = "NoneOnNoneOffByDateModel">该日上班下班都没有登记的记录</option>
  97.                      <option value = "ExistOnNoneOffByDateModel">该日登记了上班却没有登记下班的记录</option>
  98.                      <option value = "NoneOnExistOffByDateModel">该日没有登记上班却没有登记下班的记录</option>
  99.                      <option value = "LateByDateModel">该日迟到的记录</option>
  100.                      <option value = "EarlyLeaveByDateModel">该日早退的记录</option>
  101.                      <option value = "NormalByDateModel">该日正常的记录</option>
  102.                      </select>
  103.                     </td>
  104.               </tr>
  105.               <tr bgcolor = "#e0e0e0">
  106.               <td colspan = 2 height="30" align="center">
  107.                <input  type="button" value="查找" name="Submit2" onClick =do_submit() class=text>
  108.               </td>
  109.               </tr>
  110.          <%
  111.          try
  112.          {
  113.           if(request.getParameter("model")!= null)
  114.           {
  115.          %>
  116.            </table>
  117.            <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
  118.               <tr>
  119.               <td>
  120.                 <font class=strong> 姓名</font>
  121.               </td>
  122.               <td>
  123.                <font class=strong> 日期</font>
  124.               </td>
  125.               <td>
  126.                  <font class=strong>上班时间</font>
  127.               </td>
  128.               <td>
  129.                <font class=strong>  迟到时间(分钟)</font>
  130.               </td>
  131.               <td>
  132.                 <font class=strong> 上班时的备注 </font>
  133.               </td>
  134.               <td>
  135.                  <font class=strong>下班时间 </font>
  136.               </td>
  137.               <td>
  138.                  <font class=strong>早退时间(分钟)</font>
  139.               </td>
  140.               <td>
  141.                  <font class=strong>下班时的备注 </font>
  142.               </td>
  143.               <td weight = 100>
  144.                  <font class=strong>状态 </font>
  145.               </td>
  146.               </tr>
  147.               <%
  148.               int start = 1;
  149.               int bgColor = 0;
  150.               int rowPerPage =com.vnex.intranet.system.loader.ConfigParaLoader.getParameterByInt("rowNum");
  151.            int size = arrayResult.size(); //总共有几行
  152.            if ( request.getParameter("start") != null && request.getParameter("start").length() >0  )
  153.            {
  154.              start = Integer.parseInt( request.getParameter("start") );
  155.            }
  156.              String action = "/mainctrl/hr/attQueryByDateResult?model="+model+"&sDate="+selectedDate+"&sDep="+selectedDep; //提交到本页jsp
  157.            String nav = NavBar.makeNavbar(start, size, rowPerPage, action);
  158.            int i = 0;
  159.               while(iter.hasNext()   && i < ( start+rowPerPage-1))
  160.               {
  161.                 i++; 
  162.                 AttViewValueBean attView = (AttViewValueBean) iter.next();
  163.                 if ( i < start ) continue; 
  164.                  
  165.                 bgColor++;
  166.               
  167.                 
  168.               %>
  169.               <tr bgcolor = <%=bgColor%2==1?"#e0e0e0":"#fafafa"%>>
  170.                <td>
  171.                <%=attView.getName()%>
  172.                </td>
  173.                <td>
  174.                <%=((String) attView.getDate().toString()).substring(0,10)%>
  175.                </td>
  176.                <td>
  177.                <%=attView.getOnDutyTime()%>
  178.                </td>
  179.                <td>
  180.                <%=attView.getLateCount()%>
  181.                </td>
  182.                <td>
  183.                <%=attView.getOnDutyNote()%>
  184.                </td>
  185.                <td>
  186.                <%=attView.getOffDutyTime()%>
  187.                </td>
  188.                <td>
  189.                <%=attView.getEarlyLeaveCount()%>
  190.                </td>
  191.                <td>
  192.                <%=attView.getOffDutyNote()%>
  193.                </td>
  194.                <td>
  195.                <%
  196.                    if(attView.getStatus() != null)
  197.                    {
  198.                ArrayList colStatus = (ArrayList) attView.getStatus();
  199.                Iterator iterStatus = colStatus.iterator();
  200.                while(iterStatus.hasNext())
  201.                {
  202.                out.println((String) iterStatus.next() +"<br>");
  203.                }
  204.                    }
  205.                %>
  206.                </td>
  207.               </tr>
  208.               <%
  209.               
  210.                }//end while
  211.          %>
  212.           <tr bgcolor="#e0e0e0"> 
  213.                     <td colspan="9" align="left">&nbsp;&nbsp;<%= nav %></td>
  214.                   </tr>
  215.          <%      
  216.           }//end if
  217.          }
  218.          catch(Exception e)
  219.          {
  220.           System.out.println("nJSP exception :"+e);
  221.           e.printStackTrace();
  222.           throw new RuntimeException("列表时出错.");
  223.          }
  224.          %>     
  225.               </table>
  226.              </td>
  227.             </tr>
  228.           </table>  
  229.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  230.         </TD>
  231.     </TR>
  232.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  233.     </TBODY> 
  234.     </TABLE>
  235.   <BR>
  236.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  237.   </form></DIV>
  238. </BODY></HTML>