php - How to prevent adding twice on booking system -
I have time for a booking system, where a user can book at a time which says one hour within a specific date is. My question is that when I open the site in two tabs in the past I can not handle the case and I try to book one time from one tab and then it is displayed on the calendar that the booking is done, but The second tab is not refreshing from the page and it still shows the time to be reserved and I can book it, so it shows me two, I mean I can open tabs as much as I can and can do it, how can I enable it to be booked only once at a certain date ???
You can write some scripts which will return the request, In the booking page, a simple Ajax query is made to find that the selected period is still available and it is being run by setTimeout () . If the request will show that the period has already been booked, you can inform the user by showing him the appropriate message and deactivate the form of the deed unless the valid term is chosen. This will also help you when someone will book the selected date, while other users are thinking about it :)
Comments
Post a Comment