The Workings of the Online Appraisal Application


The online appraisal application used by Electric Components, Inc. allows its employees to participate directly in the appraisal process. The three basic entities involved in the appraisal system are employee, reviewer, and administrator. Employees can view the targets assigned to them, rate themselves on the given targets, and view the ratings given by the reviewer. They can view their performance ratings and recommendations for either the whole year or a selected appraisal period. The reviewer is basically an employee who is senior to the employee under consideration. Reviewers select employees and view their performance for selected appraisal periods—quarterly or annually. They can rate the target achievements, view annual as well as quarterly performance, and evaluate annual performance. They also describe and set targets for selected employees.

The appraisal policy is based on information provided by the administrator. Administrators specify the start and end score ranges, which determine salary increments. Because different countries have different policies, administrators also decide the country that is to be selected.

Before using this application, the administrator creates a data source called ElectricComp through the ColdFusion MX Administrator page. The steps for creating data sources were discussed in Chapter 13, "Creating the Knowledge Bank Application." You can follow those steps to create a data source known as ElectricComp. The database type is SQL Server, and the name of the database is ElectricComp.

Validating Employees

When an employee types the application's URL into the Address box of the browser, the Employee Validation page is displayed. When the Employee Validation page is submitted, CallValidate.cfm is loaded. This file validates the employee. Here's the code for CallValidate.cfm:

 <cfswitch expression="#Form.country#">   <cfdefaultcase>     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "USA">   </cfdefaultcase>   <cfcase value="USA">     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "USA">   </cfcase>   <cfcase value="Austria">     <cfset SESSION.DSN = "ElectricComp"?     <cfset SESSION.Country = "Austria">   </cfcase>   <cfcase value="Brazil">     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "Brazil">   </cfcase>   </cfswitch>   <HTML>   <HEAD>   <TITLE>Electric Components' Online Appraisal Application: Employee                  Appraisal Form</TITLE>   <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Proiect4.css">   </HEAD>   <BODY>   <DIV align="center" >    Online Appraisal Application: Employee Validation    </DIV>    <BR>   <cfset timeout = 300>   <cflogin idleTimeout="#timeout#">        <cfinvoke component="ValidateEmployee" method="getRoles"           returnVariable="ResultRoles" strEmpCode=#Form.empcode#           strEmpPassword=#Form.password# strEmpDataSource=#SESSION.DSN#>        <CFIF #ResultRoles# EQ "Invalid">             <cfoutput>                 <P >Login Is Invalid</P>                 <a href="Start.CFM">Back to Employee Validation Page</a>                 </body>                 </html>             </cfoutput>             <cfabort>         <CFELSEIF #find(#Form.approle#,#ResultRoles#)# GT 0>             <cfloginuser name="#form.empcode#"                    password="#trim(form.password)#" roles="#Form.approle#">         <CFELSE>             <cfoutput>                 <P >You Are NOT Assigned the Role You                          Selected for Validation.</P>                 <a href="Start.CFM">Back to Employee Validation Page</a>                 </body>                 </html>             </cfoutput>         <cfabort>     </CFIF> </cflogin> <CFSET SESSION.EmpCode = #Form.empcode#> <cfswitch expression="#Form.approle#">   <cfdefaultcase>     <CFLOCATION URL="AppraisalForm.cfm" ADDTOKEN="no">   </cfdefaultcase>   <cfcase value="Employee">     <CFLOCATION URL="AppraisalForm.cfm" ADDTOKEN="no">   </cfcase>   <cfcase value="Reviewer">     <CFLOCATION URL="ReviewerMain.cfm" ADDTOKEN="no">   </cfcase>   <cfcase value="Admin">     <CFLOCATION URL="AdminPolicyPage.cfm" ADDTOKEN="no">   </cfcase> </cfswitch> 

In this code, the <CFSWITCH> and <CFCASE> tags determine the database to be used for the country selected by the employee. Based on the country, the data source name is assigned to the SESSION.DSN variable. In this case, I've used the name ElectricComp.

The <cfset> tag assigns a value to the timeout variable. I've used this variable to specify the idleTimeOut in the <cflogin> tag. If the session is left idle until the idleTimeOut limit, ColdFusion logs out the employee automatically.

The ValidateEmployee component validates employees. This component is saved in ValidateEmployee.cfc. The <cfinvoke> tag activates this component. The component attribute specifies the name of the component. The method attribute specifies the name of the method used, in this case getRoles. The return value from the component is received in a variable called ResultRoles. This is defined as the value for the returnVariable attribute.

ValidateEmployee accepts three arguments, which are passed through the <cfinvoke> tag as an argument name/value pair. Employee code, password, and data source name are the arguments passed for this component.

This listing shows the code for ValidateEmployee in ValidateEmployee.cfc:

 <cfcomponent>     <cffunction name="getRoles" returntype="string">         <cfargument name="strEmpCode" type="string" required="true">         <cfargument name="strEmpPassword" type="string" required="true">         <cfargument name="strEmpDataSource" type="string" required="true">         <cfquery name="InfoLogin"               datasource='#arguments.strEmpDataSource#'>                SELECT Roles                FROM tblLogins                WHERE EmpCode = '#arguments.strEmpCode#'                AND Password = '#arguments.strEmpPassword#'           </cfquery>         <CFIF InfoLogin.RECORDCOUNT IS 0>              <cfset myResult="Invalid">         <CFELSE>             <cfoutput query="InfoLogin">                 <cfset myResult=#Roles#>             </cfoutput>         </CFIF>         <cfreturn myResult>     </cffunction> </cfcomponent> 

In ColdFusion MX, the <cfcomponent> tag is used to create components. Various methods can be created in a component. The <cffunction> tag creates a method whose name is specified in the name attribute. The datatype of the return value is specified by the returntype attribute.

The <cfargument> tag declares the arguments for the component. The names and datatypes of the arguments are defined using the name and type attributes of the <cfargument> tag. The required attribute is set to TRUE if the argument is mandatory, and FALSE if it's optional.

In this code, getRoles validates the employee by using the arguments provided. If validation is successful, the roles assigned to the employee are returned using the <cfreturn> tag. If validation isn't successful, the component returns invalid. Based on this return value, the code section after the <cfinvoke> call either returns a relevant message or redirects the employee to a specified page. A <cfswitch> construct is used to implement this decision-making process. The employee code, password, and roles are saved using the <cfloginuser> tag.

Working with the Appraisal Form

Upon successful validation of the employee, AppraisalForm.cfm is loaded to display the Appraisal Form page.

This page has two forms: AppraisalForm and ViewPerformance.

Filling Self Ratings Against the Targets

AppraisalForm displays the appraisal form with targets assigned to the employee. If there are no targets assigned for the current appraisal period, the application shows a message stating so. Alternatively, the targets are displayed to the employee.

The get_Appraisal_ID query fetches AppraisalID for the appraisal record created for the current appraisal period. It also retrieves AppraisalPeriod, AppraisalYear, and ReviewerCode from the tblQtrlyAppraisals table. These values are stored in the variables for further use. ReviewerCode obtains the name of the reviewer. AppraisalID fetches the targets from tblQtrlyAppraisalDetails.

ConvertQuarterToText converts the quarters from numeric to text. For example, it converts Quarter "1" to "Jan–Mar". This code snippet from AppraisalForm.cfm shows how to call this component:

 <cfinvoke component="ConvertQuarterToText" method="TextQtr" returnVariable="QtrInText" QtrNumber=#varAppraisalPeriod#> 

The method and returnVariable attributes are shown in the code. The argument passed to this component is QtrNumber. Here's the code for the component:

 <cfcomponent>     <cffunction name="TextQtr" returntype="string">         <cfargument name="QtrNumber" type="numeric" required="true">         <cfswitch expression=#arguments.QtrNumber#>               <cfdefaultcase>                    <cfset myResult = "Jan–Mar">               </cfdefaultcase>               <cfcase value=1>                 <cfset myResult = "Jan–Mar">               </cfcase>               <cfcase value="2">                 <cfset myResult = "Apr–June">               </cfcase>               <cfcase value="3">                 <cfset myResult = "July–Sep">               </cfcase>               <cfcase value="4">                 <cfset myResult = "Oct–Dec">               </cfcase>         </cfswitch>         <cfreturn myResult>     </cffunction> </cfcomponent> 

The <cfswitch> and <cfcase> tags create a simple component that carries out the conversion. The converted value is returned in myResult.

This code snippet from AppraisalForm.cfm shows how Targets, SelfRating, and ReviewerRating are displayed on the page. The get_Appraisal_info query is used to fetch records:

 <TABLE border = "1" cellpadding="3" cellspacing="3">       <TH>Target Description</TH>      <TH>Self Rating</TH>      <TH>Reviewer's Rating</TH>      <CFOUTPUT QUERY = "get_Appraisal_info">         <TR>             <TD><B>#Targets#</B></TD>             <TD><INPUT TYPE="Text" NAME="#TargetID#" Value = "#SelfRating#"                        SIZE="20">             </TD>             <TD>#ReviewerRating#</TD>         </TR>     </CFOUTPUT> </TABLE> 

SelfRating is displayed in a text box and can be used by employees to fill in their self ratings. They can update these ratings by clicking Update Self Ratings. This loads UpdateAppraisalRatings.cfm and updates the SelfRating field in tblQtrlyAppraisalDetails. The complete code for UpdateAppraisalRatings.cfm is given in the code listing section of this chapter.

