Location: PHPKode > scripts > Purple Beanie Web Booking For Joomla > com_pbbooking/admin/controller.php
<?php
/**
 * @package    PurpleBeanie.PBBooking
 * @subpackage Components
 * @link http://www.purplebeanie.com
 * @license    GNU/GPL
 */
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport('joomla.application.component.controller');
 
/**
 * PBBooking Component Controller
 *
 * @package    PurpleBeanie.PBBooking
 * @subpackage Components
 */

class PbbookingsController extends JController
{
    /**
     * Method to display the view
     *
     * @access    public
     */
    function display()
    {	
		$sql = "select * from #__pbbooking_slots";
		$db =& JFactory::getDBO();
		$db->setQuery( $sql );
		$timeslots = $db->loadAssocList();
		JRequest::setVar('timeslots',$timeslots);
		
		$db =& JFactory::getDBO();

		$query = "SELECT path from #__pbbooking_cals where in_cal=1";
		$db->setQuery($query);
		$cals = $db->loadResultArray();
		
		$calprobs = 0;
		foreach($cals as $test) {
			if (file_exists($test)) {
			} else {
				$calprobs = 1;
			}
		}

		if ($calprobs == 0) {
			parent::display();
		} else {
			$this->setMessage( JText::sprintf( 'It appears your calendars are not configured correctly
				please ensure this configuration is fixed first.', $n ) );
			$this->setRedirect( 'index.php?option=com_pbbooking&controller=calendar&task=display' );
		}		
    }

}
Return current item: Purple Beanie Web Booking For Joomla