Location: PHPKode > projects > Chalange > com_chalange/administrator/tables/chalanges.php
<?php
/**
* @version		$Id: categories.php 
* @package		Joomla
* @copyright	Copyright (C) 2010 - 2010 Pablo Cárcaba. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
class TableChalanges extends JTable{
	var $id=null;
	var $name=null;
	var $description=null;
	var $season=null;
	var $resultsfilelocation=null;
	function __construct(&$db){
		parent::__construct('#__gcd_chalanges','id',$db);		
	}
	
	function bindU($src, $file, $ignore=array()){
		jimport('joomla.filesystem.file'); 
		//Clean up filename to get rid of strange characters like spaces etc
		$filename = 'chalangeResult_'.$src['id'].'.'.JFile::getExt(JFile::makeSafe($file['name']));       //JFile::makeSafe($file['name']);
		if (!empty($file['tmp_name'])){
			$source = $file['tmp_name'];
			$dest = JPATH_COMPONENT_SITE . DS . "uploads" . DS . $filename;
			JFile::upload($source, $dest);
			$src['resultsfilelocation']=$filename;
		}
		return parent::bind($src,$ignore);
	}
}
?>
Return current item: Chalange