View Your Own Performance and Recommendations

Employees use the ViewPerformance form to view their average score for a selected quarter and the annual score for a selected year. This form also displays the recommendations for annual performance based on the policy for that year. I've implemented this feature by using the PerformanceInfoProvider component. This component has two methods: one fetches the annual performance information, and the other fetches the quarterly performance information.

The employee enters a year and clicks Show Annual Info to view the annual score and recommendation. ViewPerformance.cfm is loaded and the information is displayed in the Performance and Recommendations page. This code snippet from ViewPerformance.cfm shows how PerformanceInfoProvider is called:

 <cfinvoke component="PerformanceInfoProvider"            method="getAnnualInfo"            returnVariable="ResultAnnualInfo"            strEmpCode=#SESSION.EmpCode#            strAppYear=#Form.Year#            strEmpDataSource=#SESSION.DSN#> 

In this case, I've used getAnnualInfo of the component to retrieve the information and view annual performance. Let's examine the code for the called method:

 <cffunction name="getAnnualInfo" returntype="query"            access="remote" output="false">          <cfargument name="strEmpCode" type="string" required="true">          <cfargument name="strAppYear" type="string" required="true">          <cfargument name="strEmpDataSource" type="string" required="true">          <CFQUERY NAME="get_Annual_info"                   DATASOURCE="#arguments.strEmpDataSource#">            SELECT * FROM tblAnnualAppraisalResults            WHERE EmpCode = '#arguments.strEmpCode#'            AND AppraisalYeanr= '#arguments.strAppYear#'          </CFQUERY>          <cfreturn get_Annual_info> </cffunction> 

getAnnualInfo accepts three arguments that are used in the <CFQUERY> tag and the SELECT statement to fetch information from tblAnnualAppraisalResults. The return datatype for this method is "query". It uses the <cfreturn> tag to return get_annual_info, which is the returned query. The returned query is used in ViewPerformance.cfm, as shown in this code snippet:

 <CFIF ResultAnnualInfo.RECORDCOUNT GT 0>          <P >&nbsp Your Annual Performance and Recommendations          for Year <cfoutput>#Form.Year#</cfoutput> :</P>          <TABLE cellpadding="3" cellspacing="3">          <TH width="40%">Final Score Based on Ratings</TH>          <TH>Recommendation</TH>          <CFOUTPUT QUERY = "ResultAnnualInfo">              <TR>                   <TD align="center"><B>#FinalScore#</B></TD>                   <TD>#Recommendations#</TD>              </TR>          </CFOUTPUT>          </TABLE>      <CFELSE>          <cfoutput>              <P >No Record Found for Annual Performance for the              Given Year.</P>          </cfoutput> </CFIF> 

To view quarterly performance, the employee has to specify the period and year of appraisal. getQuarterlyInfoHeader of the PerformanceInfoProvider returns the query for this information. This code from ViewPerformance.cfm shows how getQuarterlyInfoHeader is called:

 <cfinvoke component="PerformanceInfoProvider" method="getQuarterlyInfoHeader" returnVariable="ResultQtrlyHeaderInfo" strEmpCode=#SESSION.EmpCode# strAppPeriod=#Form.AppPeriod# strAppYear=#Form.AppYear# strEmpDataSource=#SESSION.DSN#> 

This method accepts four arguments. The result is returned in ResultQtrlyHeaderInfo. This code snippet from PerformanceInfoProvider.cfc shows how to code the second method:

 <cffunction name="getQuarterlyInfoHeader" returntype="query" access="remote" out- put="false">          <cfargument name="strEmpCode" type="string" required="true">          <cfargument name="strAppPeriod" type="numeric" required="true">          <cfargument name="strAppYear" type="string" required="true">          <cfargument name="strEmpDataSource" type="string" required="true">          <CFQUERY NAME="get_Quarterly_info_Header"              DATASOURCE="#arguments.strEmpDataSource#">              SELECT tblQtrlyAppraisals.*,tblEmployees.EmployeeName FROM              tblQtrlyAppraisals,tblEmployees              WHERE tblQtrlyAppraisals.EmpCode = '#arguments.strEmpCode#'              AND AppraisalPeriod = #arguments.strAppPeriod#              AND AppraisalYear = '#arguments.strAppYear#'              AND tblQtrlyAppraisals.ReviewerCode = tblEmployees.EmpCode          </CFQUERY>          <cfreturn get_Quarterly_info_Header> </cffunction> 

getQuarterlyInfoHeader returns the reviewer's name and the average score for the targets achieved in the selected quarter. This information is retrieved from tblQtrlyAppraisals and tblEmployees tables. The query get_Quarterly_info_Header is returned through the <cfreturn> tag. This information is received in ResultQtrlyHeaderInfo. This code from ViewPerformance.cfm shows how to display the information:

 <CFIF ResultQtrlyHeaderInfo.RECORDCOUNT GT 0>      <cfoutput>      <P >&nbsp Your Quarterly Total Score for Quarter        #Form.AppPeriod#        for Year #Form.Year#:</P></Cfoutput>          <TABLE cellpadding="3" cellspacing="3">          <TH>Reviewer Name</TH>          <TH>Score</TH>          <CFOUTPUT QUERY = "ResultQtrlyHeaderInfo">               <TR>                   <TD><B>#EmployeeName#</B></TD>                   <TD>#Score#</TD>               </TR>           </CFOUTPUT>           </TABLE>       <CFELSE>           <cfoutput>               <P >No Record Found for Quarterly Performance for the                Given Quarter and Year.</P>           </cfoutput> </CFIF> 

The results are displayed in a tabular manner. If no record is returned, a message is displayed to the employee.

Working with the Reviewer Main Page

ReviewerMain.cfm is loaded when the validated employee chooses to work as a reviewer. The reviewer initiates the process of rating the current targets assigned to an employee. The reviewer can also evaluate the annual performance of a selected employee from this page. ProcessReviewerMain.cfm handles the actions taking place on this page.

Assigning Targets to a Selected Employee

To start the appraisal process for a quarter, first a reviewer has to assign targets to the employees. On the Review Main page, the reviewer selects an employee and fills the targets in the Text Box controls placed on the lower-left side of the form. A maximum of six targets can be assigned to an employee, as per the company policy. After filling in the targets, the reviewer clicks Save Targets to save them in the tblQtrlyAppraisals. ProcessReviewerMain.cfm is loaded to handle the request for saving the targets. This code snippet from ProcessReviewerMain.cfm shows how this is done:

 <CFIF #Form.btnActivity# EQ "Save Targets">     <CFQUERY NAME="FindAppraisal" DATASOURCE=#SESSION.DSN#>         SELECT AppraisalID FROM tblQtrlyAppraisals         WHERE EmpCode = '#Form.Selected_Employee#'         AND AppraisalPeriod = #Form.AppPeriod#         AND AppraisalYear = '#Form.AppYear#'     </CFQUERY>     <CFIF FindAppraisal.RECORDCOUNT EQ 0>          <cfset varHeaderFlag = "Yes">          <cfset varTargetCount = 1>          <CFLOOP INDEX = "element" FROM = "1" T0="6">              <cfset varTarget = Evaluate("Form.#element#")>              <CFIF varTarget GT "">                   <CFIF varHeaderFlag EQ "Yes">                        <CFQUERY NAME="AddAppraisalHeader" DATASOURCE=#SESSION.DSN#>                            INSERT INTO                            tblQtrlyAppraisals(EmpCode,ReviewerCode,AppraisalPeriod,                            AppraisalYear,Score,Status)                            VALUES                            ('#Form.Selected_Employee#','#SESSION.EmpCode#',                            #Form.AppPeriod#,'#Form.AppYear#',0,'Open')                       </CFQUERY>                      <CFQUERY NAME="GetAppraisalID" DATASOURCE=#SESSION.DSN#>                          SELECT AppraisalID FROM tblQtrlyAppraisals                          WHERE EmpCode = '#Form.Selected_Employee#'                          AND AppraisalPeriod = #Form.AppPeriod#                          AND AppraisalYear = '#Form.AppYear#'                      </CFQUERY>                      <cfoutput query="GetAppraisalID">                          <cfset varAppID = #AppraisalID#>                      </cfoutput>                      <cfset varHeaderFlag = "No">                  </CFIF>                  <CFQUERY NAME="AddTargets" DATASOURCE=#SESSION.DSN#>                           INSERT INTO tblQtrlyAppraisalDetails(AppraisalID,                           TargetID,Targets)                           VALUES (#varAppID#,#varTargetCount#,'#varTarget#')                  </CFQUERY>                  <cfset varTargetCount = varTargetCount + 1>              </CFIF>         </CFLOOP>         <P >The Targets for This Employee Have Been Successfully          Defined.<BR>         Click on the Rate Current Targets Button to View and Rate the Targets.          </P>     <CFELSE>     <cfoutput><P >The Targets for This Employee Have Already Been      Defined.<BR>     Click on the Rate Current Targets Button to View and Rate the Targets.      </P>      </cfoutput>      <cfabort>     </CFIF> </CFIF> 

