<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.model');
class ChalangeModelLicenceform extends JModel{
function getRaceName($idCarrera){
$query='SELECT nombre '
.'FROM #__gcd_carreras '
."WHERE id=$idCarrera";
$aux= $this->_getList($query);
return $aux[0]->nombre;
}
function getPlayer($post){
$licence=$post['licence'];
$query='SELECT * '
.'FROM #__gcd_players '
."WHERE nroLicence=$licence";
$aux=$this->_getList($query);
return $aux[0];
}
function isRegistered($post){
$licence=$post['licence'];
$idRace=$post['idCarrera'];
$query='SELECT * '
.'FROM #__gcd_registered '
."WHERE nroLicence=$licence and idRace=$idRace";
$aux=$this->_getList($query);
echo $aux[0]->name;
return !empty($aux);
}
}
?>