home *** CD-ROM | disk | FTP | other *** search
- <!--- This template lists the employees, grouped by department, and lets
- the user click on an employee to view details --->
-
- <!--- Get employees (and their departments); and order by
- department because that's what we're going to group by --->
- <CFQUERY DATASOURCE="CFexamples" NAME="GetEmployees">
- SELECT * FROM EmpEmployees, EmpDepartments
- WHERE EmpEmployees.DepartmentID = EmpDepartments.DepartmentID
- ORDER BY DepartmentName, EmpEmployees.DepartmentID, LastName, FirstName
- </CFQUERY>
-
- <!--- These two lines set up the <HEAD></HEAD>, <BODY></BODY>,
- and other page layout attributes that should be consistent though the site --->
- <CFINCLUDE TEMPLATE="_header.cfm">
-
- <TR>
- <TD COLSPAN="3">
-
- <TABLE WIDTH="90%" BORDER="0" CELLSPACING="0" CELLPADDING="5" ALIGN="CENTER">
-
- <!--- Output the query data; the code between this <CFOUTPUT>
- and the next <CFOUTPUT> is only outputted once per
- DepartmentID, since it is grouped by DepartmentID --->
- <CFOUTPUT QUERY="GetEmployees" GROUP="DepartmentID">
- <TR>
- <TD COLSPAN="4" HEIGHT=30 VALIGN="bottom">
- <BR><BR><FONT FACE="Myriad Web, Verdana, Helvetica" SIZE="4"><B>#DepartmentName#</B></FONT>
- </TD>
- </TR>
-
- <!--- Now we start outputting for every record
- (i.e. every employee) --->
- <CFOUTPUT>
- <TR>
- <TD WIDTH=25 NOWRAP> </TD>
- <TD ALIGN="right" VALIGN="top">
- <FONT FACE="Arial, Geneva, Helvetica" SIZE="-1">
- <A HREF="Details.cfm?EmpID=#EmpID#">#LastName#, #FirstName#</A><BR>
- </FONT>
- <FONT FACE="Arial, Geneva, Helvetica" SIZE="-2">
- #Title#<BR>
- </FONT>
- </TD>
- <TD VALIGN="top" ALIGN="right"><FONT FACE="Arial, Geneva, Helvetica" SIZE="-1">#Phone#<BR></FONT></TD>
- <TD VALIGN="top" ALIGN="right"><FONT FACE="Arial, Geneva, Helvetica" SIZE="-1"><A HREF="mailto:#Email#">#Email#</A><BR></FONT></TD>
- </TR>
- </CFOUTPUT>
-
- </CFOUTPUT>
-
- </TABLE>
- </TD>
- </TR>
- <TR>
- <TD HEIGHT="35" COLSPAN="3"> </TD>
- </TR>
- </TABLE>
-
- <!--- Close the document --->
- <CFINCLUDE TEMPLATE="_footer.cfm">