Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Complex Structure

    Hey guys,

    I've created a reservation app that checks multiple dates against a calendar
    and if the dates are available inserts them into a table. I want to create an
    intermediate step like a container that holds in SESSION all dates until the
    user submits a final confirmation, in which the multiple dates and times store
    in a SESSION are inserted into the table. This sounds like a structure to me
    unless I can do it a different way. Can you please tell me how I would go about
    doing this? There could be anywhere from 1-20 dates, so it needs to be
    unlimited.

    <cfset eventStart = CreateDateTime(Year(queryDate), Month(queryDate),
    Day(queryDate), Hour(form.time), Minute(form.time), Second(form.time))>
    <cfset eventEnd = CreateDateTime(Year(queryDate), Month(queryDate),
    Day(queryDate), Hour(form.endtime), Minute(form.endtime), Second(form.endtime))>

    <cfset SESSION.finalList = StructNew()>

    <cfloop list="#eventStart#" index="eventId">
    <cfset SESSION.finalList.eventstart[#eventId#] = StructNew()>
    <cfset SESSION.finalList.eventend[#eventId#] = StructNew()>
    </cfloop>
    If this is heading in the right direction, how would I take this and insert it
    into the table.

    Thanks,

    Hoz

    hoz Guest

  2. Similar Questions and Discussions

    1. Class::Struct - want to access structure within structure
      I want to access a structure within a structure. Below is what I had in mind. Please help. #!/perl/bin/perl use Class::Struct; struct Step...
    2. Integrating complex XML structure
      Hi, im trying to use XMLConnector and dataset to integrate an XML file. the structure of the xml file is the following : <members> <member>...
    3. Structure of complex distributions; CVS
      I am working on a pretty complex distribution, and I could use some advice on how to structure its directories. This distribution contains...
    4. Arbitrarily Complex Data Structure
      Hi. Is it possible to create a subroutine to handle an arbitrarily complex data structure (for my purposes, complex only refers to hashes and...
    5. Complex Site Structure - One project or many?
      Hi All, We have developed a nice .Net platform for our growing internet (www.co.sutter.ca.us), intranet and internal web application sites....
  3. #2

    Default Re: Complex Structure

    I would store the list of event dates in an array instead. Each element of the
    array being a structure that would hold the "eventStart" and "eventEnd" date
    pair. When the user is ready, you could cfloop through the event list array
    (i.e. loop from 1 to the number of array elements) and get the "eventStart" and
    "eventEnd" for the each element and insert those dates into your table. You
    would of course need to verify that the dates were still available before
    inserting them.

    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139