SunKiss

09-08-2006, 10:11 PM

I am probably taking on more than a beginner should but I’m working on a reservation form that is 2 phases.

Phase 1 is to calculate reservation details so the guest has a detailed idea of the costs and a total as well as a few other things.

Phase 2 is to transfer the reservation details from one form to another with different field names so it can then be submitted to a shopping cart for secure information gathering.

The current test form can be found at: http://www.sunkissvillas.com/test/zpcal/reservation2.htm

Here is the logic behind the calculation side of the script (center form):

1. Guest selects arrival and departure date (ideally the script would calculate the difference between arrival and departure dates and insert the number of nights in the “nights” field but that would be a plus for the future).

2. Guest enters number of nights.

3. Guest selects season for weekly rate or longer or nightly rate from drop down menu.

4. Rental cost is automatically calculated by (number of nights * rate selection)

5. If stay is less than 7 nights a cleaning fee is automatically added.

6. Guest selects pool heat and pool heat field is automatically calculated (number of nights * 25.00)

7. Discount is determined (if stay is longer than 13 nights discount is automatically calculated by % of rental cost)(14-20 nights = 10%, 21-27 nights = 15%, 28 or more nights = 20%)

8. Total is automatically calculated (running total as costs are added.)

9. Amount due is determine (if arrival date is less than 8 weeks away amount due now = total) (if arrival date is more than 8 weeks away amount due now = (rental cost * .30)(30%)

10. Balance due date is determine (if arrival date is less than 8 weeks away balance due date = “today”) (if arrival date is more than 8 weeks away due date = arrival date – 8 weeks)

I have part of the form working properly and calculating but I have run into a problem with the “if/else” portion of the form and running totals.

I have a script that should work to do the date difference calculations but I haven’t added it in yet.

I would like to get this thing working properly because it would be a great system but I really want to understand the ins and outs of the script and what it is doing and why it is doing it and also if there is a better way to do it.

Any and all help would be greatly appreciated.

Mark

Phase 1 is to calculate reservation details so the guest has a detailed idea of the costs and a total as well as a few other things.

Phase 2 is to transfer the reservation details from one form to another with different field names so it can then be submitted to a shopping cart for secure information gathering.

The current test form can be found at: http://www.sunkissvillas.com/test/zpcal/reservation2.htm

Here is the logic behind the calculation side of the script (center form):

1. Guest selects arrival and departure date (ideally the script would calculate the difference between arrival and departure dates and insert the number of nights in the “nights” field but that would be a plus for the future).

2. Guest enters number of nights.

3. Guest selects season for weekly rate or longer or nightly rate from drop down menu.

4. Rental cost is automatically calculated by (number of nights * rate selection)

5. If stay is less than 7 nights a cleaning fee is automatically added.

6. Guest selects pool heat and pool heat field is automatically calculated (number of nights * 25.00)

7. Discount is determined (if stay is longer than 13 nights discount is automatically calculated by % of rental cost)(14-20 nights = 10%, 21-27 nights = 15%, 28 or more nights = 20%)

8. Total is automatically calculated (running total as costs are added.)

9. Amount due is determine (if arrival date is less than 8 weeks away amount due now = total) (if arrival date is more than 8 weeks away amount due now = (rental cost * .30)(30%)

10. Balance due date is determine (if arrival date is less than 8 weeks away balance due date = “today”) (if arrival date is more than 8 weeks away due date = arrival date – 8 weeks)

I have part of the form working properly and calculating but I have run into a problem with the “if/else” portion of the form and running totals.

I have a script that should work to do the date difference calculations but I haven’t added it in yet.

I would like to get this thing working properly because it would be a great system but I really want to understand the ins and outs of the script and what it is doing and why it is doing it and also if there is a better way to do it.

Any and all help would be greatly appreciated.

Mark