<?php
/**
 * Pro Perfect Karousel
 *This program is free software: you can redistribute it and/or modify it under the terms
 *of the GNU General Public License as published by the Free Software Foundation,
 *either version 3 of the License, or (at your option) any later version.
 *
 *This program is distributed in the hope that it will be useful,
 *but WITHOUT ANY WARRANTY; without even the implied warranty of
 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *GNU General Public License for more details.
 *
 *You should have received a copy of the GNU General Public License
 *along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *@author ProJoom
 *@copyright (C) 2008 - 2012 ProJoom
 *@link http://www.projoom.com/extensions/pro-perfect-karousel.html.html Official website
 **/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TablePlaylist extends JTable
{
	var $bid				= null;
	var $cid				= null;
	var $type				= '';
	var $name				= '';
	var $date				= null;
	var $showPlaylist			= 1;
	var $checked_out		= 0;
	var $checked_out_time	= 0;
	var $editor				= '';
	var $npctt	= '';
	var $npcimg	= '';
	var $npcbigdesc	= '';
	var $npclink	= '#';
	var $npctarget	= 0;
	var $catid				= null;
	var $ordering			= null;
	var $publish_up			= null;
	var $publish_down		= null;
	function __construct( &$_db )
	{
		parent::__construct( '#__novapc', 'bid', $_db );
		$now =& JFactory::getDate();
		$this->set( 'date', $now->toMySQL() );
	}
	function check()
	{
		if (is_null($this->cid) || $this->cid == 0) {
			$this->setError(JText::_( 'Please select a valid category!' ));
			return false;
		}
		if(trim($this->name) == '') {
			$this->setError(JText::_( 'Have you forgot to add a name?' ));
			return false;
		}
		return true;
	}
}
?>
