SignQuery.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:7k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/>
  4. <%
  5. Session m_session = new Session(session);
  6. Request m_request = new Request(request);
  7. int iUserID = m_session.GetInt("UserID");
  8. Vector vt = UserManager.getUserInfoByID(iUserID);
  9. int iDepartmentID = Integer.parseInt(((Vector)vt.get(0)).get(5).toString());
  10. String strSDate = m_request.GetString("StartDate");
  11. %>
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  15. <title>考勤查询管理-- GForce OA 2.0</title>
  16. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  17. <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  18. <script language="JavaScript" src="/js/changestyle.js"></SCRIPT>
  19. <script language="JavaScript" type="text/javascript">
  20. function checkSignApply()
  21. {
  22.         if(!isDate(document.SignApply.StartDate.value))
  23.         {
  24.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  25.             document.SignApply.StartDate.focus();
  26.             return false;
  27.         }
  28.         if(!isDate(document.SignApply.EndDate.value))
  29.         {
  30.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  31.             document.SignApply.EndDate.focus();
  32.             return false;
  33.         }
  34.         if(document.SignApply.EndDate.value<document.SignApply.StartDate.value)
  35.         {
  36.             alert("开始时间不能大于结束时间,请重新输入!");
  37.             document.SignApply.StartDate.focus();
  38.             return false;
  39.         }
  40. }
  41. </SCRIPT>
  42. </head>
  43. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  44. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  45.   <tr>
  46.     <td height="20" colspan="7" align="right" valign="middle"> </td>
  47.   </tr>
  48.   <form name="SignApply" action="SignQuery.jsp" method="post" onSubmit="javascript:return checkSignApply();">
  49.     <tr>
  50.       <td width="135" align="right" valign="middle"><strong>开始时间:</strong></td>
  51.       <td width="85" height="27" align="left" valign="middle">
  52.       <%
  53.         java.util.Date t_Date = new java.util.Date();
  54.       %>
  55.      <input name="StartDate" type="text"  onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="12" size="12" value="<%=(strSDate.trim().length()<4)?StringNew.GetDateString(t_Date,"yyyy-MM-dd"):strSDate%>" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  56.       </td>
  57.       <td width="98" height="27" align="right" valign="middle"><strong>结束时间:</strong></td>
  58.       <td width="94" height="27" align="left" valign="middle">
  59.       <input name="EndDate" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value);" maxlength="12" size="12" value="<%=StringNew.GetDateString(t_Date,"yyyy-MM-dd")%>" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value);">
  60.       </td>
  61.       <td width="154" height="27" align="left" valign="middle"><input type="submit" value="查  询" style="background-color: #FFFFFF; border: 1 solid #000000">
  62.       </td>
  63.     </tr>
  64.   </form>
  65.   <tr>
  66.     <td height="20" colspan="7" align="center" valign="top"> <hr></td>
  67.   </tr>
  68.   <tr>
  69.     <td colspan="7" align="center" valign="top"> <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" style="">
  70.         <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
  71.           <th width="2%" height="24" nowrap><img src="/images/white.gif" width="12"></th>
  72.           <th width="4%" nowrap><font color="#000000">员工编号</font></th>
  73.           <th width="8%" nowrap><font color="#000000">姓名</font></th>
  74. <%
  75. int iPageSize = 15;
  76. int iPage = m_request.GetInt("Page");
  77. String strStartDate = "";
  78. strStartDate =m_request.GetString("StartDate");
  79. String strEndDate = "";
  80. strEndDate = m_request.GetString("EndDate");
  81. Vector vtType = SignTypeManager.getAllRecord();
  82. for (int i=0;i<vtType.size();i++)
  83. {
  84.  out.println("<th width="8%" nowrap><font color="#000000">" + ((Vector)vtType.get(i)).get(1).toString() + "</font></th>");
  85. }
  86. %>
  87.         </tr>
  88.         <%
  89. if (!(strStartDate.equalsIgnoreCase("")||strEndDate.equalsIgnoreCase("")))
  90. {
  91. vt = UserManager.getRecordAndPersonnelInfoByDepartmentID(iDepartmentID);
  92. if(iPage<1)iPage=1;
  93. int iPageCount = StringNew.getPageCount(vt.size(),iPageSize);
  94. if(iPage>iPageCount) iPage=1;
  95. for(int i=(iPage-1)*iPageSize;i<vt.size()&&i<iPage*iPageSize;i++)
  96. {
  97.     String strID = ((Vector)vt.get(i)).get(0).toString();
  98.     if( i% 2 == 0)
  99.     out.println("<tr id="Row"+ i + "" class="DataRowsSingle" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsSingle');">");
  100.     else
  101.     out.println("<tr id="Row"+ i + "" class="DataRowsDouble" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsDouble');">");
  102.     out.println("<td align="right" valign="middle"><img id="image" + i + "" src="../images/lastpost1.gif" style="display:none;"> </td>");
  103.     out.println("<td align="center" valign="middle">" + ((Vector)vt.get(i)).get(8).toString() + "</td>");
  104.     out.println("<td align="center" valign="middle" nowrap title="" + ((Vector)vt.get(i)).get(9).toString() + "" onclick="window.open('SignLink.jsp?UserID="+ strID +"&StartDate=" + strStartDate + "&EndDate="+ strEndDate +"','_blank')"><a href="" onclick="return false;">" + ((Vector)vt.get(i)).get(9).toString() + "</a></td>");
  105. //*************
  106. if (vtType.size()>0)
  107. {
  108.   for(int j=0;j < vtType.size();j++)
  109.   {
  110.     String strSignSUM = SignManager.getSignSUM(Integer.parseInt(strID),Integer.parseInt(((Vector)vtType.get(j)).get(0).toString()),strStartDate,strEndDate);
  111.     out.println("<td align="center" valign="middle" nowrap>" +strSignSUM + "</td>");
  112.   }
  113. }
  114.     out.println("</tr>");
  115. }
  116. //********************************
  117. out.println("<tr><td colspan="7" align="center" valign="middle"><strong>");
  118. String strCurrentPageURL = request.getRequestURI();
  119. if(iPage<2)
  120. out.print("首页&nbsp;&nbsp;上页");
  121. else
  122. out.print("<a href=""+ strCurrentPageURL+"?Page=" + 1 + "&StartDate=" + strStartDate + "&EndDate="+ strEndDate + "">首页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?Page=" + (iPage-1) + "&StartDate=" + strStartDate + "&EndDate="+ strEndDate + "">上页</a>");
  123. out.print("&nbsp;&nbsp;当前是第" + iPage + "页,共" + vt.size() + "条记录" + iPageCount + "页&nbsp;&nbsp;");
  124. if(iPage>=iPageCount)
  125. out.print("下页&nbsp;&nbsp;末页");
  126. else
  127. out.print("<a href=""+ strCurrentPageURL+"?Page=" + (iPage+1) + "&StartDate=" + strStartDate + "&EndDate="+ strEndDate + "">下页</a>&nbsp;&nbsp;<a href=""+ strCurrentPageURL+"?Page=" + iPageCount + "&StartDate=" + strStartDate + "&EndDate="+ strEndDate + "">末页</a>");
  128. out.println("</strong></td></tr>");
  129. }
  130. %>
  131.       </table>
  132.       </td>
  133.   </tr>
  134. </table>
  135. </body>
  136. </html>