home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Benefits.asp < prev    next >
Text File  |  1997-11-01  |  9KB  |  295 lines

  1. <%@ LANGUAGE="VBSCRIPT" TRANSACTION=REQUIRED %>
  2. <% Option Explicit %>
  3. <!--#include file=libAuthenticate.inc-->
  4.  
  5. <%
  6.   Dim m_PreTaxTotal, m_AfterTaxTotal, m_CreditsTotal, m_PaycheckTotal, _
  7.   m_MainPrompt, m_Title, m_BenefitYear
  8.  
  9. 'Handle if Review or Open Enrollment
  10. If Request("Review") = 0 Then
  11.   m_BenefitYear = Year(Date) + 1
  12.   CreateOpenEnrollmentBenefits
  13.   m_Title = "Open Enrollment"
  14.   m_MainPrompt = "To review or change a benefit, click the appropriate item in the " & _
  15.     "<STRONG>Benefit</STRONG> column. <BR>" & _
  16.     "You can choose any available Plan for next year."
  17. Else
  18.   m_BenefitYear = Year(Date)
  19.   m_Title = "Review or Change Current Benefits"
  20.   m_MainPrompt = "To review or change a benefit, click the appropriate item in the " & _
  21.     "<STRONG>Benefit</STRONG> column. <BR>" & _
  22.     "After experiencing a qualifying event, you have a limited period to change a " & _
  23.     "current benefit."
  24. End If
  25.  
  26.   GetPreTaxTotal
  27.  
  28.   GetAfterTaxTotal
  29.  
  30.   GetCreditsTotal
  31.  
  32.   GetPaycheckTotal
  33.  
  34. %>
  35.  
  36. <!--BEGIN HTML-->
  37. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  38. <HTML>
  39. <HEAD>
  40. <!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
  41. <META NAME="DESCRIPTION" CONTENT="Exploration Air's Employee Benefits Summary">
  42. <META NAME="KEYWORDS" CONTENT="benefit, summary, review, change">
  43. <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
  44. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
  45. <!--END META TAGS-->
  46.  
  47. <TITLE><%= m_Title%></TITLE>
  48. </HEAD>
  49.  
  50. <BODY BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#228B22 LINK=#23238E>
  51. <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  52.  
  53. <!--Change link color on mouseover
  54.     Only if running Internet Explorer 4.0 or later -->
  55. <!--#include file=../libHighlight.inc-->
  56.  
  57. <!--COLOR BANNER_START-->
  58. <CENTER>
  59. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  60.   <TR>
  61.     <TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
  62.     </TD>
  63.   </TR>
  64. </TABLE>
  65. <!--COLOR BANNER_END-->
  66.  
  67. <!--BEGIN TABLE CONTAINING LOGO, TITLE AND NAVIGATIONAL LINK-->
  68. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  69.   <TR>
  70.     <TD VALIGN=TOP WIDTH=325>
  71.       <A HREF="../default.asp">
  72.         <IMG SRC="../images/logo_sm.gif" WIDTH=200 HEIGHT=100 
  73.           ALT="Return to Exploration Air Home Page" BORDER=0>
  74.       </A>
  75.       <BR>
  76.       <A HREF="default.asp">
  77.         <IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 HSPACE=5
  78.           ALT="Return to Employee Benefit Home Page" BORDER=0>
  79.       </A>
  80.       <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="2" ><STRONG>
  81.       <A HREF="default.asp" TITLE="Click to return to Employee Benefit Home Page">
  82.           EMPLOYEE BENEFITS HOME PAGE
  83.       </A>
  84.       </STRONG></FONT>
  85.     </TD>
  86.     <TD VALIGN=MIDDLE WIDTH=200>
  87.     </TD>
  88.     <TD VALIGN=MIDDLE WIDTH=200><FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
  89.       <%= m_Title%></FONT>
  90.     </TD>
  91.     <TD VALIGN=TOP ALIGN=RIGHT>
  92.       <A HREF="../HowItWorks/HIWBenefitsSummary.asp">
  93.         <IMG SRC="../images/btssmall.gif" WIDTH="115" HEIGHT="52" 
  94.           ALT="Click here to learn how this page works" BORDER=0>
  95.       </A>
  96.     </TD>
  97.   </TR>
  98. </TABLE>
  99. <!--END TABLE CONTAINING LOGO, TITLE AND NAVIGATIONAL LINK-->
  100.  
  101. <BR>
  102. <BR>
  103.  
  104. <!-- BEGIN TABLE CONTAINING THE EMPLOYEE'S BENEFITS INFO -->
  105. <CENTER>
  106. <%= m_MainPrompt%>
  107.  
  108. <P>
  109. <TABLE BORDER=1 WIDTH=90%>
  110.   <TR>
  111.     <TD>
  112.       <TR>
  113.         <TH>
  114.           Benefit
  115.         </TH>
  116.         <TH>
  117.           Plan
  118.         </TH>
  119.         <TH>
  120.           Tax Status
  121.         </TH>
  122.         <TH>
  123.           Cost per Period
  124.         </TH>
  125.       </TR>
  126.  
  127. <!--Output benefit detail lines -->
  128. <% ListBenefitSummary %>
  129.  
  130.         <TR>
  131.           <TD COLSPAN=3 ALIGN="RIGHT">
  132.             Cost of Pre-tax benefits:
  133.           </TD>
  134.           <TD COLSPAN=3 ALIGN="RIGHT">
  135.             <% If IsNull(m_PreTaxTotal) Then m_PreTaxTotal = 0 %>
  136.             <% = FormatCurrency(m_PreTaxTotal) %>
  137.           </TD>
  138.         </TR>
  139.         <TR>
  140.           <TD COLSPAN=3 ALIGN="RIGHT">
  141.             Cost of After-tax benefits:
  142.           </TD>
  143.           <TD COLSPAN=3 ALIGN="RIGHT">
  144.             <% If IsNull(m_AfterTaxTotal) Then m_AfterTaxTotal = 0 %>
  145.             <% = FormatCurrency(m_AfterTaxTotal) %>
  146.           </TD>
  147.         </TR>
  148.         <TR>
  149.           <TD COLSPAN=3 ALIGN="RIGHT">
  150.             Total cost of benefits:
  151.           </TD>
  152.           <TD COLSPAN=3 ALIGN="RIGHT">
  153.             <% = FormatCurrency(m_PreTaxTotal + m_AfterTaxTotal) %>
  154.           </TD>
  155.         </TR>
  156.         <TR>
  157.           <TD COLSPAN=3 ALIGN="RIGHT">
  158.             Flex dollars:
  159.           </TD>
  160.           <TD COLSPAN=3 ALIGN="RIGHT">
  161.             <% If IsNull(m_CreditsTotal) Then m_CreditsTotal = 0 %>
  162.             <%= FormatCurrency(m_CreditsTotal)%>
  163.           </TD>
  164.         </TR>
  165.         <TR>
  166.           <TD COLSPAN=3 ALIGN="RIGHT">
  167.             With selected benefits your regular paycheck will pay:
  168.           </TD>
  169.           <TD COLSPAN=3 ALIGN="RIGHT">
  170.             <% If IsNull(m_PaycheckTotal) Then m_PaycheckTotal = 0 %>
  171.             <%= FormatCurrency(m_PaycheckTotal)%>
  172.           </TD>
  173.         </TR>
  174.     </TD>
  175.   </TR>
  176. </TABLE>
  177. </CENTER>
  178. <BR>
  179.  
  180. <P> 
  181. <HR=400>
  182. <P>
  183.  
  184. <CENTER>
  185. <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
  186. <A HREF="../legal.htm" NAME=Legal TITLE="Click to view Copyright and Legal Information">
  187.   ©1997 Microsoft Corporation. All rights reserved. Terms of Use.
  188. </A>
  189. </FONT>
  190. </CENTER>
  191.  
  192. <P>
  193.  
  194. <!--BEGIN COLOR BANNER-->
  195. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  196.   <TR>
  197.     <TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20>
  198.     </TD>
  199.   </TR>
  200. </TABLE>
  201. <!--END COLOR BANNER-->
  202.  
  203. </BODY>
  204. </HTML>
  205. <!--END HTML-->
  206.  
  207. <%
  208.  
  209.   '
  210.   ' If first time into Open Enrollment, Create Employee Benefit records for Open Enrollment year 
  211.   '
  212.   Sub CreateOpenEnrollmentBenefits
  213.     Dim BenefitList, rstBenefitsForID
  214.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  215.     Set rstBenefitsForID = BenefitList.BenefitsForID(Application("DSNBenefits"), Session("EmployeeID"), _
  216.       m_BenefitYear)
  217.     If rstBenefitsForID.EOF Then
  218.       Dim Employee
  219.       Set Employee = Server.CreateObject("Benefit.Employee")
  220.       Employee.NewBenefits Application("DSNBenefits"), Session("EmployeeId"), m_BenefitYear
  221.     End If
  222.   End Sub
  223.  
  224.   '
  225.   ' Generate the rows for a table consisting of the Benefits for the current employee
  226.   '
  227.   Sub ListBenefitSummary
  228.     Dim BenefitList, rstBenefitSummary
  229.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  230.     Set rstBenefitSummary = BenefitList.SummaryForID(Application("DSNBenefits"), Session("EmployeeID"), _
  231.       m_BenefitYear)
  232.     Do Until rstBenefitSummary.EOF
  233.       Response.Write "<TR>" & Chr(13)
  234.       Response.Write "<TD><A HREF=" & rstBenefitSummary("DetailTemplate") & _
  235.        "?BenefitId=" & rstBenefitSummary("BenefitId") & _
  236.         "&Review=" & Request("Review") & " TITLE='Click to view " & _
  237.         rstBenefitSummary("BenefitLabel") & " benefit information'>" & Chr(13) & _
  238.         rstBenefitSummary("BenefitLabel") & "</A></TD>" & Chr(13)
  239.       Response.Write "<TD ALIGN=RIGHT> "
  240.       Response.Write rstBenefitSummary("PlanLabel")
  241.       Response.Write "</TD>" & Chr(13)
  242.       Response.Write "<TD ALIGN=RIGHT> "
  243.       If rstBenefitSummary("PlanCost") > 0 Then
  244.         Response.Write rstBenefitSummary("TaxStatusLabel")
  245.       Else
  246.         Response.Write " "
  247.       End If
  248.       Response.Write "</TD>" & Chr(13)
  249.       
  250.       Response.Write "<TD ALIGN=RIGHT> "
  251.       If rstBenefitSummary("PlanCost") > 0 Then
  252.         Response.Write FormatCurrency(rstBenefitSummary("PlanCost"))
  253.       Else
  254.         Response.Write " "
  255.       End If
  256.       
  257.       Response.Write "</TD>" & Chr(13)
  258.       Response.Write "</TR>" & Chr(13)
  259.       
  260.       rstBenefitSummary.MoveNext
  261.     Loop
  262.   End Sub
  263.  
  264.   Sub GetPreTaxTotal
  265.     Dim BenefitList, TaxStatusID
  266.     'For Tax Status of: PreTax
  267.     TaxStatusID = 2
  268.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  269.     m_PreTaxTotal = BenefitList.GetTotalCost(Application("DSNBenefits"), Session("EmployeeID"), _
  270.       m_BenefitYear, TaxStatusID)
  271.   End Sub
  272.  
  273.   Sub GetAfterTaxTotal
  274.     Dim BenefitList, TaxStatusID
  275.     'For Tax Status of: AfterTax
  276.     TaxStatusID = 1
  277.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  278.     m_AfterTaxTotal = BenefitList.GetTotalCost(Application("DSNBenefits"), Session("EmployeeID"), _
  279.       m_BenefitYear, TaxStatusID)
  280.   End Sub
  281.  
  282.   Sub GetCreditsTotal
  283.     Dim BenefitList
  284.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  285.     m_CreditsTotal = BenefitList.GetTotalCredits(Application("DSNBenefits"), Session("EmployeeID"), _
  286.       m_BenefitYear)
  287.   End Sub
  288.  
  289.   Sub GetPaycheckTotal
  290.     Dim BenefitList
  291.     Set BenefitList = Server.CreateObject("Benefit.BenefitList")
  292.     m_PaycheckTotal = BenefitList.GetTotalPaycheck(Application("DSNBenefits"), Session("EmployeeID"), _
  293.       m_BenefitYear)
  294.   End Sub
  295. %>