January 16th, 2013, 11:24 AM
On-line theater booking system
I am finishing a system for booking seats for a theater.
Most of the work is already done but now I have to find out a way for, after havind selected the seats, I can wait for some 5 minutes for the credit card charge. If after 5 minutes the user have not bought his reservation, the seat must become available again.
To be honest I don't think I can do this with SLEEP. My only way would be to set up a cron job every 10 minutes to check for purchases not ended.
But I am pretty sure you can suggest me something more efficient and smart.
Can you help me?
January 16th, 2013, 11:41 AM
mark the tickets as "pending" in the database with a timestamp 5 minutes into the future from the user's last activity. Don't display tickets which are "pending" and their pending expiry date hasn't passed.
Comments on this post
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.