Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $timeOfDay = $_POST["session"] //change session to the name in the ID feild for the checkbox/radio button.
- $db =& JFactory::getDBO();
- // Change appointments to the name of the table used for storing the appointments
- // Change session to the name of the row in the table for the session EG: am/pm
- $query = "
- SELECT COUNT(*)
- FROM appointments
- WHERE session=`".$timeOfDay."`;
- ";
- $db->setQuery($query);
- $count = $db->loadResult();
- if ( $count > 70 ) { //Change 70 to the threshold for ammout of appointments.
- echo 'Sorry, all the passes have gone.';
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement