marcq
Member
Hi,
I have created a form which enable visitors to book a boat for 3 hours.
http://www.screencast.com/t/XnH81oavHZbS
Booking table : fab_booking
Each time a booking is created the date|time of the booking is created, but alos the date|time where the crew needs to attend and the crew has finished is duty is added into the Booking table in the following fields :
Example :
book_crewstartdate : 2016-08-31 06:00:00
book_bookingstartdate : 2016-08-31 07:30:00
book_bookingenddate : 2016-08-31 10:30:00
book_crewenddate : 2016-08-31 12:00:00
1:30 hour are need before and after the crew to prepare|clean the boat.
The visitor can choose the date with the date picker :
Date Picker Element : book_bookingdate
Dropdown Element : book_starttime
Enable if time slot available
I would like to enable the dates in the date picker if there's are 6 hours available slots (6 hours because the crew needs 1:30 hour before and after the booking to prepare|clean the boat)
Example 1 :
If a booking exists into the fab_booking table between 12:00 and 18:00 and a training session exists between 06:00 and 08:00, then we have 1 free time slot between 18:00 and 00:00 :
Exemple 2 :
If a training exists into the fab_booing table between 14:00 et 16:00, then we have ten 6 hours free time slots between 06:00 and 14:00 and between 16:00 et 00:00 :
Important : Training sessions and internal events are also saved into the same fab_booking table.
Bookings starts every 30 minutes
Internal Events starts every 30 minutes
Trainings every 15 minutes
Populate the dropdown with the available startime
http://www.screencast.com/t/oyJAJB3gH8
So according example 1 I would need to populate the dropdown Element book_starttime on the fly with the following values and labels :
And according example 2 with the following values and labels :
Would appreciate some help here, since I'm stuck.
Thanks in advance,
Cheers, marc
I have created a form which enable visitors to book a boat for 3 hours.
http://www.screencast.com/t/XnH81oavHZbS
Booking table : fab_booking
Each time a booking is created the date|time of the booking is created, but alos the date|time where the crew needs to attend and the crew has finished is duty is added into the Booking table in the following fields :
Example :
book_crewstartdate : 2016-08-31 06:00:00
book_bookingstartdate : 2016-08-31 07:30:00
book_bookingenddate : 2016-08-31 10:30:00
book_crewenddate : 2016-08-31 12:00:00
1:30 hour are need before and after the crew to prepare|clean the boat.
The visitor can choose the date with the date picker :
Date Picker Element : book_bookingdate
Dropdown Element : book_starttime
Enable if time slot available
I would like to enable the dates in the date picker if there's are 6 hours available slots (6 hours because the crew needs 1:30 hour before and after the booking to prepare|clean the boat)
Example 1 :
If a booking exists into the fab_booking table between 12:00 and 18:00 and a training session exists between 06:00 and 08:00, then we have 1 free time slot between 18:00 and 00:00 :
Code:
1:30 hour for the crew to prepare the boat : 18:00 to 19:30
3 hours cruising : 19:30 to 22:30
1:30 hour for the crew to clean the boat : 22:30 to 00:00
Exemple 2 :
If a training exists into the fab_booing table between 14:00 et 16:00, then we have ten 6 hours free time slots between 06:00 and 14:00 and between 16:00 et 00:00 :
Code:
1:30 hour for the crew to prepare the boat : 06:00 to 07:30
3 hours cruising : 07:30 to 10:30
1:30 hour for the crew to clean the boat : 10:30 to 12:00
1:30 hour for the crew to prepare the boat : 06:30 to 08:00
3 hours cruising : 08:00 to 11:00
1:30 hour for the crew to clean the boat : 11:00 to 12:30
1:30 hour for the crew to prepare the boat : 07:00 to 08:30
3 hours cruising : 08:30 to 11:30
1:30 hour for the crew to clean the boat : 11:30 to 13:00
1:30 hour for the crew to prepare the boat : 07:30 to 09:00
3 hours cruising : 09:00 to 12:00
1:30 hour for the crew to clean the boat : 12:00 to 13:30
1:30 hour for the crew to prepare the boat : 08:00 to 09:30
3 hours cruising : 09:30 to 12:30
1:30 hour for the crew to clean the boat : 12:30 to 14:00
1:30 hour for the crew to prepare the boat : 16:00 to 17:30
3 hours cruising : 17:30 to 20:30
1:30 hour for the crew to clean the boat : 20:30 to 22:00
1:30 hour for the crew to prepare the boat : 16:30 to 18:00
3 hours cruising : 18:00 to 21:00
1:30 hour for the crew to clean the boat : 21:00 to 22:30
1:30 hour for the crew to prepare the boat : 17:00 to 18:30
3 hours cruising : 18:30 to 21:30
1:30 hour for the crew to clean the boat : 21:30 to 23:00
1:30 hour for the crew to prepare the boat : 17:30 to 19:00
3 hours cruising : 19:00 to 22:00
1:30 hour for the crew to clean the boat : 22:00 to 23:30
1:30 hour for the crew to prepare the boat : 18:00 to 19:30
3 hours cruising : 19:30 to 22:30
1:30 hour for the crew to clean the boat : 22:30 to 00:00
Important : Training sessions and internal events are also saved into the same fab_booking table.
Bookings starts every 30 minutes
Internal Events starts every 30 minutes
Trainings every 15 minutes
Populate the dropdown with the available startime
http://www.screencast.com/t/oyJAJB3gH8
So according example 1 I would need to populate the dropdown Element book_starttime on the fly with the following values and labels :
Code:
Valeur | Label
25 | 19:30
And according example 2 with the following values and labels :
Code:
Valeur | Label
1 | 07:30
2 | 08:00
3 | 08:30
4 | 09:00
5 | 09:30
21 | 17:30
22 | 18:00
23 | 18:30
24 | 19:00
25 | 19:30
Would appreciate some help here, since I'm stuck.
Thanks in advance,
Cheers, marc
Last edited: