sjoerd Posted August 2, 2016 Report Share Posted August 2, 2016 Dear Caspio community, I have an in depth question regarding the following tutorial: Limit the number of submissions To get a better understanding of my issue I make use of the next example. I want to make an app for booking seats at a movie. Just like in the tutorial i use 3 datapages for this. Search form - for searching movies. Booking form - for booking movies. Auto-update form - for increasing the number of booked_seats. When a customer searches a movie he will have to go to the details page. The datapage determines if there are any seats available by checking if: booked_seats < max_available_seats. When this is the case a link is presented to the booking form where the customer can book a seat for the movie, after submitting the booking form the booked_seats variable is increased by 1. But, the following issues arise: The booked_seats variable is only increased after submitting the booking form. When there is only one seat left it is therefore possible that two customers get redirected. This would result in a double booking. (booked_seats = 11, max_available_seats = 10). When the admin of the movie wants to delete a record (a booking) the number of booked_seats remains the same. So, my questions are: How to prevent double bookings? My idea was when the first customer presses the link his seat is reserved for 5 minutes, like some sort of “session”. How to decrease the number of booked_seats when a record is deleted? Or, even better, how to retrieve a realtime amount of bookings from my bookings_table? I hope someone can help me with this matter. If you need any additional information regarding this issue, feel free to ask. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted August 3, 2016 Report Share Posted August 3, 2016 The provided solution is not recommended. Look at Drawback. In this implementation there is no validation if users access the submission form directly. Since it is a browser side programming there ways to hack it. It is better if you have developers custom program it and have a trigger to change the number. This way delete and double booking issue will no longer exist either. Quote Link to comment Share on other sites More sharing options...
sjoerd Posted August 6, 2016 Author Report Share Posted August 6, 2016 Thank you. We will discuss that with the developers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.