home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / Coldfusion / coldfusion-60-win-en.exe / main_app_page11.gif < prev    next >
Encoding:
Text File  |  2002-04-08  |  38.7 KB  |  1,074 lines

  1. ml>
  2. <head>
  3. <title>Compass Travel Trip Maintenance</title>
  4. </head>
  5. <body>
  6.     <cfform action="tripeditaction.cfm" method="post">
  7.     <!--- Field: Trip Maintenance Image --->
  8.     <img src="images/tripmaintenance.gif">
  9. <p>
  10.     <table>    
  11.             <!--- Field: tripName --->
  12.         <tr>
  13.             <td valign="top">    Trip Name
  14.             </td>
  15.             <td>
  16.                 <cfinput maxlength="50" size="50" required="Yes" name="tripName" message="Trip name must not be blank.">
  17.             </td>
  18.         </tr>    
  19.             <!--- Field: eventType --->
  20.         <tr>
  21.             <td valign="top">    Type of Event
  22.             </td>
  23.             <td>
  24.                 <cfselect size="1" name="eventType" required="Yes" message="Type of event must be selected.">
  25.                         <option value="1" selected>Surfing</option>
  26.                         <option value="2">Mountain Climbing</option>
  27.                         <option value="3">Mountain Biking</option>
  28.                 </cfselect>
  29.             </td>
  30.         </tr>
  31.             <!--- Field: tripDescription --->
  32.         <tr>
  33.             <td valign="top">    Trip Description
  34.             </td>
  35.             <td>
  36.                 <textarea cols="50" rows="5" name="tripDescription"></textarea>
  37.             </td>
  38.         </tr>
  39.             <!--- Field: tripLocation --->
  40.         <tr>
  41.             <td valign="top">    Trip Location
  42.             </td>
  43.             <td>
  44.                 <cfinput name="tripLocation" required="Yes" message="Trip location must not be blank." size="50">
  45.             </td>
  46.         </tr>
  47.             <!--- Field: departureDate --->
  48.         <tr>
  49.             <td valign="top">    Departure Date
  50.             </td>
  51.             <td>
  52.                 <cfinput name="departureDate" required="Yes" size="10" validate="date" message="Departure date must be a valid date.">
  53.             </td>
  54.         </tr>    <!--- Field: returnDate --->
  55.         <tr>
  56.             <td valign="top">    Return Date
  57.             </td>
  58.             <td>
  59.                 <cfinput size="10" name="returnDate" required="Yes" validate="date" message="Return date must be a valid date.">
  60.             </td>
  61.         </tr>    <!--- Field: numberPeople --->
  62.         <tr>
  63.             <td valign="top">    Number of People
  64.             </td>
  65.             <td>
  66.                 <cfinput size="6" name="numberPeople" required="Yes" validate="integer" message="The number of people field must be a number and cannot be blank.">
  67.             </td>
  68.         </tr>    <!--- Field: Price --->
  69.         <tr>
  70.             <td valign="top">    Price
  71.             </td>
  72.             <td>
  73.                 <cfinput size="10" name="price" required="Yes" validate="integer" message="Price is required and must be numeric.">
  74.             </td>
  75.         </tr>    <!--- Field: baseCost --->
  76.         <tr>
  77.             <td valign="top">    Base Cost
  78.             </td>
  79.             <td>
  80.                 <cfinput size="10" name="baseCost" required="Yes" validate="integer" message="Base cost is required and must be numeric.">
  81.             </td>
  82.         </tr>    <!--- Field: depositRequired --->
  83.         <tr>
  84.             <td valign="top">    Deposit Required
  85.             </td>
  86.             <td>
  87.                 <cfinput type="checkbox" value="Yes" name="depositRequired">
  88.             </td>
  89.         </tr>    <!--- Field: tripLeader --->
  90.         <tr>
  91.             <td valign="top">    Trip Leader
  92.             </td>
  93.             <td>
  94.                 <cfinput maxlength="50" size="50" name="tripLeader" required="Yes" message="A trip leader must be specified.">
  95.             </td>
  96.         </tr>    <!--- Field: photo --->
  97.         <tr>
  98.             <td valign="top">    Photo File Name
  99.             </td>
  100.             <td>
  101.                 <cfinput maxlength="50" size="50" name="photo" required="Yes" message="Valid photo file name must be specified.">
  102.             </td>
  103.         </tr>
  104.     </table>
  105. <p>
  106.     <input type="submit" value="Save">
  107.     <input type="submit" value="Cancel" name="btnCancel">
  108.     </cfform>
  109. </body>
  110. </html>
  111. <!--- Macromedia ColdFusion(r) 6.0 - Getting Started Code Examples --->
  112. <!-- CF Forms Validation -->
  113.  
  114. <script language="JavaScript">
  115. function isitFutureDate(oForm, oTag, dateString) {
  116. /*
  117.    function isitFutureDate 
  118.    parameters: oForm, oTag, dateString 
  119.    returns: boolean
  120.    
  121.    oForm is the CFForm object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  122.    oTag is the CFForm current tag object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  123.    dateString is the value of the current tag object. It should be a date passed as a string in the following
  124.    format: MM/DD/YYYY. This means that months and days require leading zeros!!
  125.  
  126.    Returns true if the date passed is greater than today's date
  127.    Returns false if the date passed is NOT greater than todays
  128.    date.
  129. */
  130.  
  131.    // Check to make sure the date is zero filled with 4 digit year and therefore 10 characters long. 
  132.    if (dateString.length != 10)
  133.            return false;
  134.  
  135.     var now = new Date();
  136.     var today = new Date(now.getYear(),now.getMonth(),now.getDate());
  137.  
  138.  
  139.     var testdate = new Date(dateString.substring(6,10),
  140.                         dateString.substring(0,2)-1,
  141.                         dateString.substring(3,5));
  142.  
  143.     
  144.    if (testdate > now)  
  145.         return true;
  146.     else
  147.         return false;
  148. }
  149. function validateTripDateRange(oForm, oTag, dateString)
  150. {
  151.  /*
  152.    parameters: oForm, oTag, dateString 
  153.    returns: boolean
  154.    
  155.    oForm is the CFForm object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  156.    oTag is the CFForm current tag object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  157.    dateString is the value of the current tag object. It should be a date passed as a string in the following
  158.    format: MM/DD/YYYY. This means that months and days require leading zeros!!
  159.  
  160.    Returns true if the date passed is a future date greater than the departure date
  161.    Returns false if the date passed is NOT a future date greater than departure date.
  162. */
  163.  
  164. //Edit to make sure that Return date is Later than departure date.
  165.    var returnDateString;
  166.    
  167.    //First check to see if the Return Date is a valid future date
  168.    if (isitFutureDate(oForm, oTag, dateString) == false)
  169.       return false;
  170.        
  171.    var departureDate = new Date(dateString.substring(6,10),
  172.                       dateString.substring(0,2)-1,
  173.                       dateString.substring(3,5));
  174.                       
  175.    returnDateString = document.forms(0).item("returnDate").value;
  176.                       
  177.    var returnDate = new Date(returnDateString.substring(6,10),
  178.                       returnDateString.substring(0,2)-1,
  179.                       returnDateString.substring(3,5));
  180.    
  181.    if (departureDate > returnDate)  
  182.         return false;
  183.     else
  184.         return true;
  185. }
  186.  
  187. </SCRIPT>
  188.  
  189. <cfquery name="GetEvents" datasource="CompassTravel">
  190.     SELECT  eventType, eventTypeID 
  191.     FROM eventtypes                
  192. </cfquery>
  193. <html>
  194. <head>
  195. <title>Compass Travel Trip Maintenance</title>
  196. </head>
  197. <body>
  198.     <cfform action="tripeditaction.cfm" method="post">
  199.     <!--- Field: Trip Maintenance Image --->
  200.     <img src="images/tripmaintenance.gif">
  201. <p>
  202.     <table>    
  203.             <!--- Field: tripName --->
  204.         <tr>
  205.             <td valign="top">    Trip Name
  206.             </td>
  207.             <td>
  208.                 <cfinput maxlength="50" size="50" required="Yes" name="tripName" message="Trip name must not be blank.">
  209.             </td>
  210.         </tr>    
  211.             <!--- Field: eventType --->
  212.         <tr>
  213.             <td valign="top">    Type of Event
  214.             </td>
  215.             <td>
  216.                 <cfselect size="1" name="eventType" required="Yes" message="Type of event must be selected.">
  217.                     <cfoutput query="GetEvents">
  218.                         <option value="#GetEvents.eventTypeID#">#GetEvents.eventType#</option>
  219.                     </cfoutput>
  220.                 </cfselect>
  221.             </td>
  222.         </tr>
  223.             <!--- Field: tripDescription --->
  224.         <tr>
  225.             <td valign="top">    Trip Description
  226.             </td>
  227.             <td>
  228.                 <textarea cols="50" rows="5" name="tripDescription"></textarea>
  229.             </td>
  230.         </tr>
  231.             <!--- Field: tripLocation --->
  232.         <tr>
  233.             <td valign="top">    Trip Location
  234.             </td>
  235.             <td>
  236.                 <cfinput name="tripLocation" required="Yes" message="Trip location must not be blank." size="50">
  237.             </td>
  238.         </tr>
  239.             <!--- Field: departureDate --->
  240.         <tr>
  241.             <td valign="top">    Departure Date
  242.             </td>
  243.             <td>
  244.                 <cfinput name="departureDate" size="10" validate="date" onvalidate="isitFutureDate" message="Departure date must be a valid future date (mm/dd/yyyy).">            </td>
  245.         </tr>    <!--- Field: returnDate --->
  246.         <tr>
  247.             <td valign="top">    Return Date
  248.             </td>
  249.             <td>
  250.                 <cfinput size="10" name="returnDate" validate="date" onvalidate="validateTripDateRange" message="Return date must be a valid date greater than departure date (mm/dd/yyyy).">
  251.             </td>
  252.         </tr>    <!--- Field: numberPeople --->
  253.         <tr>
  254.             <td valign="top">    Number of People
  255.             </td>
  256.             <td>
  257.                 <cfinput size="6" name="numberPeople" required="Yes" validate="integer" message="The number of people field must be a number and cannot be blank.">
  258.             </td>
  259.         </tr>    <!--- Field: Price --->
  260.         <tr>
  261.             <td valign="top">    Price
  262.             </td>
  263.             <td>
  264.                 <cfinput size="10" name="price" required="Yes" validate="integer" message="Price is required and must be numeric.">
  265.             </td>
  266.         </tr>    <!--- Field: baseCost --->
  267.         <tr>
  268.             <td valign="top">    Base Cost
  269.             </td>
  270.             <td>
  271.                 <cfinput size="10" name="baseCost" required="Yes" validate="integer" message="Base cost is required and must be numeric.">
  272.             </td>
  273.         </tr>    <!--- Field: depositRequired --->
  274.         <tr>
  275.             <td valign="top">    Deposit Required
  276.             </td>
  277.             <td>
  278.                 <cfinput type="checkbox" value="Yes" name="depositRequired">
  279.             </td>
  280.         </tr>    <!--- Field: tripLeader --->
  281.         <tr>
  282.             <td valign="top">    Trip Leader
  283.             </td>
  284.             <td>
  285.                 <cfinput maxlength="50" size="50" name="tripLeader" required="Yes" message="A trip leader must be specified.">
  286.             </td>
  287.         </tr>    <!--- Field: photo --->
  288.         <tr>
  289.             <td valign="top">    Photo File Name
  290.             </td>
  291.             <td>
  292.                 <cfinput maxlength="50" size="50" name="photo" required="Yes" message="Valid photo file name must be specified.">
  293.             </td>
  294.         </tr>
  295.     </table>
  296. <p>
  297.     <input type="submit" value="Save">
  298.     <input type="submit" value="Cancel" name="btnCancel">
  299.     </cfform>
  300. </body>
  301. </html>
  302. <!--- Macromedia ColdFusion(r) 6.0 - Getting Started Code Examples --->
  303. <!-- CF Forms Validation -->
  304. <script language="JavaScript">
  305. function isitFutureDate(oForm, oTag, dateString) {
  306. /*
  307.    function isitFutureDate 
  308.    parameters: oForm, oTag, dateString 
  309.    returns: boolean
  310.    
  311.    oForm is the CFForm object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  312.    oTag is the CFForm current tag object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  313.    dateString is the value of the current tag object. It should be a date passed as a string in the following
  314.    format: MM/DD/YYYY. This means that months and days require leading zeros!!
  315.  
  316.    Returns true if the date passed is greater than today's date
  317.    Returns false if the date passed is NOT greater than todays
  318.    date.
  319. */
  320.  
  321.    // Check to make sure the date is zero filled with 4 digit year and therefore 10 characters long. 
  322.    if (dateString.length != 10)
  323.            return false;
  324.  
  325.     var now = new Date();
  326.     var today = new Date(now.getYear(),now.getMonth(),now.getDate());
  327.  
  328.  
  329.     var testdate = new Date(dateString.substring(6,10),
  330.                         dateString.substring(0,2)-1,
  331.                         dateString.substring(3,5));
  332.        
  333.    if (testdate > now)  
  334.         return true;
  335.     else
  336.         return false;
  337. }
  338. function validateTripDateRange(oForm, oTag, dateString)
  339. {
  340.  /*
  341.    parameters: oForm, oTag, dateString 
  342.    returns: boolean
  343.    
  344.    oForm is the CFForm object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  345.    oTag is the CFForm current tag object.  All ONVALIDATE calls pass this argument.  This function ignores it.
  346.    dateString is the value of the current tag object. It should be a date passed as a string in the following
  347.    format: MM/DD/YYYY. This means that months and days require leading zeros!!
  348.  
  349.    Returns true if the date passed is a future date greater than the departure date
  350.    Returns false if the date passed is NOT a future date greater than departure date.
  351. */
  352.  
  353. //Edit to make sure that Return date is Later than departure date.
  354.    var returnDateString;
  355.    
  356.    //First check to see if the Return Date is a valid future date
  357.    if (isitFutureDate(oForm, oTag, dateString) == false)
  358.       return false;
  359.        
  360.    var departureDate = new Date(dateString.substring(6,10),
  361.                       dateString.substring(0,2)-1,
  362.                       dateString.substring(3,5));
  363.                       
  364.    returnDateString = document.forms(0).item("returnDate").value;
  365.                       
  366.    var returnDate = new Date(returnDateString.substring(6,10),
  367.                       returnDateString.substring(0,2)-1,
  368.                       returnDateString.substring(3,5));
  369.  
  370.     if (departureDate > returnDate)  
  371.          return false;
  372.     else
  373.          return true;
  374. }
  375.  
  376. </SCRIPT>
  377.  
  378. <cfquery name="GetEvents" datasource="CompassTravel">
  379.     SELECT  eventType, eventTypeID 
  380.     FROM eventtypes                
  381. </cfquery>
  382. <html>
  383. <head>
  384. <title>Compass Travel Trip Maintenance</title>
  385. </head>
  386. <body>
  387.     <cfform action="tripeditaction.cfm" method="post">
  388.     <!--- Field: Trip Maintenance Image --->
  389.     <img src="images/tripmaintenance.gif">
  390. <p>
  391.     <table>    
  392.             <!--- Field: tripName --->
  393.         <tr>
  394.             <td valign="top">    Trip Name
  395.             </td>
  396.             <td>
  397.                 <cfinput maxlength="50" size="50" required="Yes"  value=#tripName# name="tripName" message="Trip name must not be blank.">
  398.             </td>
  399.         </tr>    
  400.             <!--- Field: eventType --->
  401.         <tr>
  402.             <td valign="top">    Type of Event
  403.             </td>
  404.             <td>
  405.                 <cfselect size="1" name="eventType" required="Yes" message="Type of event must be selected.">
  406.                     <cfoutput query="GetEvents">
  407.                         <cfif GetEvents.eventTypeID EQ #eventTypeIdentifier#>
  408.                            <option selected value="#GetEvents.eventTypeID#">
  409.                         <cfelse>
  410.                            <option value="#GetEvents.eventTypeID#">
  411.                         </cfif>   
  412.                            #GetEvents.eventType#</option>
  413.                     </cfoutput>
  414.                 </cfselect>
  415.             </td>
  416.         </tr>
  417.             <!--- Field: tripDescription --->
  418.         <tr>
  419.             <td valign="top">    Trip Description
  420.             </td>
  421.             <td>
  422.                 <cfinput size="50" maxlength=250 required="Yes" name="tripDescription" value=#tripDescription#>
  423.             </td>
  424.         </tr>
  425.             <!--- Field: tripLocation --->
  426.         <tr>
  427.             <td valign="top">    Trip Location
  428.             </td>
  429.             <td>
  430.                 <cfinput name="tripLocation"  value=#tripLocation# required="Yes" message="Trip location must not be blank." size="50">
  431.             </td>
  432.         </tr>
  433.             <!--- Field: departureDate --->
  434.         <tr>
  435.             <td valign="top">    Departure Date
  436.             </td>
  437.             <td>
  438.                 <cfinput name="departureDate" size="10"  value=#departureDate# validate="date" onvalidate="isitFutureDate" message="Departure date must be a valid future date (mm/dd/yyyy).">            </td>
  439.         </tr>    <!--- Field: returnDate --->
  440.         <tr>
  441.             <td valign="top">    Return Date
  442.             </td>
  443.             <td>
  444.                 <cfinput size="10" name="returnDate" value=#returnDate# validate="date" onvalidate="validateTripDateRange" message="Return date must be a valid date greater than departure date (mm/dd/yyyy).">
  445.             </td>
  446.         </tr>    <!--- Field: numberPeople --->
  447.         <tr>
  448.             <td valign="top">    Number of People
  449.             </td>
  450.             <td>
  451.                 <cfinput size="6" name="numberPeople"  value=#numberPeople# required="Yes" validate="integer" message="The number of people field must be a number and cannot be blank.">
  452.             </td>
  453.         </tr>    <!--- Field: Price --->
  454.         <tr>
  455.             <td valign="top">    Price
  456.             </td>
  457.             <td>
  458.                 <cfinput size="10" name="price"  value=#price# required="Yes" validate="integer" message="Price is required and must be numeric.">
  459.             </td>
  460.         </tr>    <!--- Field: baseCost --->
  461.         <tr>
  462.             <td valign="top">    Base Cost
  463.             </td>
  464.             <td>
  465.                 <cfinput size="10" name="baseCost"  value=#baseCost# required="Yes" validate="integer" message="Base cost is required and must be numeric.">
  466.             </td>
  467.         </tr>    <!--- Field: depositRequired --->
  468.         <tr>
  469.             <td valign="top">    Deposit Required
  470.             </td>
  471.             <td>
  472.                 <cfinput type="checkbox" value=#depositRequired# name="depositRequired">
  473.             </td>
  474.         </tr>    <!--- Field: tripLeader --->
  475.         <tr>
  476.             <td valign="top">    Trip Leader
  477.             </td>
  478.             <td>
  479.                 <cfinput maxlength="50" size="50"  value=#tripLeader# name="tripLeader" required="Yes" message="A trip leader must be specified.">
  480.             </td>
  481.         </tr>    <!--- Field: photo --->
  482.         <tr>
  483.             <td valign="top">    Photo File Name
  484.             </td>
  485.             <td>
  486.                 <cfinput maxlength="50" size="50"  value=#photo# name="photo" required="Yes" message="Valid photo file name must be specified.">
  487.             </td>
  488.         </tr>
  489.     </table>
  490. <p>    
  491.     <input type="submit" value="Save">
  492.     <input type="submit" value="Cancel" name="btnCancel"> 
  493.     <cfif #tripIdentifier# NEQ ''>
  494.         <cfinput PASSTHROUGH="ReadOnly"  name="tripID" size = 1 maxLength= 7 value=#TripQuery.tripID#>
  495.     </cfif>
  496.     </cfform>
  497. </body>
  498. </html>
  499. <!--- Macromedia ColdFusion(r) 6.0 - Getting Started Code Examples --->
  500. <!--- Action Page to edit and save Trip information for Compass Travel. --->
  501.  
  502. <!--- Create local variable to hold results of business rules test. --->
  503. <CFSET isOk = "Yes">
  504.  
  505. <!--- Set the depositRequired variable to No if it is not set --->
  506. <cfif not isdefined("Form.depositRequired")>
  507.    <cfset form.depositRequired = "No">
  508. </cfif>
  509.  
  510. <!--- Trip Name is Required --->
  511. <cfif Form.tripName EQ "">
  512.     <CFSET IsOk = "No">
  513.     <cfoutput>Trip name cannot be blank.</cfoutput>
  514. </cfif>
  515.  
  516. <!--- Trip Leader is Required --->
  517. <cfif Form.tripLeader EQ "">
  518.     <CFSET IsOk = "No">
  519.     <cfoutput>A trip leader must be specified.</cfoutput>
  520. </cfif>
  521.  
  522. <!--- Photo file name is Required --->
  523. <cfif Form.photo EQ "">
  524.     <CFSET IsOk = "No">
  525.     <cfoutput>Photo file name must be specified.</cfoutput>
  526. </cfif>
  527.  
  528.  
  529. <!--- Number of people is Required  and must be Numeric --->
  530. <cfif Form.numberPeople EQ "" or IsNumeric(Form.numberPeople) EQ False>
  531.     <CFSET IsOk = "No">
  532.     <cfoutput>The number of people must be a number and cannot be blank.</cfoutput>
  533. </cfif>
  534.  
  535. <!--- Trip location is Required --->
  536. <cfif Form.tripLocation EQ "">
  537.     <CFSET IsOk = "No">
  538.     <cfoutput>Trip location cannot be blank.</cfoutput>
  539. </cfif>
  540.  
  541. <!--- Base Cost is Required and must be Numeric --->
  542. <cfif Form.baseCost EQ "" or IsNumeric(Form.baseCost) EQ False>
  543.     <CFSET IsOk = "No">
  544.     <cfoutput>Base cost must be a number and cannot be blank.</cfoutput>
  545. <cfelse>
  546.     <!--- Price must be 20% greater than Base Cost --->
  547.     <cfif Form.basecost * 1.2 GT  #Form.price#>
  548.         <CFSET IsOk = "No">
  549.         <cfoutput>Price must be marked up at least 20% above cost.</cfoutput>
  550.     </cfif>
  551. </cfif>
  552.  
  553. <!--- Price is Required and must be numeric --->
  554. <cfif Form.price EQ "" or IsNumeric(Form.baseCost) EQ False>
  555.     <CFSET IsOk = "No">
  556.     <cfoutput>Price must be a number and cannot be blank.</cfoutput>
  557. <cfelse>
  558.     <!--- A deposit is required when the price is > $750 --->
  559.     <cfif Form.price GT 750 AND Form.depositRequired EQ "No">
  560.         <CFSET IsOk = "No">
  561.         <cfoutput>Deposit is required for trips priced over $750.</cfoutput>
  562.     </cfif>
  563. </cfif>
  564.  
  565. <html>
  566.     <head>
  567.         <title>Trip Maintenance Confirmation</title>
  568.     </head>
  569.     
  570.     <body>
  571.         <!--- Check if that all business rules edits were passed. --->
  572.         <cfif form.departureDate GT form.returnDate>
  573.             <CFSET isOk = "No">
  574.             <cfoutput>Departure date cannot precede return date. Please re-enter.</cfoutput>
  575.         </cfif>
  576.         
  577.         <!--- Check if that all business rules edits were passed. --->
  578.         <cfif isOk EQ "Yes">
  579.             <h1>Trip Added</h1>
  580.             <!--- Database Insert logic goes here. --->
  581.             <cfoutput>You have added #Form.TripName# to the trips database.
  582.             </cfoutput>
  583.         </cfif>
  584.     </body>
  585. </html>
  586.  <!--- Action Page to edit and save Trip information for Compass Travel. --->
  587. <!--- Single field edits have been removed in favor of client-side edits. --->
  588.  
  589. <!--- Make the passportRequired variable be No if it is not set 
  590.     (check box is empty) --->
  591. <CFSET isOk = "Yes">
  592. <cfif not isdefined("Form.depositRequired")>
  593.    <cfset form.depositRequired = "No">
  594. </cfif>
  595. <cfif Form.price GT 750 AND Form.depositRequired EQ "No">
  596.     <CFSET IsOk = "No">
  597.     <cfoutput>Deposit is required for trips priced over $750.</cfoutput>
  598. </cfif>
  599. <cfif Form.basecost * 1.2 GT  #Form.price#>
  600.     <CFSET IsOk = "No">
  601.     <cfoutput>Price must be marked up at least 20% above cost.</cfoutput>
  602. </cfif>
  603. <cfif form.departureDate GT form.returnDate>
  604.     <CFSET isOk = "No">
  605.     <cfoutput>Return date cannot precede departure date. Please re-enter.</cfoutput>
  606. </cfif>
  607. <html>
  608. <head>
  609. <title>Trip Maintenance Confirmation</title>
  610. </head>
  611.  
  612. <body>
  613.  
  614. <cfif isOk EQ "Yes">
  615.     <h1>Trip Added</h1>
  616.     <cfoutput>You have added #Form.TripName# to the trips database.
  617.     </cfoutput>
  618. </cfif>        
  619. </body>
  620. </html>
  621.  <!--- Action Page to edit and save Trip information for Compass Travel. --->
  622. <!--- Make the passportRequired variable be No if it is not set 
  623.     (check box is empty) --->
  624. <!---            CANCEL BUTTON         --->
  625.  
  626. <cfif IsDefined("Form.btnCancel")>
  627.  
  628.     <cfif IsDefined("Form.RecordID")>
  629.         <cflocation url="tripdetail.cfm?ID=#Form.RecordID#">
  630.     <cfelse>
  631.         <cflocation url="tripdetail.cfm">
  632.     </cfif>
  633.  
  634. <cfelse>
  635.     <!-- Process Save button --> 
  636.      <cfset isOk = "Yes">
  637.         
  638.     <!-- Check to see if photo file exists -->
  639.     <cfset PhotoLocation = "C:\Inetpub\wwwroot\CFDOCS\getting_started\Photos\">
  640.     <cfset PhotoLocation = PhotoLocation  & FORM.photo> 
  641.     <cfif not FileExists(PhotoLocation)>
  642.        <cfoutput>Trip Photo does not exist</cfoutput>
  643.        <cfset isOk = "No">
  644.     </cfif>
  645.  
  646.     <cfif isdefined("Form.depositRequired")>
  647.        <cfset form.depositRequired = "Yes">       
  648.     <cfelse>   
  649.        <cfset form.depositRequired = "No">
  650.     </cfif>
  651.     
  652.     <cfif form.price GT 750 AND form.depositRequired EQ "No">
  653.         <cfset IsOk = "No">
  654.         <cfoutput>Deposit is required for trips priced over $750.</cfoutput>
  655.     </cfif>
  656.     
  657.     <cfif form.basecost * 1.2 GT  form.price>
  658.         <cfset IsOk = "No">
  659.         <cfoutput>Price must be marked up at least 20% above cost.</cfoutput>
  660.     </cfif>
  661.     
  662.     <cfif form.departureDate GT form.returnDate>
  663.         <cfset isOk = "No">
  664.         <cfoutput>Return date cannot precede departure date. Please re-enter.</cfoutput>
  665.     </cfif>
  666.  
  667.  <!-- Update the database --> 
  668.     <cfif isOk EQ "Yes">
  669.        <cfif isdefined("form.tripID")>
  670.            <cfupdate datasource="CompassTravel" tablename="TRIPS">
  671.            <cflocation url="tripdetail.cfm?ID=#Form.tripID#">
  672.        <cfelse>
  673.            <cfinsert datasource="CompassTravel" tablename="TRIPS"> 
  674.            <cflocation url="tripdetail.cfm">
  675.        </cfif>
  676.     </cfif>
  677.     <cfoutput>You have added #Form.TripName# to the trips database.
  678.     </cfoutput>
  679. </cfif>        <!--- Insert the new  trip record  into the Compass Travel Database --->
  680. <!--- Use local variables to convert dates to JDBC format (yyyy-mm-dd) from input format (mm/dd/yyyy) --->
  681. <cfset JDBCdepartureDate = #Right(Form.departureDate,4)# & "-" & #Left(Form.departureDate,2)# & "-" & #Mid(Form.departureDate,4,2)#> 
  682. <cfset JDBCreturnDate = #Right(Form.returnDate,4)# & "-" & #Left(Form.returnDate,2)# & "-" & #Mid(Form.returnDate,4,2)#> 
  683. <cfquery name="AddTrip" datasource="CompassTravel">
  684.  INSERT INTO Trips (tripName, eventType, tripDescription, tripLocation, 
  685.         departureDate, returnDate, price, tripLeader, photo,
  686.         baseCost, numberPeople,    depositRequired)
  687.   VALUES ( '#Form.tripName#', #Form.eventType#, '#Form.tripDescription#',
  688.         '#Form.tripLocation#', Date'#JDBCdepartureDate#', Date'#JDBCreturnDate#',
  689.         #Form.price#,'#Form.tripLeader#', '#Form.photo#',
  690.         #Form.baseCost#, #Form.numberPeople#, '#Form.depositRequired#')
  691. </cfquery><html>
  692. <head>
  693. <title>Trip Maintenance - Search Form</title>
  694. </head>
  695. <body>
  696. <img src="images/tripsearch.gif">
  697. <!--- Search form --->
  698.     <form action="tripsearchresult.cfm" method="post">
  699.         <table>
  700.             <!--- Field: tripLocation --->
  701.             <tr>
  702.                 <td>    Trip Location
  703.                 </td>
  704.                 <td>
  705.                     <select name="tripLocationOperator">
  706.                         <option value="EQUALS">is
  707.                         <option value="BEGINS_WITH">begins with
  708.                     </select>
  709.                 </td>
  710.                 <td>
  711.                     <input type="text" name="tripLocationValue">
  712.                 </td>
  713.             </tr>    
  714.             <!--- Field: departureDate --->
  715.             <tr>
  716.                 <td>    Departure Date
  717.                 </td>
  718.                 <td>
  719.                     <select name="departureOperator">
  720.                         <option value="EQUALS">is
  721.                         <option value="BEFORE">before
  722.                         <option value="AFTER">after
  723.                     </select>
  724.                 </td>
  725.                 <td>
  726.                     <input type="text" name="departureValue">
  727.                 </td>
  728.             </tr>    
  729.             <!--- Field: price --->
  730.             <tr>
  731.                 <td>Price
  732.                 </td>
  733.                 <td>
  734.                     <select name="priceOperator">
  735.                         <option value="EQUAL">is
  736.                         <option value="GREATER">greater than
  737.                         <option value="SMALLER">smaller than
  738.                     </select>
  739.                 </td>
  740.                 <td>
  741.                     <input type="text" name="priceValue">
  742.                 </td>
  743.             </tr>
  744.         </table>
  745.         <p>
  746.         <input type="submit" value="Search">
  747.     </form>
  748. </body>
  749. </html><!--- Create Where clause for query from data entered thru search form --->    
  750.     <cfset WhereClause = " 0=0 "> 
  751.     <!--- Query returning search results --->
  752.     <!--- Build subclause for trip location --->        
  753.     <cfif Form.tripLocationValue GT "">            
  754.         <cfif Form.tripLocationOperator EQ "EQUALS">            
  755.             <cfset WhereClause = WhereClause & " and tripLocation = '" & form.tripLocationValue & "'" >
  756.         <cfelse>
  757.             <cfset WhereClause = WhereClause & " and tripLocation like '" & form.tripLocationValue & "%'" >
  758.         </cfif>
  759.     </cfif> 
  760.     <cfquery name="TripResult" datasource="CompassTravel">
  761.         SELECT tripName,  tripLocation, 
  762.             departureDate, returnDate, price, tripID 
  763.         FROM trips
  764.         WHERE #PreserveSingleQuotes(WhereClause)#
  765.     </cfquery>
  766. <html>
  767. <head>
  768. <title>Trip Maintenance - Search Results</title>
  769. </head>
  770. <body>
  771.     <img src="images/tripsearchresults.gif">
  772.  
  773.     <table border="0" cellpadding="3" cellspacing="0">
  774.         <tr bgcolor="Gray">
  775.             <td>    Trip Name
  776.             </td>
  777.             <td>    Location
  778.             </td>
  779.             <td>    Departure Date
  780.             </td>
  781.             <td>    Return Date
  782.             </td>
  783.             <td>    Price
  784.             </td>
  785.         </tr>
  786.         <cfoutput query="TripResult">
  787.             <tr>  
  788.                 <td>    #tripName#
  789.                 </td>
  790.                 <td>    #tripLocation#
  791.                 </td>
  792.                 <td>    #departureDate#
  793.                 </td>
  794.                 <td>    #returnDate#
  795.                 </td>
  796.                 <td>    #price#
  797.                 </td>
  798.             </tr>
  799.         </cfoutput>
  800.     </table>
  801. </body<!--- Insert the new  trip record  into the Compass Travel Database --->
  802. <cfquery name="AddTrip" datasource="CompassTravel">
  803.  INSERT INTO Trips (tripName, eventType, tripDescription, tripLocation, 
  804.         departureDate, returnDate, price, tripLeader, photo,
  805.         baseCost, numberPeople,    depositRequired)
  806.   VALUES ( '#Form.tripName#', #Form.eventType#, '#Form.tripDescription#',
  807.         '#Form.tripLocation#','#Form.departureDate#', '#Form.returnDate#',
  808.         #Form.price#,'#Form.tripLeader#', '#Form.photo#',
  809.         #Form.baseCost#, #Form.numberPeople#, '#Form.depositRequired#')
  810. </cfquery><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
  811. "http://www.w3.org/TR/REC-html40/loose.dtd">
  812. <html>
  813. <head>
  814. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  815. <meta name="LASTUPDATED" content="04/10/02 17:19:59">
  816.  
  817. <script language="JavaScript">
  818. <!--Hide JavaScript
  819.  
  820.    if (navigator.appName == "Netscape"){
  821.       document.write('<LINK REL=STYLESHEET HREF="../newton_ns.css" TYPE="text/css">');
  822.       }
  823.    else{
  824.       document.write('<LINK REL=STYLESHEET HREF="../newton_ie.css" TYPE="text/css">');
  825.    }
  826. //-->
  827. </script>
  828. <SCRIPT src="../newton.js" type="text/javascript"></SCRIPT>
  829. <title>Adding and Updating SQL Data</title>
  830. <!-- 
  831. <p><span class="heading1">Adding and Updating SQL Data</span></p>
  832.  -->
  833. </head>
  834. <body>
  835. <div class="navigation">
  836. <table>
  837. <tr valign="bottom">
  838. <td width="90%" align="left" valign="bottom" nowrap><em>Getting Started Building ColdFusion MX Applications</em></td>
  839. <td align="right" width="10%" valign="bottom" nowrap>
  840. <a href="implement_browse_maintenance3.html"><IMG alt="Previous" border="0" height="16" src="../images/icons/back.gif" width="16"></a>
  841. <a href="contents.htm" target="_top"><IMG alt="Up" border="0" height="16" src="../images/icons/uplevel.gif" width="16"></A>
  842. <a href="add_update2.html"><IMG alt="Next" border="0" height="16" src="../images/icons/next.gif" width="16"></a>
  843. <a href="../dochome.htm" target="_top"><IMG alt="Home" border="0" height="16" src="../images/icons/home.gif" width="16"></a>
  844. <a href="javascript:top.perdido.document.searchApplet.makeAppear();"><IMG alt="Search" border="0" height="16" src="../images/icons/search.gif" width="16"></a>
  845. </td>
  846. </tr>
  847. <tr align="left" valign="top">
  848. <td colspan="2">
  849. <hr>
  850. </td>
  851. </tr>
  852. </table>
  853. </div>
  854. <h1 id="1141000">
  855. <a name="1141000"> </a>Lesson 6<br />Adding and Updating SQL Data</h1>
  856.  
  857. <p id="1152366" class="Body">
  858.   <a name="1152366"> </a>In this lesson, you will complete the Compass Travel Trip Maintenance application. The exercises will guide you through the steps of adding the database update logic to add new trip offerings and update existing trips in the Compass Travel database. 
  859. </p>
  860. <p id="1155293" class="Body">
  861.   <a name="1155293"> </a>This lesson explains how to do the following tasks:
  862. </p>
  863. <ul>
  864. <li>Modify the Trip Edit page to link the add and update functions to the main application page.
  865. </li>
  866. <li>Write code to insert new trips using SQL. </li>
  867. <li>Write code to insert new trips without using SQL.</li>
  868. <li>Write code to update several records in the Trips table.</li>
  869. </ul><h4 id="1152376" class="Heading4">
  870.   <a name="1152376"> </a>ColdFusion tags and functions introduced in this lesson
  871. </h4>
  872. <p id="1152377" class="Body">
  873.   <a name="1152377"> </a>The following table identifies the ColdFusion tags and functions that you use in this lesson to enhance the ColdFusion application:
  874. </p>
  875. <p id="1152466" class="Body">
  876.   <a name="1152466"> </a>
  877.  
  878. <table border="1" cellpadding="5" cellspacing="0">
  879.   <caption></caption>
  880.   <tr valign="top">
  881.     <th align="left"><a name="1154694"> </a><div id="1154694" class="CellHeading">Element</div></th>
  882.     <th align="left"><a name="1154696"> </a><div id="1154696" class="CellHeading">Type</div></th>
  883.     <th align="left"><a name="1154698"> </a><div id="1154698" class="CellHeading">Description</div></th>
  884.   </tr>
  885.   <tr valign="top">
  886.     <td align="left"><a name="1154700"> </a><div id="1154700" class="CellBody">cfinsert</div></td>
  887.     <td align="left"><a name="1154702"> </a><div id="1154702" class="CellBody">Tag</div></td>
  888.     <td align="left"><a name="1154704"> </a><div id="1154704" class="CellBody">Inserts records in a JDBC data source.</div></td>
  889.   </tr>
  890.   <tr valign="top">
  891.     <td align="left"><a name="1154706"> </a><div id="1154706" class="CellBody">cfupdate</div></td>
  892.     <td align="left"><a name="1154708"> </a><div id="1154708" class="CellBody">Tag</div></td>
  893.     <td align="left"><a name="1154710"> </a><div id="1154710" class="CellBody">Updates a records in a JDBC data source.</div></td>
  894.   </tr>
  895. </table>
  896.  
  897.  
  898.  
  899.  
  900. </p>
  901. <p id="1152558" class="Body">
  902.   <a name="1152558"> </a>
  903. </p>
  904. <div class="navigation">
  905. <table>
  906. <tr valign="bottom">
  907. <td class="copy" width="90%" align="left" valign="bottom" nowrap>
  908. <a href="../copyright.htm">Copyright © 2002, Macromedia Inc. All rights reserved.</a></td>
  909. <td align="right" width="10%" valign="bottom" nowrap>
  910. <a href="implement_browse_maintenance3.html"><IMG alt="Previous" border="0" height="16" src="../images/icons/back.gif" width="16"></a>
  911. <a href="contents.htm" target="_top"><IMG alt="Up" border="0" height="16" src="../images/icons/uplevel.gif" width="16"></A>
  912. <a href="add_update2.html"><IMG alt="Next" border="0" height="16" src="../images/icons/next.gif" width="16"></a>
  913. <a href="../dochome.htm" target="_top"><IMG alt="Home" border="0" height="16" src="../images/icons/home.gif" width="16"></a>
  914. <a href="javascript:top.perdido.document.searchApplet.makeAppear();"><IMG alt="Search" border="0" height="16" src="../images/icons/search.gif" width="16"></a>
  915. </td>
  916. </tr>
  917. </table>
  918. </div>
  919.  
  920. <h2>Comments</h2>
  921. <FORM ACTION="http://livedocs.macromedia.com/cfmxdocs/Getting_Started_Building_ColdFusion_MX_Applications/add_update.jsp" target="_livedocs">
  922. <INPUT TYPE="Submit" VALUE="View comments on LiveDocs" ALT="View comments on LiveDocs">
  923. </FORM>
  924.  
  925.  
  926. </body>
  927. </html>
  928. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
  929. "http://www.w3.org/TR/REC-html40/loose.dtd">
  930. <html>
  931. <head>
  932. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  933. <meta name="LASTUPDATED" content="04/10/02 17:19:59">
  934.  
  935. <script src="../newton.js" type="text/javascript"></script>
  936. <script language="JavaScript">
  937. <!--Hide JavaScript
  938.  
  939.    if (navigator.appName == "Netscape"){
  940.       document.write('<LINK REL=STYLESHEET HREF="../newton_ns.css" TYPE="text/css">');
  941.       }
  942.    else{
  943.       document.write('<LINK REL=STYLESHEET HREF="../newton_ie.css" TYPE="text/css">');
  944.    }
  945. //-->
  946. </script>
  947. <title>Completing the Trip Maintenance application  </title>
  948. <!-- 
  949. <p><span class="heading1">Completing the Trip Maintenance application  </span></p>
  950.  -->
  951. </head>
  952. <body>
  953. <div class="navigation">
  954. <table>
  955. <tr valign="bottom">
  956. <td width="90%" align="left" valign="bottom" nowrap><em>Getting Started Building ColdFusion MX Applications</em>
  957. </td>
  958. <td align="right" width="10%" valign="bottom" nowrap>
  959. <a href="add_update.html"><IMG alt="Previous" border="0" height="16" src="../images/icons/back.gif" width="16"></a>
  960. <a href="add_update.html"><IMG alt="Up One Level" border="0" height="16" src="../images/icons/uplevel.gif" width="16"></A>
  961. <a href="get_startedIX.html"><IMG alt="Next" border="0" height="16" src="../images/icons/next.gif" width="16"></a>
  962. <a href="../dochome.htm" target="_top"><IMG alt="Home" border="0" height="16" src="../images/icons/home.gif" width="16"></a>
  963. <a href="javascript:top.perdido.document.searchApplet.makeAppear();"><IMG alt="Search" border="0" height="16" src="../images/icons/search.gif" width="16"></a>
  964. </td>
  965. </tr>
  966. <tr align="left" valign="top">
  967. <td colspan="2">
  968. <hr>
  969. <b>Adding and Updating SQL Data</b>
  970. </td>
  971. </tr>
  972. </table>
  973. </div>
  974. <br>
  975. <br>
  976. <h1 class="Heading1">
  977.   <a name="1152662"> </a>Completing the Trip Maintenance application</h1>
  978.  
  979.  
  980. <p id="1158551" class="Body">
  981.   <a name="1158551"> </a>In <a href="implement_browse_maintenance.html#1141005"></a>, you created the tripeditaction.cfm page to contain server side edits for the trip edit data entry form. In this final lesson, you will complete the tripeditaction.cfm page. To complete the action page, you will write code to do these tasks: 
  982. </p>
  983. <ul>
  984. <li>Add trips to the Compass Travel database using the cfquery tag and the SQL INSERT statement.
  985. </li>
  986. <li>Add trips to the Compass Travel database using the <code>cfinsert</code> tag.</li>
  987. <li>Update the current trip using the <code>cfupdate</code> tag.</li>
  988. <li>Link the current trip to be updated or added by the tripeditaction.cfm with the tripedit.cfm page.</li>
  989. </ul><p id="1159138" class="Body">
  990.   <a name="1159138"> </a>In addition to completing the Trip Maintenance application, you will develop a ColdFusion page to update all the prices in the database using the cfquery tag and the SQL UPDATE statement.
  991. </p>
  992. <h2 id="1152665" class="Heading2">
  993.   <a name="1152665"> </a>Writing code to save new trips to the database
  994. </h2>
  995. <p id="1158605" class="Body">
  996.   <a name="1158605"> </a>In <a href="implement_browse_maintenance.html#1141005"></a>, you built a Trip Edit page to collect the data. Now you can modify the Trip Edit action page to insert the data into the database. There are two approaches to inserting data into a SQL database: 
  997. </p>
  998. <ul>
  999. <li>Build a SQL INSERT statement and execute it using the <code>cfquery</code> tag. 
  1000. </li>
  1001. <li>Use the ColdFusion <code>cfinsert</code> tag. This approach eliminates the need for you to learn SQL syntax.</li>
  1002. </ul><h3 id="1158597" class="Heading3">
  1003.   <a name="1158597"> </a>Adding data using SQL INSERT with cfquery approach
  1004. </h3>
  1005. <p id="1158563" class="Body">
  1006.   <a name="1158563"> </a>In previous lessons, you used the SQL SELECT statement to retrieve data and the SQL DELETE statement to delete data from the Trips table in the Compass Travel database. To add new trips to the database using SQL, you must understand the syntax of the SQL INSERT statement.
  1007. </p>
  1008. <p id="1152666" class="Body">
  1009.   <a name="1152666"> </a>The SQL INSERT statement inserts new rows into a relational table. The format of the INSERT statement is as follows:
  1010. </p>
  1011. <pre>INSERT INTO table_name
  1012. </pre><pre>VALUES (value1, value2,....)
  1013. </pre><p id="1152669" class="Body">
  1014.   <a name="1152669"> </a>The database table named Clients contains information about people in the following rows:
  1015.  
  1016. <table border="1" cellpadding="5" cellspacing="0">
  1017.   <caption></caption>
  1018.   <tr valign="top">
  1019.     <th align="left"><a name="1152672"> </a><div id="1152672" class="CellHeading">LastName</div></th>
  1020.     <th align="left"><a name="1152674"> </a><div id="1152674" class="CellHeading">FirstName</div></th>
  1021.     <th align="left"><a name="1152676"> </a><div id="1152676" class="CellHeading">Address</div></th>
  1022.     <th align="left"><a name="1152678"> </a><div id="1152678" class="CellHeading">City</div></th>
  1023.   </tr>
  1024.   <tr valign="top">
  1025.     <td align="left"><a name="1152680"> </a><div id="1152680" class="CellBody">Tom</div></td>
  1026.     <td align="left"><a name="1152682"> </a><div id="1152682" class="CellBody">Jones</div></td>
  1027.     <td align="left"><a name="1152684"> </a><div id="1152684" class="CellBody">12 State St</div></td>
  1028.     <td align="left"><a name="1152686"> </a><div id="1152686" class="CellBody">Boston</div></td>
  1029.   </tr>
  1030.   <tr valign="top">
  1031.     <td align="left"><a name="1152688"> </a><div id="1152688" class="CellBody">Peter</div></td>
  1032.     <td align="left"><a name="1152690"> </a><div id="1152690" class="CellBody">Green</div></td>
  1033.     <td align="left"><a name="1152692"> </a><div id="1152692" class="CellBody">1 Broadway</div></td>
  1034.     <td align="left"><a name="1152694"> </a><div id="1152694" class="CellBody">New York</div></td>
  1035.   </tr>
  1036. </table>
  1037.  
  1038.  
  1039.  
  1040.  
  1041. </p>
  1042. <p id="1152696" class="Body">
  1043.   <a name="1152696"> </a>After the following SQL statement executes:
  1044. </p>
  1045. <pre>INSERT INTO Clients
  1046. </pre><pre>VALUES ('Smith', 'Kaleigh', '14 Greenway', 'Windham')
  1047. </pre><p id="1152699" class="Body">
  1048.   <a name="1152699"> </a>the table contains the following rows:
  1049.  
  1050. <table border="1" cellpadding="5" cellspacing="0">
  1051.   <caption></caption>
  1052.   <tr valign="top">
  1053.     <th align="left"><a name="1152702"> </a><div id="1152702" class="CellHeading">LastName</div></th>
  1054.     <th align="left"><a name="1152704"> </a><div id="1152704" class="CellHeading">FirstName</div></th>
  1055.     <th align="left"><a name="1152706"> </a><div id="1152706" class="CellHeading">Address</div></th>
  1056.     <th align="left"><a name="1152708"> </a><div id="1152708" class="CellHeading">City</div></th>
  1057.   </tr>
  1058.   <tr valign="top">
  1059.     <td align="left"><a name="1152710"> </a><div id="1152710" class="CellBody">Tom</div></td>
  1060.     <td align="left"><a name="1152712"> </a><div id="1152712" class="CellBody">Jones</div></td>
  1061.     <td align="left"><a name="1152714"> </a><div id="1152714" class="CellBody">12 State St</div></td>
  1062.     <td align="left"><a name="1152716"> </a><div id="1152716" class="CellBody">Boston</div></td>
  1063.   </tr>
  1064.   <tr valign="top">
  1065.     <td align="left"><a name="1152718"> </a><div id="1152718" class="CellBody">Peter</div></td>
  1066.     <td align="left"><a name="1152720"> </a><div id="1152720" class="CellBody">Green</div></td>
  1067.     <td align="left"><a name="1152722"> </a><div id="1152722" class="CellBody">1 Broadway</div></td>
  1068.     <td align="left"><a name="1152724"> </a><div id="1152724" class="CellBody">New York</div></td>
  1069.   </tr>
  1070.   <tr valign="top">
  1071.     <td align="left"><a name="1152726"> </a><div id="1152726" class="CellBody">Smith</div></td>
  1072.     <td align="left"><a name="1152728"> </a><div id="1152728" class="CellBody">Kaleigh</div></td>
  1073.     <td align="left"><a name="1152730"> </a><div id="1152730" class="CellBody">14 Greenway</div></td>
  1074.     <td align="left"><a name="1152732"> </a><div id="1152732" cl