ColdFusion Sample Documents




The following is the "INDEX.CFM" file of the diveshop ColdFusion example.

<html>
<head>
<title>Example Cold Fusion Database: SIMS Directory</title>
</head>

<body>
<CENTER>
<font size=+2 face="arial,helvetica">ColdFusion DiveShop Example</font>
<p>
<IMG SRC="LOGO.GIF" >
</CENTER>

<table width=550>
<tr><td>
Welcome to the DiveShop Cold Fusion example database.  
<p>
The goal of this system is to
provide you with some sample Cold Fusion code to serve as a starting point 
for your own web-driven Access databases.  Because cfm files are parsed by 
the Cold Fusion serve prior to being served, you cannot view the source by 
simply selecting "View Source" in your browser.  We have added the raw CFML 
source at the bottom of each page. </a>.

<p>
<hr align=center width=75%>
<p>
<a href="divecust.cfm">Show the Customers</a>
<br>
<a href="diveords.cfm">Show the Customer Orders</a>
<br>
<a href="shipwrecks.cfm">Show the Shipwreck data</a>
<br>
<a href="shipwrecks2.cfm">Show the Shipwreck data (different format)</a>

</td></tr>
</table>
</body>
</html>




The following is the "DIVECUST.CFM" file of the diveshop ColdFusion example.


<cfquery name="cust" datasource="ray" username="ray" password="ray" debug="yes">
SELECT * 
FROM divecust;
</cfquery>

<html>
<head>
<title>Example Cold Fusion Database: DiveShip</title>
</head>

<CENTER>
<font size=+2 face="arial,helvetica">ColdFusion DiveShop Customers</font>
<p>
<IMG SRC="LOGO.GIF" >
</CENTER>
<p>

<table border=0 cellpadding=2 cellspacing=2 width=110%>
<tr>
<td>ID #</td>
<td><b> <font face="arial,helvetica">Name</td>
<td>Street</td>
<td>City</td>
<td>State/Prov</td>
<td>Zip</td>
<td>Country</td>
<td>Phone</td>
<td>First Contact</td>
</tr>
<tr><td colspan=5>
<hr width=100% noshade>
</td></tr>

<cfoutput query="cust">
<tr>
<td>#Customer_No#</td>
<td>#name#</td>
<td>#Street#</td>
<td>#City#</td>
<td>#State#</td>
<td>#Zip#</td>
<td>#Country#</td>
<td>#Phone#</td>
<td>#First_Contact#</td>
</tr>
</cfoutput>
</table>




The following is the "DIVEORDS.CFM" file of the diveshop ColdFusion example.


<cfquery name="orders" datasource="ray" username="ray" password="ray" debug="yes">
SELECT DIVEORDS.Order_No, DIVECUST.Name, DIVEORDS.Sale_Date, DIVEORDS.Destination, DIVEORDS.Depart_Date, DIVEORDS.Return_Date, DIVEITEM.Qty, DIVESTOK.Description, DIVEITEM.Item_No, DIVESTOK.Rental_Price
FROM DIVESTOK INNER JOIN ((DIVECUST INNER JOIN DIVEORDS ON DIVECUST.Customer_No = DIVEORDS.Customer_No) INNER JOIN DIVEITEM ON DIVEORDS.Order_No = DIVEITEM.Order_No) ON DIVESTOK.Item_No = DIVEITEM.Item_No;
</cfquery>

<html>
<head>
<title>Example Cold Fusion Database: DiveShip</title>
</head>

<CENTER>
<font size=+2 face="arial,helvetica">ColdFusion DiveShop Customer Orders</font>
<p>
<IMG SRC="LOGO.GIF" >
</CENTER>
<p>

<table border=1 cellpadding=2 cellspacing=2 width=110%>
<tr>
<td>Order #</td>
<td><b> <font face="arial,helvetica">Name</td>
<td>Sale Date</td>
<td>Destination</td>
<td>Depart_Date</td>
<td>Return_Date</td>
<td>Quantity</td>
<td>Item</td>
<td>Item #</td>
<td>Rental Price</td>
</tr>
<tr><td colspan=5>
<hr width=100% noshade>
</td></tr>

