Forums: Reservations Project - Not allow already booked - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Reservations Project - Not allow already booked Rate Topic: -----

#1 User is offline   Bill Lalor 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 26-September 14

Posted 29 June 2016 - 09:53 PM

Hi Sergey... I'm building an online motorpool reservation system using ASPRunner 9.1. I have a reservations table which has a [PickUpDate] field, a [PickUpTime] field, a [ReturnDate] field and a [ReturnTime] field.

I am struggling trying to figure out a way that if a user tries to select a vehicle for a date/time that is already booked to either have a pop up alert saying that the vehicle is not available or someway to filter the vehicle drop-down to not show vehicles booked at that date/time.

Any ideas?

Thanks, Bill

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16216
  • Joined: 03-February 03
  • Gender:Male

Posted 30 June 2016 - 01:57 PM

This can be done but definitely some custom coding will be required. The best option is to run a select query in event like BeforeAdd to pick all reservations that may overlap with selected date range.

You can see some ideas at http://stackoverflow...rlap-with-input but it can be more complicated if you also include reservation time in consideration. It will be also more complicated if besides overlapping ranges you need to account for range that are fully inside or fully outside of selected range.

For instance, client wants to reserve the vehicle from July 2rd to July 10th. Previous reservations like July 3rd-Juky 9th or July 1st - July 15th need to be accounted for. You might need to write some ASP code as well besides the SQL query alone.
Best regards,
Sergey Kornilov

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users