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

电子政务应用

开发平台:

Java

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