Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. $timeOfDay = $_POST["session"] //change session to the name in the ID feild for the checkbox/radio button.
  4.  
  5. $db =& JFactory::getDBO();
  6.  
  7. // Change appointments to the name of the table used for storing the appointments
  8. // Change session to the name of the row in the table for the session EG: am/pm
  9. $query = "
  10.    SELECT COUNT(*)
  11.        FROM appointments
  12.     WHERE session=`".$timeOfDay."`;
  13. ";
  14. $db->setQuery($query);
  15. $count = $db->loadResult();
  16. if ( $count > 70 ) { //Change 70 to the threshold for ammout of appointments.
  17.   echo 'Sorry, all the passes have gone.';
  18.   return;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement