Location: PHPKode > projects > Chalange > com_chalange/administrator/controllers/registereds.php
<?php
/**
 * @version		$Id: application.php 13243 2009-10-20 04:01:04Z ian $
 * @package		Joomla
 * @subpackage	Config
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

require_once( JPATH_COMPONENT.DS.'views'.DS.'registeredsadmin'.DS.'view.html.php' );

/**
 * @package		Joomla
 * @subpackage	Config
 */
class ChalangeAdminControllerRegistereds extends ChalangeAdminController
{
  		/*function add(){
  			JRequest::setVar('view','registeredAdmin');
  			JRequest::setVar('idRace',JRequest::getCmd('idRace'));
  			parent::display();
  		}*/
  		function edit(){
  			JRequest::setVar('view','registeredAdmin');
  			JRequest::setVar('idRace',JRequest::getCmd('idRace'));
  			parent::display(); //muestro la vista
  		}  	
  		function remove(){
  			JRequest::setVar('view','registeredsAdmin');
  			JRequest::setVar('idRace',JRequest::getCmd('idRace'));
  			$cid = JRequest::getVar('cid',array(),'','array');
  			$db =& JFactory::getDBO();
  			if (count($cid)){
  				$cids= implode(',',$cid);
  				$query="DELETE FROM #__gcd_registered WHERE id IN ($cids)";
  				$db->setQuery($query);
  				if (!$db->query()){
  					echo "<script>alert('".$db->getErrorMsg()."');
   					window.history.go(-1);</script>\n";
  				}
  			} 			
  			parent::display();
  		}

  		
  		/*Descarga los preincritos en formato hoja de calculo*/
  		function download(){
  			require_once( JPATH_COMPONENT_SITE.DS.'helpers'.DS.'excel_writer.php' );
  			$model=& $this->getModel('raceAdmin');
			$idCarrera=JRequest::getCmd('idRace');
			$raceName=$model->getRaceName($idCarrera);
			$registered=$model->getRegistereds($idCarrera);		
			writeExcel::createRegisteredSheet($raceName."_".JText::_('REGISTERED SHEET'),$registered);
			exit; //importante para que se descarge el fichero y temrine el stream binario.
  		}	  		
	
}
Return current item: Chalange