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

  1. <%
  2.  
  3.   ' Save URL of calling page as needed
  4.   SetURLCallHIW
  5.  
  6. %>
  7.  
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  9. <HTML>
  10. <HEAD>
  11. <!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
  12. <META NAME="DESCRIPTION" CONTENT="How It Works Page">
  13. <META NAME="KEYWORDS" CONTENT="help, code, source code, questions, explanation">
  14. <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
  15. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
  16. <!--END META TAGS-->
  17.  
  18. <TITLE>How This Page Works</TITLE>
  19. </HEAD>
  20.  
  21. <BODY  BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#808080 LINK=#FFCC00>
  22. <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  23.  
  24. <!--Change link color on mouseover
  25.     Only if running Internet Explorer 4.0 or later -->
  26. <!--#include file=../libHighlight.inc-->
  27.  
  28. <!--BEGIN TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
  29. <TABLE WIDTH="100%" HEIGHT="100%" CELLPADDING=0 CELLSPACING=0  BGCOLOR="#000000" BORDER=0>
  30.   <TR>
  31.     <TD BGCOLOR="#000000" ALIGN=CENTER VALIGN=TOP WIDTH=170>
  32.       <BR>
  33.       <IMG SRC="../images/btslarge.jpg" HEIGHT=119 WIDTH=171  
  34.         ALT="Behind the Scenes at Exploration Air" BORDER=0 >
  35.       <BR>
  36.       <BR>
  37.       <BR>
  38.       <!--BACK BUTTON AND VARIABLE TO RETURN TO ORIGINATING PAGE-->
  39.       <A HREF="<%=Session("URLCallHIW")%>">
  40.         <IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 ALT="Return to Exploration Air Benefits"  
  41.           HSPACE=2 BORDER=0>
  42.       </A>
  43.       <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA"><STRONG>
  44.         <A HREF="<%=Session("URLCallHIW")%>" TITLE="Return to Exploration Air Benefits">
  45.           B  A  C  K 
  46.         </A>
  47.       </STRONG></FONT>
  48.       <BR> 
  49.       <BR>
  50.       <!--JAVASCRIPT TO VIEW PAGE'S SOURCE CODE-->
  51.       <FONT SIZE=2 FACE="VERDANA, ARIAL, HELVETICA">
  52.         <A HREF="JavaScript:openWindow('../Benefits/Change.asp')" 
  53.           TITLE="View the Source for the Default page">
  54.           V I E W   S O U R C E
  55.         </A>
  56.         <BR>
  57.       </FONT>
  58.     </TD>
  59.     <TD BGCOLOR="#FFFFFF" BACKGROUND="../images/btsbg.gif" VALIGN=top>
  60.       <BR CLEAR=ALL>
  61.       <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=0>   
  62.         <TR>
  63.           <TD VALIGN=top>
  64.             <FONT FACE="VERDANA, ARIAL, HELVETICA" COLOR="#0000FF" SIZE=5>
  65.               How The Qualifying Change Entry Page Works
  66.             </FONT>
  67.             <P>
  68.             <HR>
  69.             <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="3">
  70.                         
  71.             <H2>The Big Picture</H2>
  72.  
  73.             This page is for entry of information about changes in marital status, childbirth, and so on. 
  74.             Such changes may enable modifying current benefit choices.
  75.  
  76.             <H2>Functional Overview</H2>
  77.  
  78.             As on most other pages in the Benefits application, a few standard tasks are
  79.             done at the top of the page. The first is that VBScript is declared the default 
  80.             scripting language for the page. Next, "TRANSACTION=REQUIRED" is specified to cause
  81.             Microsoft® Transaction Server to wrap the actions of the page in a transaction.
  82.             Then, "Option Explicit" is specified so that an error will generate unless
  83.             all the variables on the page are explicitly declared. This protects against
  84.             errors caused by misspelling a variable name and having the server treat 
  85.             the misspelled variable name as a new variable declaration.
  86.         
  87.             <P>Next, libAuthenticate.inc checks whether the user has a Session variable containing
  88.             the EmployeeId. If not, then the request is redirected to Benefits/Default.asp 
  89.             to ensure that the application is properly initialized for the user.
  90.              
  91.             <P>Next, page variables are initialized, then the subprocedure BuildChangeQualifierList
  92.             is called to create a select list of the available Qualifiers from
  93.             the database by calling the component method 
  94.             <STRONG><A HREF=HIWBenefitsComponent.asp#ChangeQualifierList>
  95.             BenefitList.ChangeQualifierList</A></STRONG>. The page is sent to the client
  96.             browser for entry of the change information. A client-side script is run to validate 
  97.             the data entered, then the data is sent to the server. The server runs a 
  98.             subprocedure to get the data into the appropriate fields, then calls a function
  99.             called "UpdateDatabase" to update the database. The UpdateDatabase function calls
  100.             the component method <STRONG><A HREF=HIWBenefitsComponent.asp#AddQualifier>
  101.             BenefitList.AddQualifier</A></STRONG> to update the database.
  102.  
  103.             <H2>Data Model</H2>
  104.  
  105.             You can view a diagram of the <STRONG><A HREF="HIWBenefitsSchema.asp">database</A></STRONG>.
  106.  
  107.             <P>
  108.             <H2>Components Used</H2>
  109.  
  110.             This pages uses methods in the BenefitList class of the Benefit component.
  111.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#ChangeQualifierList>BenefitList.ChangeQualifierList</A></STRONG>
  112.             <BR><STRONG><A HREF=HIWBenefitsComponent.asp#AddQualifier>BenefitList.AddQualifier</A></STRONG>
  113.  
  114.             <P>
  115.             </FONT>
  116.           </TD>
  117.         </TR>
  118.       </TABLE>
  119.       <!--END TOP TABLE HOLDING GRAPHIC, NAVIGATIONAL LINK, AND MAIN CONTENT-->
  120.  
  121.       <BR>
  122.       <BR>
  123.  
  124.       <CENTER>
  125.       <!--BEGIN LEGAL INFORMATION-->
  126.       <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
  127.         <TR>
  128.           <TD>
  129.             <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1">
  130.               <A HREF="../legal.htm">
  131.                 ©1997 Microsoft Corporation. All rights reserved. Terms of Use.
  132.               </A>
  133.             </FONT>
  134.             <P>
  135.           </TD>
  136.         </TR>
  137.       </TABLE>
  138.       </CENTER>
  139.       <!--END LEGAL INFORMATION-->
  140.     </TD>
  141.   </TR>
  142. </TABLE>
  143.  
  144. </BODY>
  145. </HTML>
  146. <!--END HTML-->
  147.  
  148. <SCRIPT LANGUAGE="JavaScript">
  149. function openWindow(SourceURL)
  150. {
  151.     // Set some defaults
  152.     width=450;
  153.     height=450;
  154.  
  155.     url = "code.asp?Source=" + SourceURL;
  156.     window.open(url,"Sample","resizable=yes,scrollbars=yes,width=" + width + ",height=" + height);
  157. }
  158. </SCRIPT>
  159.  
  160. <%
  161.  
  162.   '
  163.   ' SetURLCallHIW saves the name of the page in the application that called HIW page
  164.   '
  165.   Sub SetURLCallHIW
  166.     ' Extract the last directory from path
  167.     Dim strPathInfo, strLastChar, intLocation, ShortString, strLastDir
  168.     strPathInfo = Request.ServerVariables("HTTP_REFERER")
  169.     ' now str has a value like: "http://servername/exair/benefits/Default.asp"
  170.     ' we need to extract "benefits"
  171.     strLastChar = ""
  172.     ShortString = strPathInfo
  173.     intLocation = 0
  174.     
  175.     If Len(ShortString) > 0 Then
  176.         ' Get position of beginning of file name
  177.         Do Until strLastChar = "/"
  178.           strLastChar = right(ShortString, 1)
  179.           ShortString = left(ShortString, len(ShortString)-1)
  180.           intLocation = intLocation + 1
  181.         Loop
  182.     
  183.         ' Now get position of beginning of last directory name
  184.         strLastChar = ""
  185.         Do Until strLastChar = "/"
  186.           strLastChar = right(ShortString, 1)
  187.           ShortString = left(ShortString, len(ShortString)-1)
  188.           intLocation = intLocation + 1
  189.         Loop
  190.         strLastDir = mid(strPathInfo, len(strPathInfo) - (intLocation - 2), 10)
  191.     
  192.         ' If last directory not 'HowItWorks', then save the calling URL
  193.         If strLastDir <> "HowItWorks" Then
  194.           Session("URLCallHIW") = strPathInfo
  195.         End If
  196.     End If
  197.   End Sub
  198.  
  199. %>
  200.