<cfoutput query="orders">
<tr>
<td>#Order_No#</td>
<td>#Name#</td>
<td>#Sale_date#</td>
<td>#Destination#</td>
<td>#depart_date#</td>
<td>#return_date#</td>
<td>#qty#</td>
<td>#description#</td>
<td>#Item_no#</td>
<td>#rental_price#</td>
</tr>
</cfoutput>
</table>




The following is the "SHIPWRECKS.CFM" file of the diveshop ColdFusion example.



<cfquery name="orders" datasource="ray" username="ray" password="ray" debug="yes">
SELECT SHIPWRCK.Ship_Name, SHIPWRCK.Category, SHIPWRCK.Type, SHIPWRCK.Interest, SHIPWRCK.Tonnage, SHIPWRCK.Length_ft, SHIPWRCK.Cause, SHIPWRCK.Date_Sunk, SHIPWRCK.Comments, SHIPWRCK.Passengers_Crew, SHIPWRCK.Survivors, SHIPWRCK.Condition, SHIPWRCK.Graphic
FROM SHIPWRCK;
</cfquery>

<html>
<head>
<title>Example Cold Fusion Database: DiveShop</title>
</head>

<CENTER>
<font size=+2 face="arial,helvetica">ColdFusion DiveShop Shipwrecks</font>
<p>
<IMG SRC="LOGO.GIF" >
</CENTER>
<p>

<table border=1 cellpadding=2 cellspacing=2 width=110%>
<tr>
<td>Name</td>
<td>Category</td>
<td>Type</td>
<td>Interest</td>
<td>Tonnage</td>
<td>Length</td>
<td>Cause</td>
<td>Date Sunk</td>
<td>Comments</td>
<td>Passengers/Crew</td>
<td>Survivors</td>
<td>Condition</td>
<td>Graphic</td>
</tr>
<tr><td colspan=13>
<hr width=100% noshade>
</td></tr>

<cfoutput query="orders">
<tr>
<td>#Ship_Name#</td>
<td>#Category#</td>
<td>#Type#</td>
<td>#Interest#</td>
<td>#Tonnage#</td>
<td>#Length_ft#</td>
<td>#Cause#</td>
<td>#Date_Sunk#</td>
<td>#Comments#</td>
<td>#Passengers_Crew#</td>
<td>#Survivors#</td>
<td>#Condition#</td>
<td>#Graphic#</td>

</tr>
</cfoutput>
</table>




The following is the "SHIPWRECKS2.CFM" file of the diveshop ColdFusion example.



<cfquery name="orders" datasource="ray" username="ray" password="ray" debug="yes">
SELECT SHIPWRCK.Ship_Name, SHIPWRCK.Category, SHIPWRCK.Type, SHIPWRCK.Interest, SHIPWRCK.Tonnage, SHIPWRCK.Length_ft, SHIPWRCK.Cause, SHIPWRCK.Date_Sunk, SHIPWRCK.Comments, SHIPWRCK.Passengers_Crew, SHIPWRCK.Survivors, SHIPWRCK.Condition, SHIPWRCK.filename
FROM SHIPWRCK;
</cfquery>

<html>
<head>
<title>Example Cold Fusion Database: DiveShop</title>
</head>

<CENTER>
<font size=+2 face="arial,helvetica">ColdFusion DiveShop Shipwrecks</font>
<p>
<IMG SRC="LOGO.GIF" >
</CENTER>
<p>

<hr width=100% noshade>

<cfoutput query="orders">
<center><H2>#Ship_Name#</h2>
<p>
<img src="images/#filename#">
</center>
Category: <b>#Category#</b> 
Type: <b>#Type#</b>
Interest: <b>#Interest#</b>
<br>
<center><H3> Ship Characteristics </H3></center>
Tonnage: <b>#Tonnage#</b>
Length: <b>#Length_ft#</b>
Passengers and Crew: <b>#Passengers_Crew#</b>
Survivors: <b>#Survivors#</b>
<br>
Cause of Wreck: <b>#Cause#</b>
Date of Wreck: <b>#Date_Sunk#</b>
Condition: <b>#Condition#</b>
<p>
Comments: <b>#Comments#</b> <p>

<hr width=100% noshade>

</cfoutput>