home *** CD-ROM | disk | FTP | other *** search
- <!--- This template displays the employees for any given department and lets
- the user click on an employee to view details. --->
-
- <!--- If we weren't given a DepartmentID, this template can't be
- processed; go instead to the employee list --->
- <CFIF NOT IsDefined("URL.DepartmentID")>
- <CFLOCATION URL="index.cfm">
- </CFIF>
-
- <!--- Get department name using department ID (from URL);
- this allows us to display department name in header --->
- <CFQUERY NAME="GetDepartmentName" DATASOURCE="CFExamples">
- SELECT DepartmentName FROM EmpDepartments
- WHERE DepartmentID = #val(URL.DepartmentID)#
- </CFQUERY>
-
- <!--- 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
- WHERE EmpEmployees.DepartmentID = #val(URL.DepartmentID)#
- ORDER BY EmpEmployees.DepartmentID, LastName, FirstName
- </CFQUERY>
-
- <!--- This includes the HTML that goes into the header. --->
- <CFINCLUDE TEMPLATE="_header.cfm">
-
- <CFOUTPUT QUERY="GetEmployees">
-
- <!--- Now we start outputting for every record (i.e. every employee) --->
- <TR>
-
- <TD WIDTH=100 ALIGN="RIGHT" VALIGN="TOP" HEIGHT="150"> </TD>
-
- <TD VALIGN="top">
- <FONT FACE="Myriad Web, Verdana, Helvetica" SIZE="+2">
- <!--- Notice we're passing the EmpID in the URL... --->
- <A HREF="Details.cfm?EmpID=#EmpID#">#FirstName# #LastName#</A><BR>
- </FONT>
-
- <FONT FACE="Helvetica">
- <FONT SIZE="-2">#Title#<BR><BR></FONT>
- <FONT SIZE="-1">
- <CFIF Phone NEQ ""><FONT FACE="WingDings">(</FONT> #Phone#<BR></CFIF>
- <CFIF Email NEQ ""><FONT FACE="WingDings">*</FONT> <A HREF="mailto:#Email#">#Email#</A><BR></CFIF></P>
- </FONT>
- </FONT>
- </TD>
-
- <TD WIDTH="100" NOWRAP> </TD>
-
- </TR>
-
- </CFOUTPUT>
-
- <TR>
- <TD HEIGHT="35" COLSPAN="3"> </TD>
- </TR>
-
- </TABLE>
-
- <CFINCLUDE TEMPLATE="_footer.cfm">
-
- </BODY>
- </HTML>