Peter,  

  I will get rid of those pesky #'s.  I learned CF from a book. and I did a lot of this scripting in the first few months of programming.

Bryan,

This is what I am trying to do.

1. This is for a registration for a conference. (1500+ registrants)
2. This part is for a hotel rooms for this conference.  (up to 8 hotels.)
3. There can be up to four people sharing the room each paying their own share of the room. (i.e if the room charge is $100 each 4 people would pay $25.)
4. Roommates are do not always arrive and depart on the same day.
5. I also have a roomblock that must be maintained  accurately.
    A. I one person is in a room by themselves add one to the room block.
    B. If now person two registers to room with person one then  each is .5 and the room block number is not changed.
    C. If person one and person two both at time of registering did not pick there roommates then the both would have a single room in the room block (i.e. 2 rooms total).
    D. If person three registers to room with one and two it will make all three and will set them .33 and take one of the rooms out of the room block  (i.e. from two rooms needed down to one with all three in a room.)
    E.  If one of the roommates cancels then it would change the other two to .5 and change nothing with the room block.
    F. I can go on for a long time with the possible combinations of adding and subtracting roommates.

Current Structure.

Table 1
  Hotel_ID
  HotelName
  HotelDesciption
  TotalRoomBlock
  RBday1
  Totday1
  Date1
  RBday2
  Totday2
  Date2
  Etc.

Table 2
ID
Day1
Day2
Day3
Day4
Day5
Day6
Day7
Day8
Hotel_ID
Hotuser_ID
NID (this relates to the main registration table)
FirstName
LastName
ArrivalDate
DepartureDate
SpecialRequests
Nonsmoking
Bedtype
Roommate1ID (this is NID for the roommate)
Roommate1FirstName
Roommate1LastName
Roommate1ArrivalDate
Roommate1DepartureDate
Roommate1SpecialRequests
Roommate1Nonsmoking
Roommate2ID (this is NID for the roommate)
Roommate2FirstName
Roommate2LastName
etc.

Can you see better structure?  I am using CF 5.0 on an windows 2000 platform with access 2000.  (Yes I know, but the client wants to have the ability to download the whole thing and run access reports on their desktop.)

Jim Louis





>reconsider the way you create those variables.  How are "RM1DAY" and the
>other variables getting created?  A struct or an array would probably work
>very nicely to store those variable values differently and speed up your
>code.
>
>Also, it's generally a very bad idea to put a query inside a loop.  Of all
>the times I've seen someone do that, over 90% of them could have been
>avoided by structuring the logic differently.
>
>
>
>
>+-----------------------------------------------+
>Bryan Love
>  Database Analyst
>  Macromedia Certified Professional
>  Internet Application Developer
>TeleCommunication Systems
>[EMAIL PROTECTED]
>+-----------------------------------------------+
>
>"...'If there must be trouble, let it be in my day, that my child may have
>peace'..."
>        - Thomas Paine, The American Crisis
>
>"Let's Roll"
>        - Todd Beamer, Flight 93
>
>-----Original Message-----
>From: Jim Louis [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 12, 2004 9:47 AM
>To: CF-Talk
>Subject: getting rid of Evaluate in CF 5.0
>
>
>I have a complex page that I use this system right now.  This is  a sample
>of the text.
>
><CFIF Query.DATE EQ #Query2.DATE1#>
><CFSET A1=1>
><CFLOOP INDEX="Date1" FROM="#Starting#" TO="#Ending#">
><!--- No Roommates --->
><cfif (EVALUATE("RM1DAY" &A1) is '0') and (EVALUATE("RM2DAY" &A1) is '0')
>and (EVALUATE("RM3DAY" &A1) is '0')>
>
><CFQUERY DATASOURCE="#db#" NAME="Update">
>UPDATE table
>  SET Day#a1# = 1
>        WHERE ID = #query3.New_ID#
></CFQUERY>
>
><CFSET NEW_TOTAL = EVALUATE("query1.DAY" &A1) + 1>
>
><CFQUERY DATASOURCE="#db#" NAME="UpdateHotel">
>UPDATE table2
>       SET day#a1# = #new_total#
>      WHERE ID = #query.H_ID#
></CFQUERY>
></cfif>
>
>More code
><CFSET A1=A1+1>
></cfloop>
>
>Is there any what to get rid of all of these evaluate tags.
>  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to