Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1010

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Part 1: Creating the detail page
This page displays salary information for the department you selected when you click a wedge of the pie chart. The
department name is passed to this page using the
1
Create an application page with the following content:
<cfquery name="GetSalaryDetails" datasource="cfdocexamples">
SELECT Departmt.Dept_Name,
Employee.FirstName,
Employee.LastName,
Employee.StartDate,
Employee.Salary,
Employee.Contract
FROM Departmt, Employee
WHERE Departmt.Dept_Name = '#URL.Item#'
AND Departmt.Dept_ID = Employee.Dept_ID
ORDER BY Employee.LastName, Employee.Firstname
</cfquery>
<html>
<head>
<title>Employee Salary Details</title>
</head>
<body>
<h1><cfoutput>#GetSalaryDetails.Dept_Name[1]# Department
Salary Details</cfoutput></h1>
<table border cellspacing=0 cellpadding=5>
<tr>
<th>Employee Name</th>
<th>StartDate</th>
<th>Salary</th>
<th>Contract?</th>
</tr>
<cfoutput query="GetSalaryDetails">
<tr>
<td>#FirstName# #LastName#</td>
<td>#dateFormat(StartDate, "mm/dd/yyyy")#</td>
<td>#numberFormat(Salary, "$999,999")#</td>
<td>#Contract#</td>
</tr>
</cfoutput>
</table>
</body>
</html>
Save the page as Salary_details.cfm in the myapps directory under the web root directory.
2
Reviewing the code
The following table describes the code and its function:
variable.
$ITEMLABEL$
Last updated 1/20/2012
1005

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents