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

电子政务应用

开发平台:

Java

  1. <%
  2. /**
  3.  * $RCSfile: employee_stipend_statistic.jsp,v $
  4.  * $Revision: 1.0 $
  5.  * $Date: 2001/05/17 20:57:46 $
  6.  * /mainctrl/intranet/hr/salary_statistic
  7.  */
  8. %> 
  9. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  10. <%@ page import="com.vnex.intranet.hr.employer_info.value.*"%>
  11. <%@ page import="com.vnex.intranet.hr.employer_info.process.*"%>
  12. <%@ page import="com.vnex.intranet.hr.util.*"%>
  13. <%@ page import="java.sql.*"%>
  14. <%@ page import="java.util.*" %>
  15. <%@ page import="java.sql.Timestamp" %>
  16. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  17. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  18. <jsp:useBean id="salaryProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.SalaryProxyBean" scope="application" />
  19. <jsp:useBean id="proxyBean" class="com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean" scope="application" />
  20. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  21. <%
  22. int emp_id = -1;
  23. if ( BusinessName.getEmpId() > 0)
  24.        emp_id = BusinessName.getEmpId();
  25. %>
  26. <%
  27.     Collection pageAllColl = new ArrayList();
  28.     
  29.     MemberDateSalary pageColl = new MemberDateSalary();
  30.     String sDate = request.getParameter("sYear") + "-" + request.getParameter("sMonth") + "-01";
  31.     String eDate = request.getParameter("eYear")+ "-" + request.getParameter("eMonth") + "-30";
  32.     String curDate = com.vnex.intranet.hr.util.MyDateFormat.myNow();
  33.     if ( sDate != null && sDate.length()>5 && eDate != null && eDate.length()>5 && emp_id >0 && request.getParameter("doSearch") != null )
  34.     {
  35.        pageAllColl = salaryProxyBean.dateFind( emp_id, sDate ,eDate );
  36.     }
  37.     
  38. %>
  39. <script language = "JavaScript">
  40. function do_submit()
  41. {
  42.    var OptionSYear = document.form1.sYear.selectedIndex;
  43.    var OptionEYear = document.form1.eYear.selectedIndex;
  44.    var OptionSMonth = document.form1.sMonth.selectedIndex;
  45.    var OptionEMonth = document.form1.eMonth.selectedIndex;
  46.    var ValueSYear =  document.form1.sYear.options[OptionSYear].value;
  47.    var ValueEYear = document.form1.eYear.options[OptionEYear].value;
  48.    var ValueSMonth = document.form1.sMonth.options[OptionSMonth].value;
  49.    var ValueEMonth = document.form1.eMonth.options[OptionEMonth].value;
  50.    
  51.    if ( ValueSYear >  ValueEYear )
  52.    {
  53.        alert("您选择的起始时间晚于结束时间,请重新选择统计起止日期.");
  54.        return false;     
  55.    }
  56.    if ( ValueSYear ==  ValueEYear && ValueSMonth > ValueEMonth )
  57.    {
  58.        alert("您选择的起始时间晚于结束时间,请重新选择统计起止日期.");
  59.        return false;
  60.    }
  61.   
  62.    form1.submit();
  63. }
  64. </script>
  65. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  66. <HTML>
  67. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  68. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  69. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  70. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  71. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  72. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  73. <DIV align=center>
  74. <form name="form1" method="post" action="/mainctrl/personal/salary/query?doSearch=1">
  75.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  76.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  77.     <TR> 
  78.         <TD colSpan=3 align="center"> 
  79. <!--菜单开始 -->
  80.          
  81.           <br>
  82.           <!--个人信息开始 -->
  83.         <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  84.              <tr>
  85.               <td bgcolor="#fafafa"> 
  86.                 <table class=title cellspacing=1 width="100%" border=0>
  87.                   <tr bgcolor="#666666"> 
  88.                     <td><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;<font color="#FFFFFF">个人工资福利保险</font></font></td>
  89.                   </tr>
  90.                   <tr bgcolor="#fafafa"> 
  91.                     <td align="left" valign="middle" height="30">&nbsp;<font class=strong>统计起始年月:</font> 
  92.                       <%
  93.                       //在此四个下拉框分别输出起止年月.
  94.                       //得到当前日期年月日
  95.                       Calendar nowTime=Calendar.getInstance();
  96.                       int nowYear = nowTime.get( Calendar.YEAR);
  97.                       int nowMonth = nowTime.get(Calendar.MONTH)+1;
  98.                       String ifSelect = "";
  99.                       //输出起始年下拉框并默认选中当前年.
  100.                     
  101.                     %>
  102.                       <select name = "sYear">
  103.                         <%
  104.                       for(int sYear = 1930;sYear < 2099 ; sYear++ )
  105.                       {
  106.                           if (sYear == nowYear)
  107.                           {
  108.                               ifSelect = "selected";
  109.                           }
  110.                           else
  111.                           {
  112.                               ifSelect = "";
  113.                           }
  114.                       %>
  115.                         <option value = "<%=sYear%>"  <%=ifSelect%>><%=sYear%></option>
  116.                         <%
  117.                       }
  118.                       %>
  119.                       </select>
  120.                       年 
  121.                       <select name = "sMonth">
  122.                         <%
  123.                       //按照两位的格式输出起始月下拉框并默认选中当前月.
  124.                       String strSMonth = "";
  125.                      
  126.                       for(int sMonth = 1;sMonth <= 12 ; sMonth++ )
  127.                       {
  128.                         if(sMonth < 10)
  129.                         {
  130.                             strSMonth = "0"+String.valueOf(sMonth);
  131.                         }
  132.                         else
  133.                         {
  134.                             strSMonth = String.valueOf(sMonth);
  135.                         }
  136.                         if (sMonth == nowMonth)
  137.                         {
  138.                             ifSelect = "selected";
  139.                         }
  140.                         else
  141.                         {
  142.                             ifSelect = "";
  143.                         }
  144.                        %>
  145.                         <option value = "<%=strSMonth%>"  <%=ifSelect%>><%=strSMonth%></option>
  146.                         <%
  147.                       }
  148.                       %>
  149.                       </select>
  150.                       月&nbsp;<font class=strong>结束年月:</font> 
  151.                       <select name = "eYear">
  152.                         <%
  153.                       //输出结束年下拉框并默认选中当前年.
  154.                       for(int eYear = 1930;eYear < 2099 ; eYear++ )
  155.                       {
  156.                        if (eYear== nowYear)
  157.                         {
  158.                             ifSelect = "selected";
  159.                         }
  160.                         else
  161.                         {
  162.                             ifSelect = "";
  163.                         }
  164.                       
  165.                       %>
  166.                         <option value = "<%=eYear%>" <%=ifSelect%>><%=eYear%></option>
  167.                         <%
  168.                       }
  169.                       %>
  170.                       </select>
  171.                       年 
  172.                       <select name = "eMonth">
  173.                         <%
  174.                       //输出结束月下拉框并默认选中当前月.
  175.                       String strEMonth = "";
  176.                       for(int eMonth = 1;eMonth <= 12 ; eMonth++ )
  177.                       {
  178.                         if(eMonth < 10)
  179.                         {
  180.                             strEMonth = "0"+String.valueOf(eMonth);
  181.                         }
  182.                         else
  183.                         {
  184.                             strEMonth = String.valueOf(eMonth);
  185.                         }
  186.                          if (eMonth == nowMonth)
  187.                         {
  188.                             ifSelect = "selected";
  189.                         }
  190.                         else
  191.                         {
  192.                             ifSelect = "";
  193.                         }
  194.                        %>
  195.                         <option value = "<%=strEMonth%>"  <%=ifSelect%>><%=strEMonth%></option>
  196.                         <%
  197.                       }
  198.                       %>
  199.                       </select>
  200.                       月 
  201.                       <%
  202.                       // 输出起止年月结束
  203.                       %>
  204.                       &nbsp; </td>
  205.                   </tr>
  206.                   <tr bgcolor="#fafafa"> 
  207.                     <td align="center" valign="middle" height="30"><font class=strong>&nbsp;</font>
  208. <input type="button" value="统计" name="Submit" class=text onClick = "do_submit()">
  209.                     </td>
  210.                   </tr>
  211.                 </table>
  212.                 <table class=title cellspacing=1 cellpadding=2 width="600" border=0 >
  213. <%
  214.     double sCount = 0;
  215.     Iterator iterAll = pageAllColl.iterator();
  216.     try
  217.     {
  218.     while ( iterAll.hasNext() )
  219.     {
  220.         pageColl = (MemberDateSalary)iterAll.next();
  221.        
  222. %>
  223.             <tr> 
  224.                     <td  align="center" valign="top"><font class=strong>时间</font></td>
  225.     <%
  226.      // out.println(pageColl.getComponent().size());    
  227.     Iterator iter = pageColl.getComponent().iterator();
  228.     while ( iter.hasNext() )
  229.         {  
  230.                     DateComponentBean sc = (DateComponentBean)iter.next();
  231.           
  232.     %>
  233.                     <td align="center" valign="top"><font class=strong><%= sc.getName() %> 
  234.                       <input type=hidden name=component_id value=<%= sc.getId() %>>
  235.                       </font></td>
  236.     <%
  237.         }
  238.     %>
  239.                     <td  align="center" valign="top"><font class=strong>总额</font></td>
  240.             </tr>
  241.             <tr> 
  242.                     <td bgcolor="#fafafa"  align="center"><%= pageColl.getSDate().substring(0,4) %>-<%=pageColl.getSDate().substring(5,7)%></td>
  243.     <%
  244.       sCount = 0;
  245.       //out.println(pageColl.getComponent().size());
  246.       iter = pageColl.getComponent().iterator();
  247.       while ( iter.hasNext() )
  248.         {
  249.             DateComponentBean sc = (DateComponentBean)iter.next();
  250.             sCount += sc.getCount();
  251.     %>
  252.                     <td bgcolor="#fafafa" align="center"><%= sc.getCount() %></td>
  253.     <%
  254.         }
  255.     %>
  256.                     <td bgcolor="#fafafa" align="center"><%= sCount %></td>
  257.             </tr>
  258. <%
  259.    
  260.     }
  261.     } 
  262.     catch(Exception e)
  263.     {
  264.        //throw new Exception("您所选择的月份还没有生成工资信息.");
  265.        //  out.println("Exception"+e);
  266.     }
  267.    
  268. %>
  269.           </table>
  270.     </td>
  271.             </tr>
  272.           </table>
  273.          <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  274. </TD>
  275.     </TR>
  276.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  277.     </TABLE>
  278.   <BR>
  279.       <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  280.   </form></DIV>
  281. </BODY></HTML>