rebecca09 Posted March 25, 2010 Share Posted March 25, 2010 Hi, Currently making a booking system in PHP. Currently have a list of appointments booked by the user with a 'cancel' button next to each if they wish to cancel their appointment. However i would like this button to be automatically removed when the current date is within 24 hours of the appointment date so that they do not have the option to use the cancellation link within a certain time. Can anyone help with this please? I am getting pretty desperate and am not very good at PHP to know how to do it! Thanks Link to comment https://forums.phpfreaks.com/topic/196492-remove-cancellation-button-if-within-24-hours-of-appointment-booked/ Share on other sites More sharing options...
litebearer Posted March 25, 2010 Share Posted March 25, 2010 pseudo code... $appointment_time_stamp (this is the appoinment) $current_time_stamp (this is when the page is being viewed) $time_to_go = $appointment_time_stamp - $current_time_stamp if $time_to_go is greater than 86400 (this is 24 * 60 * 40) show the cancel button else do not show Make sense? Link to comment https://forums.phpfreaks.com/topic/196492-remove-cancellation-button-if-within-24-hours-of-appointment-booked/#findComment-1031663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.