The code first checks if the targets have already been assigned to the employees. If the targets have been assigned, it gives a message to the end user. Alternatively, it inserts a record in the tblQtrlyAppraisals table for the appraisal period and year selected by the reviewer. The AppraisalID is generated automatically.

The next set of statements uses relevant information in the WHERE clause to fetch the record and assign the AppraisalID to the record just inserted in the tblQtrlyAppraisals table.

This AppraisalID then inserts the targets into tblQtrlyAppraisalDetails. After the loop has been completed for all six targets, a message is given to the end user. If any of the six targets haven't been specified, the code skips the empty text boxes.

Rating the Employee Performance

Toward the end of a quarter, the reviewer has to rate the performance of employees against assigned targets. This task is done from the Reviewer Main page. The reviewer selects the employee for whom the targets are to be rated and clicks Rate Current Targets. ProcessReviewerMain.cfm is reloaded. The code in the file checks if Rate Current Targets has been clicked and redirects the reviewer to AppraisalReviewerForm.cfm. This code shows how this is done:

 <CFIF trim(#Form.btnActivity#) EQ "Rate Current Targets">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <CFLOCATION URL="AppraisalReviewerForm.cfm" ADDTOKEN="no"> </CFIF> 

The Appraisal Reviewer Form page is displayed to the reviewer. This page shows the targets and the employee's self ratings. The reviewer enters ratings in the text boxes provided with each target. This code from AppraisalReviewerForm.cfm shows how Targets and SelfRatings are displayed for the reviewer:

 <CFQUERY NAME="get_Appraisal_ID" DATASOURCE=#SESSION.DSN#>     SELECT AppraisalID AS AppID,AppraisalPeriod,AppraisalYear     FROM tblQtrlyAppraisals     WHERE EmpCode = '#SESSION.SELEMP#'     AND Status='Open' </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee         Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" > Online Appraisal Application: Appraisal Reviewer Page </DIV> <CFIF get_Appraisal_ID.RECORDCOUNT GT 0>     <CFOUTPUT QUERY = "get_Appraisal_ID">         <CFSET varAppID = #AppID#>         <CFSET SESSION.CurrentAppID = #AppID#>         <CFSET varAppraisalPeriod = #AppraisalPeriod#>         <CFSET varAppraisalYear = #AppraisalYear#>     </CFOUTPUT>     <cfinvoke component="ConvertQuarterToText" method="TextQtr"      returnVariable="QtrInText" QtrNumber=#varAppraisalPeriod#>     <CFQUERY NAME="get_Employee_Name" DATASOURCE=#SESSION.DSN#>         SELECT EmployeeName FROM tblEmployees         WHERE EmpCode = '#SESSION.SELEMP#'     </CFQUERY>     <CFOUTPUT QUERY = "get_Employee_Name">         <CFSET varEmployeeName = #EmployeeName#>     </CFOUTPUT>     <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>         SELECT * FROM tblQtrlyAppraisalDetails         WHERE AppraisalID = #varAppID#         ORDER BY TargetID ASC     </CFQUERY>         <DIV ALIGN="center">          <FORM ACTION="RateTargets.cfm" METHOD="POST" name="AppraisalForm"           >          <cfoutput><P >These are Targets for Employee:          #varEmployeeName# for Appraisal Period:  #QtrInText# for Year          #varAppraisalYear#. <BR>          </P>          </cfoutput>          <TABLE Border = "1" cellpadding="3" cellspacing="3">            <TH>Target Description</TH>          <TH>Self Rating</TH>          <TH>Reviewer's Rating</TH>          <CFOUTPUT QUERY = "get_Appraisal_info">              <TR>                   <TD><B>#Targets#</B></TD>                   <TD>#SelfRating#</TD>                   <TD><INPUT TYPE="Text" NAME="#TargetID#" Value =                   "#ReviewerRating#" SIZE="20"></TD>              </TR>          </CFOUTPUT>          </TABLE>          <P><B>Close the Appraisal Form and Evaluate the Quarterly Score:</B>          <INPUT TYPE="Checkbox" Name= "CloseAppraisal" Value="Yes"></P>           <P><INPUT TYPE="submit" NAME="RateAppraisal" VALUE="Save Ratings for           Targets"></P>           </FORM>         </DIV> <CFELSE>     <P >No Open Appraisal Record Found for Current Appraisal     Period. </P> </CFIF> <a href="ReviewerMain.CFM">Back to Reviewer Main Page</a> </BODY> </HTML> 

The appraisal record for the current appraisal period is taken from tblQtrlyAppraisals. If the record doesn't exist, a message stating so is displayed. This can happen for one of two reasons: The employee wasn't assigned tasks, or the reviewer has already provided the ratings and the appraisal is closed.

If an open appraisal record is found, it's displayed and rated by the reviewer. Then the reviewer has the option of closing the appraisal process and evaluating the quarterly score by checking the check box at the bottom of the appraisal form. When the reviewer clicks Save Ratings for Targets, RateTargets.cfm is loaded. The code in this file updates tblQtrlyAppraisalDetails with the rating in the ReviewerRating field. If the check box for closing the appraisal process and evaluating the quarterly score is checked, the total score is calculated and updated in tblQtrlyAppraisals. The Status field in tblQtrlyAppraisals is set to Closed. This is a code snippet from RateTargets.cfm:

 <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>     SELECT * FROM tblQtrlyAppraisalDetails     WHERE AppraisalID = #SESSION.CurrentAppID#     ORDER BY TargetID </CFQUERY> <CFIF IsDefined('Form.CloseAppraisal')>     <CFSET varTotal = 0>     <CFSET varCount = 0> </CFIF> <cfoutput query="get_Appraisal_info">     <cfset varRating = Evaluate("Form.#TargetID#")>     <CFIF NOT varRating GT 0>         <cfset varRating =0>     </CFIF>     <CFQUERY NAME="Update_Appraisal_info" DATASOURCE=#SESSION.DSN#>         UPDATE tblQtrlyAppraisalDetails         SET ReviewerRating = #varRating#         WHERE AppraisalID = #SESSION.CurrentAppID#         AND TargetID = #TargetID#     </CFQUERY>     <CFIF IsDefined('Form.CloseAppraisal')>         <CFSET varTotal = varTotal + varRating>         <CFSET varCount = varCount + 1> </CFIF>     </cfoutput> <CFIF IsDefined('Form.CloseAppraisal')>     <CFSET varScore = varTotal / varCount>     <CFQUERY NAME="Update_Appraisal_Header" DATASOURCE=#SESSION.DSN#>              UPDATE tblQtrlyAppraisals              SET Score = #varScore#, Status = 'Closed'              WHERE AppraisalID = #SESSION.CurrentAppID#     </CFQUERY> </CFIF> 

View Performance and Recommendations

The workings of this feature are similar to those in the "View Your Own Performance and Recommendations" section. The difference lies in how the PerformanceInfoProvider component is used. Here, this feature is implemented by using the component as a Web service. When the reviewer selects the employee and the duration parameters on the Reviewer Main page and clicks Show Annual Performance or Show Quarterly Performance, ProcessReviewerMain.cfm is loaded. The code in ProcessReviewerMain.cfm checks for the button clicked, as shown in this code snippet:

 <CFIF Trim(Form.btnActivity) EQ "Show Annual Performance">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <cfset SESSION.SELAppPeriod = #Form.AppPeriod#>     <cfset SESSION.SELAppYear = #Form.AppYear#>     <cfset SESSION.SELBUTTON = "Show Annual Performance">     <CFLOCATION URL="ViewPerformanceReviewer.cfm" ADDTOKEN="no"> </CFIF> <CFIF Trim(Form.btnActivity) EQ "Show Quarterly Performance">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <cfset SESSION.SELAppPeriod = #Form.AppPeriod#>     <cfset SESSION.SELAppYear = #Form.AppYear#>     <cfset SESSION.SELBUTTON = "Show Quarterly Performance">     <CFLOCATION URL="ViewPerformanceReviewer.cfm" ADDTOKEN="no"> </CFIF> 

This code snippet sets value in the SESSION variables and redirects the reviewer to ViewPerformanceReviewer.cfm. It uses the <cfinvoke> tag to call the PerformanceInfoProvider component as a Web service, as shown in this code:

 <CFIF Trim(SESSION.SELBUTTON) EQ "Show Annual Performance"> <cfinvoke     webservice = http://localhost/ProjectFour/PerformanceInfoProvider.cfc?wsdl     method="getAnnualInfo" returnVariable="ResultAnnualInfo"     strEmpCode=#SESSION.SELEMP#     strAppYear=#SESSION.SELAppYear*     strEmpDataSource=#SESSION.DSN#> <CFELSEIF Trim(SESSION.SELBUTTON) EQ "Show Quarterly Performance"> <cfinvoke     webservice ="http://localhost/ProjectFour/PerformanceInfoProvider.cfc?wsdl"     method="getQuarterlyInfoHeader"     returnVariable="ResultQtrlyHeaderInfo"     strEmpCode=#SESSION.SELEMP#     strAppPeriod=#SESSION.SELAppPeriod#     strAppYear=#SESSION.SELAppYear#     strEmpDataSource=#SESSION.DSN#> </CFIF> 

The webservice attribute of the <cfinvoke> tag mentions the path of the Web description file for the PerformanceInfoProvider component. It then proceeds as described in the "View Your Own Performance and Recommendations" section.

Evaluate Annual Performance

At the end of a year, an employee's performance scores of all four quarters should be available. The reviewer can select an employee and evaluate the annual score for the year. Based on this score, the salary hike and recommendations are obtained from tblPolicies. These recommendations and salary hike information are stored in tblAnnualAppraisalResults. When the reviewer selects an employee and clicks Evaluate Annual Performance on the Reviewer Main page, ProcessReviewerMain.cfm is loaded and this code is executed:

 <CFIF Trim(Form.btnActivity) EQ "Evaluate Annual Performance">     <CFIF IsDefined('Form.AppYear')>         <CFQUERY NAME="GetAnnualAppraisalCount" DATASOURCE=#SESSION.DSN#>             SELECT Count(*) AS AnnualCount FROM tblAnnualAppraisalResults             WHERE EmpCode = '#Form.Selected_Employee#'             AND AppraisalYear = '#Form.AppYear#'         </CFQUERY>         <CFOUTPUT QUERY = "GetAnnualAppraisalCount">             <CFSET varAnnualCount = AnnualCount>         </CFOUTPUT>         <CFIF varAnnualCount EQ 0>                  <CFQUERY NAME="GetQtrlyAppraisalCount" DATASOURCE=#SESSION.DSN#>                      SELECT Count(*) AS QtrlyCount,SUM(Score) AS TotalScore                      FROM tblQtrlyAppraisals                      WHERE EmpCode = '#Form.Selected_Employee#'                      AND AppraisalYear = '#Form.AppYear#'                      AND Status = 'Closed'                  </CFQUERY>                  <CFOUTPUT QUERY ="GetQtrlyAppraisalCount">                      <CFSET varQtrlyCount = QtrlyCount>                      <CFSET varTotalScore = TotalScore>                  </CFOUTPUT>                    <CFIF varQtrlyCount EQ 4>                          <CFSET varAnnualScore = varTotalScore / 4>                          <CFQUERY NAME="GetAnnualRecommendations"                            DATASOURCE=#SESSION.DSN#>                              SELECT SalaryIncrement,Recommendations                              FROM tblPolicies                              WHERE Country = '#SESSION.Country#'                              AND StartRange < #varAnnualScore#                              AND EndRange >= #varAnnualScore#                          </CFQUERY>                          <CFIF GetAnnualRecommendations.RECORDCOUNT GT 0>                              <CFOUTPUT QUERY = "GetAnnualRecommendations">                               <CFSET varRecommendations = "The Salary                               Increment Should Be " & #SalaryIncrement# & ".                               The Recommendation As Per the Policy Is: " &                               #Recommendations#>                               <CFQUERY NAME="AddAnnualScore"                                 DATASOURCE=#SESSION.DSN#>                                INSERT INTO                                tblAnnualAppraisalResults(EmpCode,                                AppraisalYear, FinalScore, Recommendations)                                VALUES                                ('#Form.Selected_Employee#','#Form.AppYear#'                                 ,#varAnnualScore#,'#varRecommendations#')                               </CFQUERY>                           </CFOUTPUT>                           <P >Annual Performance and                           Recommendation Record Is Created.<BR>                           Click on the Show Annual Performance to See the                           Record.</P>                       <CFELSE>                           <P >Policy Recommendations Are NOT                            Specified.</P>                       </CFIF>                   <CFELSE>                       <P >The Appraisals Are Not Complete and                       Closed for All the Quarters. The Annual Evaluation                       Cannot Be Completed As of Now.</P>                   </CFIF>          <CFELSE>              <P >The Annual Performance for This Appraisal               Year Is Already Defined.</P>          </CFIF> <CFELSE>     <P >The Appraisal Year Is Not Defined.</P> </CFIF> 

This code checks whether the appraisal year has been entered in the text box. If not, a message is given to the reviewer. If the year has been provided, the code checks tblAnnualAppraisalResults to confirm whether the annual result for the selected employee has been generated. If so, the reviewer is informed of that. If not, the code fetches the quarterly scores for the selected employee for that year and calculates the annual score.

Based on the annual score, the increment and recommendations are retrieved from tblPolicies. If the policy for that score range isn't defined for the country where the employee is working, the reviewer is given this message. If it is defined, the required information is fetched. After the final score and recommendations have been retrieved, a record is entered in tblAnnualAppraisalResults for the selected employee and the year.

Working with the Create Performance Policy Page

After the employee has been successfully validated as an administrator, the Create Performance Policy page is loaded. In this page, the administrator specifies the salary increment and recommendations based on the final score achieved by the employees. For example, if the start score is 1 and the end score is 2, the salary increment for all employees having a final annual score between 1 and 2 would be 'x' and their recommendations 'y'. To save a policy record, the administrator specifies the start range, end range, country, salary increment, and recommendations.

To save this information, the administrator clicks Create Policy. This loads createpolicy.cfm. Here, the score and the country are matched with the data in tblPolicies. If a matching record is found, a message is displayed saying that the policy already exists for this score range and country. Otherwise, a policy is created. Then the administrator can navigate to the Create Policy page by clicking on Back to Create Policy Page. This is the code for createPolicy.cfm:

 CFQUERY NAME="get_Policy_info" DATASOURCE=#SESSION.DSN#>     SELECT PolicyID FROM tblPolicies     WHERE Country = '#Form.Country#'     AND StartRange = #Form.StartRange#     AND EndRange = #Form.EndRange# </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application: Admin Policy Page</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >    Online Appraisal Application: Create Performance Policy Page </DIV> <CFIF get_Policy_info.RECORDCOUNT GT 0>     <P >The Policy Record for This Score Range and Country     Already Exists.</P>     <CFABORT> <CFELSE>     <CFQUERY NAME="Insert_Policy_Info" DATASOURCE=#SESSION.DSN#>              INSERT INTO tblPolicies (Country, StartRange, EndRange,              SalaryIncrement, Recommendations)              VALUES ('#Form.Country#',#Form.StartRange#,#Form.EndRange#,              #Form.Salary#,'#Form.Recommendation#')     </CFQUERY>     <P >Policy Record Successfully Created.</P> </CFIF> <a href="AdminPolicyPage.CFM">Back to Create Policy Page</a> </BODY> </HTML> 

Next are code listings for all Web pages discussed in this chapter.

Listing 19.1 provides the complete code for Start.cfm.

Listing 19.1: Start.cfm

start example
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">    <HTML>    <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >Welcome to Electric Components, Inc.<BR> Online Appraisal Application: Employee Validation Form </DIV> <DIV ALIGN="center">  <cfform ACTION="CallValidate.cfm" METHOD="POST" name="EmpValidate"   >    <TABLE>      <TR>        <TD><B>Enter Your Employee Code:</B></TD>        <TD>          <cfINPUT TYPE="Text" NAME="empcode" SIZE="20" REQUIRED="yes"          MESSAGE="Please Enter Your Employee Code for Validation.">        </TD>      </TR>      <TR>        <TD><B>Your Password:</B></TD>        <TD>          <cfINPUT TYPE="password" NAME="password" SIZE="20" REQUIRED="yes"          MESSAGE="Please Enter Your Password for Validation.">        </TD>      </TR>      <TR>        <TD><B>You Are from:</B></TD>        <TD>          <SELECT Name="country" Size="1">            <OPTION>Austria</OPTION>            <OPTION>Brazil</OPTION>            <OPTION>USA</OPTION>          </SELECT>        </TD>      </TR>         <TR>           <TD><B>You Want to Log In As:</B></TD>           <TD>             <SELECT Name="approle" Size="1">               <OPTION>Employee</OPTION>               <OPTION>Reviewer</OPTION>               <OPTION>Admin</OPTION>             </SELECT>           </TD>         </TR>       </TABLE>          <P><INPUT TYPE="submit" NAME="ValidateEmp" VALUE="Validate for Entry">       </P>       </cfform>    </DIV>    </BODY>    </HTML> 
end example

Listing 19.2 provides the complete code for CallValidate.cfm.

Listing 19.2: CallValidate.cfm

start example
 <cfswitch expression="#Form.country#">   <cfdefaultcase>     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "USA">   </cfdefaultcase>   <cfcase value="USA">     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "USA">   </cfcase>   <cfcase value="Austria">     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "Austria">   </cfcase>   <cfcase value="Brazil">     <cfset SESSION.DSN = "ElectricComp">     <cfset SESSION.Country = "Brazil">   </cfcase> </cfswitch> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application: Employee         Appraisal Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >  Online Appraisal Application: Employee Validation  </DIV>  <BR> <cfset timeout = 300> <cflogin idleTimeout="#timeout#">     <cfinvoke component="ValidateEmployee"                method="getRoles"                returnVariable="ResultRoles"                strEmpCode=#Form.empcode#                strEmpPassword=#Form.password#                strEmpDataSource=#SESSION.DSN#>     <CFIF #ResultRoles# EQ "Invalid">         <cfoutput>             <P >Login Is Invalid</P>             <a href="Start.CFM">Back to Employee Validation Page</a>             </body>             </html>         </cfoutput>         <cfabort>     <CFELSEIF #find(#Form.approle#,#ResultRoles#)# GT 0>         <cfloginuser name="#form.empcode#" password="#trim(form.password)#"                  roles="#Form.approle#">     <CFELSE>           <cfoutput>              <P >You Are NOT Assigned the Role You               Selected for Validation.</P>              <a href="Start.CFM">Back to Employee Validation Page</a>              </body>              </html>           </cfoutput>           <cfabort>     </CFIF> </cflogin> <CFSET SESSION.EmpCode = #Form.empcode#> <cfswitch expression="#Form.approle#">   <cfdefaultcase>     <CFLOCATION URL="AppraisalForm.cfm" ADDTOKEN="no">   </cfdefaultcase>   <cfcase value="Employee">     <CFLOCATION URL="AppraisalForm.cfm" ADDTOKEN="no">   </cfcase>   <cfcase value="Reviewer">     <CFLOCATION URL="ReviewerMain.cfm" ADDTOKEN="no">   </cfcase>   <cfcase value="Admin">     <CFLOCATION URL="AdminPolicyPage.cfm" ADDTOKEN="no">   </cfcase>   </cfswitch> 
end example

Listing 19.3 provides the complete code for ValidateEmployee.cfm.

Listing 19.3: ValidateEmployee.cfm

start example
  <cfcomponent>     <cffunction name="getRoles" returntype="string">         <cfargument name="strEmpCode" type="string" required="true">         <cfargument name="strEmpPassword" type="string" required="true">         <cfargument name="strEmpDataSource" type="string" required="true">         <cfquery name="InfoLogin" datasource='#arguments.strEmpDataSource#'>                 SELECT Roles                 FROM tblLogins             WHERE EmpCode = '#arguments.strEmpCode#'             AND Password = '#arguments.strEmpPassword#'          </cfquery>         <CFIF InfoLogin.RECORDCOUNT IS 0>              <cfset myResult="Invalid">         <CFELSE>              <cfoutput query="InfoLogin">                 <cfset myResult=#Roles#>              </cfoutput>         </CFIF>         <cfreturn myResult>     </cffunction>  </cfcomponent> 
end example

Listing 19.4 provides the complete code for AppraisalForm.cfm.

Listing 19.4: AppraisalForm.cfm

start example
 <CFQUERY NAME="get_Appraisal_ID" DATASOURCE=#SESSION.DSN#>     SELECT AppraisalID AS AppID,AppraisalPeriod,AppraisalYear,ReviewerCode     FROM tblQtrlyAppraisals     WHERE EmpCode = '#SESSION.EmpCode#'     AND Status='Open' </CFQUERY> <HTML>    <HEAD>    <TITLE>Electric Components' Online Appraisal Application: Employee            Appraisal Form</TITLE>    <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css">    </HEAD>    <BODY>    <DIV align="center" >    Online Appraisal Application: Fill Employee Appraisal Form    </DIV> <CFIF get_Appraisal_ID.RECORDCOUNT GT 0>     <CFOUTPUT QUERY = "get_Appraisal_ID">         <CFSET varAppID = #AppID#>         <CFSET SESSION.CurrentAppID = #AppID#>         <CFSET varAppraisalPeriod = #AppraisalPeriod#>         <CFSET varAppraisalYear = #AppraisalYear#>         <CFSET varReviewerCode = #ReviewerCode#>     </CFOUTPUT>     <cfinvoke component="ConvertQuarterToText" method="TextQtr"     returnVariable="QtrInText" QtrNumber=#varAppraisalPeriod#>     <CFQUERY NAME="get_Employee_Name" DATASOURCE=#SESSION.DSN#>         SELECT EmployeeName FROM tblEmployees         WHERE EmpCode = '#varReviewerCode#'     </CFQUERY>     <CFOUTPUT QUERY = "get_Employee_Name">         <CFSET varReviewerName = #EmployeeName#>     </CFOUTPUT>     <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>         SELECT * FROM tblQtrlyAppraisalDetails         WHERE AppraisalID = #varAppID#         ORDER BY TargetID     </CFQUERY>    <P  align="Left">     <cfoutput>These Are Your Targets for Appraisal Period:  #QtrInText# for Year     #varAppraisalYear#.     The Reviewer for This Quarter Is: #varReviewerName#     </cfoutput>     </P>     <DIV ALIGN="center">     <FORM ACTION="UpdateAppraisalRatings.cfm" METHOD="POST" name="AppraisalForm"      >     <BR>     <TABLE border = "1" cellpadding="3" cellspacing="3">     <TH>Target Description</TH>     <TH>Self Rating</TH>     <TH>Reviewer's Rating</TH>     <CFOUTPUT QUERY = "get_Appraisal_info">         <TR>              <TD><B>#Targets#</B></TD>              <TD><INPUT TYPE="Text" NAME="#TargetID#" Value = "#SelfRating#"      SIZE="20"></TD>              <TD>#ReviewerRating#</TD>         </TR>     </CFOUTPUT>     </TABLE>          <P><INPUT TYPE="submit" NAME="UpdateAppraisal" VALUE="Update Self       Ratings">       </P>      </FORM>    </DIV> <CFELSE>     <P >No Open Appraisal Record Found for Current Appraisal       Period.</P> </CFIF>   <P >&nbsp;View Performances</P>   <DIV ALIGN="center">        <FORM ACTION="ViewPerformance.cfm" METHOD="POST" name="ViewPerformance"         >     <TABLE cellpadding="3" cellspacing="3">            <TR>              <TD width="90%">View Annual Performance and Recommendations for         Year:</TD>               <TD Colspan = 2><INPUT TYPE="Text" NAME="Year" Value = "2001"         SIZE="10"></TD>               <TD><INPUT TYPE="submit" NAME="btnView" VALUE="Show Annual         Info"></TD>          </TR>          <TR>               <TD width="90%">View Performance Ratings for Selected Appraisal         Period and Year:</TD>               <TD><SELECT Name="AppPeriod" Size="1">               <OPTION Value = "1">Jan-Mar</OPTION>               <OPTION Value = "2">Apr-June</OPTION>               <OPTION Value = "3">July-Sep</OPTION>               <OPTION Value = "4">Oct-Dec</OPTION>               </SELECT></TD>             <TD><INPUT TYPE="Text" NAME="AppYear" Value = "2001" SIZE="10"></TD>             <TD><INPUT TYPE="submit" NAME="btnView" VALUE="Show Quarterly         Info"></TD>         </TR>       </TABLE>     </FORM>     </DIV>    </BODY> </HTML> 
end example

Listing 19.5 provides the complete code for UpdateAppraisalRatings.cfm.

Listing 19.5: UpdateAppraisalRatings.cfm

start example
 <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>        SELECT * FROM tblQtrlyAppraisalDetails        WHERE AppraisalID = #SESSION.CurrentAppID#        ORDER BY TargetID </CFQUERY> <cfoutput query="get_Appraisal_info">        <cfset varRating = Evaluate("Form.#TargetID#")>        <CFIF NOT varRating GT 0>              <cfset varRating =0>        </CFIF>        <CFQUERY NAME="Update_Appraisal_info" DATASOURCE=#SESSION.DSN#>               UPDATE tblQtrlyAppraisalDetails               SET SelfRating = #varRating#               WHERE AppraisalID = #SESSION.CurrentAppID#               AND TargetID = #TargetID#        </CFQUERY> </cfoutput> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application: Employee Appraisal  Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" > Online Appraisal Application: Fill Employee Appraisal Form </DIV> <P  align="Left">Ratings Updated Successfully.</P> <a href="AppraisalForm.CFM">Back to Appraisal Form</a> 
end example

Listing 19.6 provides the complete code for ViewPerformance.cfm.

Listing 19.6: ViewPerformance.cfm

start example
 <CFIF #Form.btnView# EQ "Show Annual Info">     <cfinvoke component="PerformanceInfoProvider" method="getAnnualInfo"     returnVariable="ResultAnnualInfo" strEmpCode=#SESSION.EmpCode#     strAppYear=#Form.Year# strEmpDataSource=#SESSION.DSN#> <CFELSEIF #Form.btnView# EQ "Show Quarterly Info">     <cfinvoke component="PerformanceInfoProvider"     method="getQuarterlyInfoHeader" returnVariable="ResultQtrlyHeaderInfo"     strEmpCode=#SESSION.EmpCode# strAppPeriod=#Form.AppPeriod#     strAppYear=#Form.AppYear# strEmpDataSource=#SESSION.DSN#> </CFIF> <html> <head> <title>Electric Components' Online Appraisal Application: ViewPerformance</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </head> <body> <DIV align="center" >    Online Appraisal Application: View Performance for Selected Criteria  </DIV>  <BR> <CFIF #Form.btnView# EQ "Show Annual Info">     <CFIF ResultAnnualInfo.RECORDCOUNT GT 0>         <P >&nbsp Your Annual Performance and Recommendations         for Year <cfoutput>#Form.Year#</cfoutput> :</P>         <TABLE cellpadding="3" cellspacing="3">         <TH width="40%">Final Score Based on Ratings</TH>         <TH>Recommendation</TH>         <CFOUTPUT QUERY = "ResultAnnualInfo">             <TR>                  <TD align="center"><B>#FinalScore#</B></TD>                  <TD>#Recommendations#</TD>             </TR>         </CFOUTPUT>         </TABLE>     <CFELSE>         <cfoutput>             <P >No Record Found for Annual Performance for the              Given Year.</P>         </cfoutput>     </CFIF> <CFELSEIF #Form.btnView# EQ "Show Quarterly Info">     <CFIF ResultQtrlyHeaderInfo.RECORDCOUNT GT 0>     <cfoutput>     <P >&nbsp Your Quarterly Total Score for Quarter     #Form.AppPeriod#       for Year #Form.Year#:</P></Cfoutput> <TABLE cellpadding="3" cellspacing="3">         <TH>Reviewer Name</TH>         <TH>Score</TH>         <CFOUTPUT QUERY = "ResultQtrlyHeaderInfo">             <TR>                  <TD><B>#EmployeeName#</B></TD>                  <TD>#Score#</TD>             </TR>         </CFOUTPUT>         </TABLE>     <CFELSE>         <cfoutput>             <P >No Record Found for Quarterly Performance for the             Given Quarter and Year.</P>         </cfoutput>     </CFIF> </CFIF> <BR> <a href="AppraisalForm.CFM">Back to Appraisal Form</a> </body> </html> 
end example

Listing 19.7 provides the complete code for ConvertQuartertoText.cfc.

Listing 19.7: ConvertQuartertoText.cfc

start example
 <cfcomponent>        <cffunction name="TextQtr" returntype="string">               <cfargument name="QtrNumber" type="numeric" required="true">               <cfswitch expression=#arguments.QtrNumber#>                        <cfdefaultcase>                            <cfset myResult = "Jan–Mar">                        </cfdefaultcase>                        <cfcase value=1>                            <cfset myResult = "Jan–Mar">                        </cfcase>                        <cfcase value="2">                            <cfset myResult = "Apr–June">                        </cfcase>                        <cfcase value="3">                            <cfset myResult = "July–Sep">                        </cfcase>                        <cfcase value="4">                            <cfset myResult = "Oct–Dec">                        </cfcase>               </cfswitch>               <cfreturn myResult>        </cffunction </cfcomponent> 
end example

Listing 19.8 provides the complete code for PerformanceInfoProvider.cfc.

Listing 19.8: PerformanceInfoProvider.cfc

start example
 <cfcomponent>        <cffunction name="getAnnualInfo" returntype="query" access="remote"         output="false">               <cfargument name="strEmpCode" type="string" required="true">               <cfargument name="strAppYear" type="string" required="true">               <cfargument name="strEmpDataSource" type="string" required="true">               <CFQUERY NAME="get_Annual_info"                DATASOURCE="#arguments.strEmpDataSource#">                      SELECT * FROM tblAnnualAppraisalResults                      WHERE EmpCode = '#arguments.strEmpCode#'                      AND AppraisalYear = '#arguments.strAppYear#'               </CFQUERY>               <cfreturn get_Annual_info>        </cffunction>        <cffunction name="getQuarterlyInfoHeader" returntype="query"         access="remote" output="false">               <cfargument name="strEmpCode" type="string" required="true">               <cfargument name="strAppPeriod" type="numeric" required="true">               <cfargument name="strAppYear" type="string" required="true">               <cfargument name="strEmpDataSource" type="string" required="true">               <CFQUERY NAME="get_Quarterly_info_Header"                DATASOURCE="#arguments.strEmpDataSource#">                      SELECT tblQtrlyAppraisals.*,tblEmployees.EmployeeName FROM                       tblQtrlyAppraisals,tblEmployees                      WHERE tblQtrlyAppraisals.EmpCode = '#arguments.strEmpCode#'                      AND AppraisalPeriod = #arguments.strAppPeriod#                      AND AppraisalYear = '#arguments.strAppYear#'                      AND tblQtrlyAppraisals.ReviewerCode = tblEmployees.EmpCode               </CFQUERY>               <cfreturn get_Quarterly_info_Header>        </cffunction> </cfcomponent> 
end example

Listing 19.9 provides the complete code for ReviewerMain.cfm.

Listing 19.9: ReviewerMain.cfm

start example
 CFQUERY NAME="get_Employees_List" DATASOURCE=#SESSION.DSN#>     SELECT EmpCode, EmployeeName FROM tblEmployees     WHERE ReviewerCode = '#SESSION.EmpCode#' </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee         Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >    Online Appraisal Application: Reviewer Main Page </DIV>     <DIV ALIGN="Left">         <cfform Name= "One" ACTION="ProcessReviewerMain.cfm" METHOD="POST">           <TABLE Border=0 >                 <TH align ="left" width="25%">Select an Employee</TH>                 <TH align ="left" width="30%">Select Appraisal Quarter</TH>                 <TH align ="left">Select Appraisal Year</TH>                 <TR>                     <TD valign="top"><CFSELECT Name = "Selected_Employee"                      Size = "4" QUERY="get_Employees_List" Value="EmpCode"                      DISPLAY="EmployeeName" REQUIRED="YES" MESSAGE="Select an                      Employee Before Clicking the Action Buttons."></CFSELECT></TD>                     <TD valign="top"><SELECT Name="AppPeriod" Size="1">                         <OPTION></OPTION>                         <OPTION Value = "1">Jan-Mar</OPTION>                         <OPTION Value = "2">Apr-June</OPTION>                         <OPTION Value = "3">July-Sep</OPTION>                         <OPTION Value = "4">Oct-Dec</OPTION>                         </SELECT>                     </TD>                     <TD valign="top"><INPUT TYPE="Text" NAME="AppYear"                     SIZE="20"></TD> <TD><input type="submit" name="btnActivity" value="      Rate Current Targets       ">     <INPUT TYPE="submit" NAME="btnActivity" VALUE="  Show Annual   Performance   ">     <INPUT TYPE="submit" NAME="btnActivity" VALUE=" Show Quarterly      Performance ">     <INPUT TYPE="submit" NAME="btnActivity" VALUE="Evaluate      Annual Performance "></TD>         </TR> </TABLE> <BR><HR> </DIV> <DIV align="left"> <TABLE Align="left">       <TH align="left">Target Descriptions for the Selected        Employee</TH>     <TR>         <TD>1.<INPUT TYPE="Text" NAME="1" SIZE="60"></TD>     </TR>     <TR>         <TD>2.<INPUT TYPE="Text" NAME="2" SIZE="60"></TD>     </TR>     <TR>         <TD>3.<INPUT TYPE="Text" NAME="3" SIZE="60"></TD>     </TR>     <TR>         <TD>4.<INPUT TYPE="Text" NAME="4" SIZE="60"></TD>     </TR>     <TR>         <TD>5.<INPUT TYPE="Text" NAME="5" SIZE="60"></TD>     </TR>     <TR>         <TD>6.<INPUT TYPE="Text" NAME="6" SIZE="60"></TD>     </TR>     <TR>         <TD><INPUT TYPE="submit" NAME="btnActivity" VALUE="Save          Targets"></TD>     </TR>                </TABLE>       </cfform>     </DIV>     </BODY>     </HTML> 
end example

Listing 19.10 provides the complete code for ProcessReviewerMain.cfm.

Listing 19.10: ProcessReviewerMain.cfm

start example
 <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee         Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >    Online Appraisal Application: Working with Reviewer Main Page Options </DIV> <CFIF #Form.btnActivity# EQ "Save Targets">     <CFQUERY NAME="FindAppraisal" DATASOURCE=#SESSION.DSN#>         SELECT AppraisalID FROM tblQtrlyAppraisals         WHERE EmpCode = '#Form.Selected_Employee#'         AND AppraisalPeriod = #Form.AppPeriod#         AND AppraisalYear = '#Form.AppYear#'     </CFQUERY>     <CFIF FindAppraisal.RECORDCOUNT EQ 0>         <cfset varHeaderFlag = "Yes">         <cfset varTargetCount = 1>         <CFLOOP INDEX = "element" FROM = "1" TO="6">             <cfset varTarget = Evaluate("Form.#element#")>             <CFIF varTarget GT "">                 <CFIF varHeaderFlag EQ "Yes">                     <CFQUERY NAME="AddAppraisalHeader" DATASOURCE=#SESSION.DSN#>                         INSERT INTO                         TblQtrlyAppraisals(EmpCode,ReviewerCode,AppraisalPeriod,                         AppraisalYear,Score,Status)                         VALUES                         ('#Form.Selected_Employee#','#SESSION.EmpCode#',                         #Form.AppPeriod#,'#Form.AppYear#',0,'Open')                     </CFQUERY>                     <CFQUERY NAME="GetAppraisalID" DATASOURCE=#SESSION.DSN#>                         SELECT AppraisalID FROM tblQtrlyAppraisals                         WHERE EmpCode = '#Form.Selected_Employee#'                         AND AppraisalPeriod = #Form.AppPeriod#                         AND AppraisalYear = '#Form.AppYear#'                     </CFQUERY>                     <cfoutput query="GetAppraisalID">                         <cfset varAppID = #AppraisalID#>                     </cfoutput>                     <cfset varHeaderFlag = "No">                 </CFIF>                 <CFQUERY NAME="AddTargets" DATASOURCE=#SESSION.DSN#>                    INSERT INTO                    tblQtrlyAppraisalDetails(AppraisalID,TargetID,Targets)                    VALUES (#varAppID#,#varTargetCount#,'#varTarget#')                 </CFQUERY>                    <cfset varTargetCount = varTargetCount + 1>            </CFIF>         </CFLOOP>         <P >The Targets for This Employee Have Been Successfully         Defined.<BR>         Click on the Rate Current Targets Button to View and Rate the Targets.          </P>    <CFELSE>    <cfoutput><P >The Targets for This Employee Have Already Been    Defined.<BR>    Click on the Rate Current Targets Button to View and Rate the Targets.     </P>     </cfoutput>     <cfabort>    </CFIF> </CFIF> <CFIF trim(#Form.btnActivity#) EQ "Rate Current Targets">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <CFLOCATION URL="AppraisalReviewerForm.cfm" ADDTOKEN="no"> </CFIF> <CFIF Trim(Form.btnActivity) EQ "Show Annual Performance">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <cfset SESSION.SELAppPeriod = #Form.AppPeriod#>     <cfset SESSION.SELAppYear = #Form.AppYear#>     <cfset SESSION.SELBUTTON = "Show Annual Performance">     <CFLOCATION URL="ViewPerformanceReviewer.cfm" ADDTOKEN="no"> </CFIF> <CFIF Trim(Form.btnActivity) EQ "Show Quarterly Performance">     <cfset SESSION.SELEMP = #Form.Selected_Employee#>     <cfset SESSION.SELAppPeriod = #Form.AppPeriod#>     <cfset SESSION.SELAppYear = #Form.AppYear#>     <cfset SESSION.SELBUTTON = "Show Quarterly Performance">     <CFLOCATION URL="ViewPerformanceReviewer.cfm" ADDTOKEN="no"> </CFIF> <CFIF Trim(Form.btnActivity) EQ "Evaluate Annual Performance">     <CFIF IsDefined('Form.AppYear')>         <CFQUERY NAME="GetAnnualAppraisalCount" DATASOURCE=#SESSION.DSN#>             SELECT Count(*) AS AnnualCount FROM tblAnnualAppraisalResults             WHERE EmpCode = '#Form.Selected_Employee#'             AND AppraisalYear = '#Form.AppYear#'         </CFQUERY>         <CFOUTPUT QUERY = "GetAnnualAppraisalCount">             <CFSET varAnnualCount = AnnualCount>         </CFOUTPUT>         <CFIF varAnnualCount EQ 0>                  <CFQUERY NAME="GetQtrlyAppraisalCount" DATASOURCE=#SESSION.DSN#>                      SELECT Count(*) AS QtrlyCount,SUM(Score) AS TotalScore FROM                      tblQtrlyAppraisals                      WHERE EmpCode = '#Form.Selected_Employee#'                      AND AppraisalYear = '#Form.AppYear#'                      AND Status = 'Closed'                  </CFQUERY>                  <CFOUTPUT QUERY ="GetQtrlyAppraisalCount">                      <CFSET varQtrlyCount = QtrlyCount>                      <CFSET varTotalScore = TotalScore>                  </CFOUTPUT>                      <CFIF varQtrlyCount EQ 4>                          <CFSET varAnnualScore = varTotalScore / 4>                          <CFQUERY NAME="GetAnnualRecommendations" DATASOURCE=                          #SESSION.DSN#>                              SELECT SalaryIncrement,Recommendations                              FROM tblPolicies                              WHERE Country = '#SESSION.Country#'                              AND StartRange < #varAnnualScore#                              AND EndRange >= #varAnnualScore#                          </CFQUERY>                          <CFIF GetAnnualRecommendations.RECORDCOUNT GT 0>                              <CFOUTPUT QUERY = "GetAnnualRecommendations">                               <CFSET varRecommendations = "The Salary                                Increment Should Be " & #SalaryIncrement# & ".                                The Recommendation as Per the Policy Is: " &                                #Recommendations#>                               <CFQUERY NAME="AddAnnualScore"                               DATASOURCE=#SESSION.DSN#>                                            INSERT INTO                               tblAnnualAppraisalResults(EmpCode,                               AppraisalYear, FinalScore, Recommendations)                                            VALUES                               ('#Form.Selected_Employee#','#Form.AppYear#',                                #varAnnualScore#,'#varRecommendations#')                              </CFQUERY>                         </CFOUTPUT>                         <P >Annual Performance and                         Recommendation Record Is Created.<BR>                         Click on Show Annual Performance to See the                         Record.</P>                     <CFELSE>                         <P >Policy Recommendations Are NOT                         Specified.</P>                     </CFIF>                 <CFELSE>                     <P >The Appraisals Are Not Complete and                           Closed for All the Quarters. The Annual Evaluation                           Cannot Be Completed as of Now.</P>                     </CFIF>             <CFELSE>                  <P >The Annual Performance for This Appraisal                   Year Is Already Defined.</P>             </CFIF>     <CFELSE>         <P >The Appraisal Year Is Not Defined.</P>     </CFIF> </CFIF> <BR> <a href="ReviewerMain.CFM">Back to Reviewer Main Page</a> </BODY> </HTML> 
end example

Listing 19.11 provides the complete code for RateTarget.cfm.

Listing 19.11: RateTarget.cfm

start example
 <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee          Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" >    Online Appraisal Application: Appraisal Reviewer Page </DIV> <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>     SELECT * FROM tblQtrlyAppraisalDetails     WHERE AppraisalID = #SESSION.CurrentAppID#     ORDER BY TargetID </CFQUERY> <CFIF IsDefined('Form.CloseAppraisal')>     <CFSET varTotal = 0>     <CFSET varCount = 0> </CFIF> <cfoutput query="get_Appraisal_info">     <cfset varRating = Evaluate("Form.#TargetID#")>     <CFIF NOT varRating GT 0>          <cfset varRating =0>     </CFIF>     <CFQUERY NAME="Update_Appraisal_info" DATASOURCE=#SESSION.DSN#>         UPDATE tblQtrlyAppraisalDetails         SET ReviewerRating = #varRating#         WHERE AppraisalID = #SESSION.CurrentAppID#         AND TargetID = #TargetID#     </CFQUERY>     <CFIF IsDefined('Form.CloseAppraisal')>         <CFSET varTotal = varTotal + varRating>         <CFSET varCount = varCount + 1>     </CFIF> </cfoutput> <CFIF IsDefined('Form.CloseAppraisal')>     <CFSET varScore = varTotal / varCount>     <CFQUERY NAME="Update_Appraisal_Header" DATASOURCE=#SESSION.DSN#>              UPDATE tblQtrlyAppraisals              SET Score = #varScore#, Status = 'Closed'              WHERE AppraisalID = #SESSION.CurrentAppID#     </CFQUERY> </CFIF> <P >Ratings Updated Successfully.</P> <a href="ReviewerMain.CFM">Back to Reviewer Main Page</a> 
end example

Listing 19.12 provides the complete code for ViewPerformanceReviewer.cfm.

Listing 19.12: ViewPerformanceReviewer.cfm

start example
 LisCFIF Trim(SESSION.SELBUTTON) EQ "Show Annual Performance">     <cfinvoke     webservice ="http://localhost/ProjectFour/PerformanceInfoProvider.cfc?wsdl"     method="getAnnualInfo" returnVariable="ResultAnnualInfo"     strEmpCode=#SESSION.SELEMP# strAppYear=#SESSION.SELAppYear#     strEmpDataSource=#SESSION.DSN#> <CFELSEIF Trim(SESSION.SELBUTTON) EQ "Show Quarterly Performance">     <cfinvoke     webservice = "http://localhost/ProjectFour/PerformanceInfoProvider.cfc?wsdl"     method="getQuarterlyInfoHeader" returnVariable="ResultQtrlyHeaderInfo"     strEmpCode=#SESSION.SELEMP# strAppPeriod=#SESSION.SELAppPeriod#     strAppYear=#SESSION.SELAppYear# strEmpDataSource=#SESSION.DSN#> </CFIF> <html> <head> <title>Electric Components' Online Appraisal Application: View   Performance</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </head> <body> <DIV align="center" >    Online Appraisal Application: View Performance for Selected Criteria  </DIV>  <BR> <CFIF Trim(SESSION.SELBUTTON) EQ "Show Annual Performance">     <CFIF ResultAnnualInfo.RECORDCOUNT GT 0>         <P >&nbsp Your Annual Performance and Recommendations         for Year <cfoutput>#SESSION.SELAppYear#</cfoutput> :</P>         <TABLE cellpadding="3" cellspacing="3">         <TH>Final Score</TH>         <TH>Recommendation</TH>         <CFOUTPUT QUERY = "ResultAnnualInfo">             <TR>                  <TD><B>#FinalScore#</B></TD>                  <TD>#Recommendations#</TD>             </TR>         </CFOUTPUT>         </TABLE>     <CFELSE>         <cfoutput>             <P >No Record Found for Annual Performance for the             Given Year.</P>         </cfoutput>         <cfabort>     </CFIF> <CFELSEIF Trim(SESSION.SELBUTTON) EQ "Show Quarterly Performance">     <CFIF ResultQtrlyHeaderInfo.RECORDCOUNT GT 0>     <cfoutput>     <P >&nbsp Your Quarterly Total Score for Quarter     #SESSION.SELAppPeriod#       for Year #SESSION.SELAppYear#:</P></Cfoutput>         <TABLE cellpadding="3" cellspacing="3">         <TH>Reviewer Name</TH>         <TH>Score</TH>         <CFOUTPUT QUERY = "ResultQtrlyHeaderInfo">             <TR>                  <TD><B>#EmployeeName#</B></TD>                  <TD>#Score#</TD>             </TR>         </CFOUTPUT>         </TABLE>     <CFELSE>         <cfoutput>             <P >No Record Found for Quarterly Performance for the             Given Quarter and Year.</P>         </cfoutput>         <cfabort>     </CFIF> </CFIF> <a href="ReviewerMain.CFM">Back to Reviewer Main Page</a> </body> </html> 
end example

Listing 19.13 provides the complete code for AppraisalReviewer.cfm.

Listing 19.13: AppraisalReviewer.cfm

start example
 <CFQUERY NAME="get_Appraisal_ID" DATASOURCE=#SESSION.DSN#>     SELECT AppraisalID AS AppID,AppraisalPeriod,AppraisalYear     FROM tblQtrlyAppraisals     WHERE EmpCode = '#SESSION.SELEMP#'     AND Status='Open' </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application Employee         Validation Form</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <DIV align="center" > Online Appraisal Application: Appraisal Reviewer Page </DIV> <CFIF get_Appraisal_ID.RECORDCOUNT GT 0>     <CFOUTPUT QUERY = "get_Appraisal_ID">         <CFSET varAppID = #AppID#>         <CFSET SESSION.CurrentAppID = #AppID#>         <CFSET varAppraisalPeriod = #AppraisalPeriod#>         <CFSET varAppraisalYear = #AppraisalYear#>     </CFOUTPUT>     <cfinvoke component="ConvertQuarterToText" method="TextQtr"     returnVariable="QtrInText" QtrNumber=#varAppraisalPeriod#>     <CFQUERY NAME="get_Employee_Name" DATASOURCE=#SESSION.DSN#>         SELECT EmployeeName FROM tblEmployees         WHERE EmpCode = '#SESSION.SELEMP#'     </CFQUERY>     <CFOUTPUT QUERY = "get_Employee_Name">         <CFSET varEmployeeName = #EmployeeName#>     </CFOUTPUT> <CFQUERY NAME="get_Appraisal_info" DATASOURCE=#SESSION.DSN#>     SELECT * FROM tblQtrlyAppraisalDetails     WHERE AppraisalID = #varAppID#          ORDER BY TargetID ASC      </CFQUERY>         <DIV ALIGN="center">          <FORM ACTION="RateTargets.cfm" METHOD="POST" name="AppraisalForm"          >          <cfoutput><P >These Are Targets for Employee:          #varEmployeeName# for Appraisal Period:  #QtrInText# for Year          #varAppraisalYear#. <BR>          </P>          </cfoutput>          <TABLE Border = "1" cellpadding="3" cellspacing="3">            <TH>Target Description</TH>          <TH>Self Rating</TH>          <TH>Reviewer's Rating</TH>          <CFOUTPUT QUERY = "get_Appraisal_info">              <TR>                   <TD><B>#Targets#</B></TD>                   <TD>#SelfRating#</TD>                   <TD><INPUT TYPE="Text" NAME="#TargetID#"                        Value = "#ReviewerRating#" SIZE="20"></TD>               </TR>          </CFOUTPUT>          </TABLE>          <P><B>Close the Appraisal Form and Evaluate the Quarterly Score:</B>     <INPUT TYPE="Checkbox" Name= "CloseAppraisal" Value="Yes"></P>          <P><INPUT TYPE="submit" NAME="RateAppraisal"             VALUE="Save Ratings for Targets"></P>          </FORM>        </DIV> <CFELSE>     <P >No Open Appraisal Record Found for Current Appraisal     Period. </P> </CFIF> <a href="ReviewerMain.CFM">Back to Reviewer Main Page</a> </BODY> </HTML> 
end example

Listing 19.14 provides the complete code for AdmnPolicyPage.cfm.

Listing 19.14: AdmnPolicyPage

start example
 <CFQUERY NAME="get_users" DATASOURCE="knowledgebank"> SELECT DISTINCT UserID FROM Logins </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application:         Admin Policy Page</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <BODY> <DIV align="center" >    Online Appraisal Application: Create Performance Policy Page </DIV> <DIV align="center"> <HR> <P >&nbsp;Provide Details for Policy to Be Created:</P> <cfform ACTION="CreatePolicy.cfm" METHOD="POST"> <TABLE>     <TR>       <TD><B>* Start Score Range:</B></TD>         <TD><cfinput TYPE="Text" NAME="StartRange" SIZE="15"              MAXLENGTH="10" REQUIRED="YES"              validate="integer"              MESSAGE="Start Range Should Be                        Provided and It Should Be an Integer"></TD>     </TR>     <TR>       <TD><B>* End Score Range:</B></TD>         <TD><cfinput TYPE="Text" NAME="EndRange" SIZE="15"             MAXLENGTH="10" REQUIRED="YES" validate="integer"             MESSAGE="End Range Should Be Provided                 and It Should Be an Integer"></TD>     </TR>     <TR>         <TD><B>* Salary Increment:</B></TD>         <TD><cfinput TYPE="Text" NAME="Salary" SIZE="15" MAXLENGTH="10"         REQUIRED="YES" validate="integer"         MESSAGE="Salary Increment Should Be                    Provided and It Should Be an Integer"></TD>     </TR>     <TR>         <TD><B>* Recommendations: </B></TD>         <TD><cfinput TYPE = "TEXT" Name = "Recommendation" Size = "50"         MAXLENGTH="100" REQUIRED="YES"         MESSAGE="Recommendation Should Be Specified"></TD>     </TR>     <TR>         <TD><B>* Country: </B></TD>         <TD><SELECT Name="Country" Size="1">             <OPTION>Austria</OPTION>             <OPTION>Brazil></OPTION>             <OPTION>USA</OPTION>             </SELECT>         </TD>     </TR> </TABLE> <BR> <INPUT TYPE="Submit" NAME="btnSave" VALUE="Create Policy"><BR> </cfform> <HR> </BODY> </HTML> 
end example

Listing 19.15 provides the complete code for CreatePolicycfm.

Listing 19.15: CreatePolicy.cfm

start example
 <CFQUERY NAME="get_Policy_info" DATASOURCE=#SESSION.DSN#>     SELECT PolicyID FROM tblPolicies     WHERE Country = '#Form.Country#'     AND StartRange = #Form.StartRange#     AND EndRange = #Form.EndRange# </CFQUERY> <HTML> <HEAD> <TITLE>Electric Components' Online Appraisal Application: Admin Policy Page</TITLE> <LINK REL = "stylesheet" TYPE ="text/css" HREF ="Project4.css"> </HEAD> <BODY> <BODY> <DIV align="center" >    Online Appraisal Application: Create Performance Policy Page </DIV> <CFIF get_Policy_info.RECORDCOUNT GT 0>     <P >The Policy Record for this Score Range and Country     Already Exists.</P>     <CFABORT> <CFELSE>     <CFQUERY NAME="Insert_Policy_Info" DATASOURCE=#SESSION.DSN#>              INSERT INTO tblPolicies (Country, StartRange, EndRange,              SalaryIncrement, Recommendations)              VALUES ('#Form.Country#',#Form.StartRange#,#Form.EndRange#,              #Form.Salary#,'#Form.Recommendation#')     </CFQUERY>     <P >Policy Record Successfully Created.</P> </CFIF> <a href="AdminPolicyPage.CFM">Back to Create Policy Page</a> </BODY> </HTML> 
end example

Listing 19.16 provides the complete code for Application.cfm.

Listing 19.16: Application.cfm

start example
 <cfapplication       name = "AppraisalApplication"       SESSIONMANAGEMENT="Yes"     setClientCookies = "Yes"     SESSIONTIMEOUT="#CreateTimeSpan(0,0,30,0)#"> 
end example

Listing 19.17 provides the complete code for Project4.css.

Listing 19.17: Project4.css

start example
 body {     background-color: #99CCFF;     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 12px;     line-height: 24px;     color: #99CCFF; } td {     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 11px;     line-height: 24px;     color: #3333CC;     font-weight: bold; } th {     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 11px;     line-height: 24px;     color: #99CCFF;     font-weight: bold;     background-color: #3300CC; } a {     color: #3300CC;     font-weight: bold; } form {     background-color: #3399FF;     font-family: Tahoma, Arial, Helvetica, sans-serif; } div {     background-color: #3300CC; } .title {     font-family: Georgia, "Times New Roman", Times, serif;     font-size: 18px;     line-height: 30px;     background-color: #990000;     color: #99CCFF;     font-weight: bold;     text-decoration: underline; } a:hover {     color: #3300CC;     background-color: #CCFFFF; } .message {     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 12px;     font-weight: bold;     line-height: 30px;     color: #990000;     background-color: #99CCFF; } .summary {     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 10px;     line-height: 30px;     background-color: #CCCC99; } .InfoLabel {     font-family: Tahoma, Arial, Helvetica, sans-serif;     font-size: 11px;     line-height: 30px;     background-color: #9966FF;     color: #000000;     font-weight: bold; } cfform {     background-color: #3399FF;     color: #99CCFF; 
end example




Macromedia ColdFusion MX. Professional Projects
ColdFusion MX Professional Projects
ISBN: 1592000126
EAN: 2147483647
Year: 2002
Pages: 200

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net