Location: PHPKode > projects > Chalange > com_chalange/administrator/tables/races.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 TableRaces extends JTable{
	var $id=null;
	var $fecha=null;
	var $ubicacion=null;
	var $descripcion=null;
	var $nombre=null;
	var $idTipoCarrera=null;
	var $registerDataStart=null;
	var $registerDataEnd=null;
	var $resultsfilelocation=null;
	
	function __construct(&$db){
		parent::__construct('#__gcd_carreras','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 = 'raceResult_'.$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;
		}
		//adecuamos el formato de la fecha al formato MySQL
		//echo strftime(JText::_("DATE_MYSQL"),strtotime($src['fecha'])); 
		$src['fecha']=strftime(JText::_("DATE_MYSQL"),strtotime($src['fecha'])).' '.$src['hour'].':'.$src['minute'];
		$src['registerDataStart']=strftime(JText::_("DATE_MYSQL"),strtotime($src['registerDataStart'])).' '.$src['registerHourStart'].':'.$src['registerMinuteStart'];
		$src['registerDataEnd']=strftime(JText::_("DATE_MYSQL"),strtotime($src['registerDataEnd'])).' '.$src['registerHourEnd'].':'.$src['registerMinuteEnd'];
		return parent::bind($src,$ignore);
	}
}
?>
Return current item: Chalange