Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 1.95 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. /**
  4.  * perfil actions.
  5.  *
  6.  * @package    Proyecto
  7.  * @subpackage perfil
  8.  * @author     Your name here
  9.  * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
  10.  */
  11. class perfilActions extends sfActions
  12. {
  13.  /**
  14.   * Executes index action
  15.   *
  16.   * @param sfRequest $request A request object
  17.   */
  18.   public function executePrincipal(sfWebRequest $request)
  19.   {
  20.         $this->id=$this->getUser()->getAttribute('id');
  21.         $this->nombre=$this->getUser()->getAttribute('nombre');
  22.         $this->apellido=$this->getUser()->getAttribute('apellido');
  23.         $q=Doctrine_Core::getTable('Curriculum')
  24.         ->createQuery('c')
  25.         ->where('c.pasante_id = ?', $this->id);
  26.         $curriculum = $q->execute();
  27.    
  28.         if (count($curriculum)>0){
  29.                 $this->curriculum=true;
  30.         }else{
  31.                 $this->curriculum=false;
  32.         }
  33.        
  34.   }
  35.  
  36.   public function executeBuscarempresa(sfWebRequest $request)
  37.   {
  38.  
  39.         $this->id=$this->getUser()->getAttribute('id');
  40.         $this->autenticado=$this->getUser()->isAuthenticated();
  41.         $this->nombre=$this->getUser()->getAttribute('nombre');
  42.         $this->apellido=$this->getUser()->getAttribute('apellido');
  43.         $q=Doctrine_Core::getTable('Curriculum')
  44.         ->createQuery('c')
  45.         ->where('c.pasante_id = ?', $this->id);
  46.         $curriculum = $q->execute();
  47.    
  48.         if (count($curriculum)>0){
  49.                 $this->curriculum=true;
  50.         }else{
  51.                 $this->curriculum=false;
  52.         }
  53.        
  54.         $this->form = new BuscarEmpresaForm();
  55.   }
  56.  
  57.    public function executeCreate(sfWebRequest $request)
  58.   {
  59.         $this->autenticado=$this->getUser()->isAuthenticated();
  60.     $this->forward404Unless($request->isMethod(sfRequest::POST));
  61.     $this->form = new PasanteForm();
  62.         $this->processForm($request, $this->form);
  63.        
  64.     $this->setTemplate('new');
  65.   }
  66.  
  67.   protected function processForm(sfWebRequest $request, sfForm $form)
  68.   {
  69.     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
  70.                
  71.                 if ($form->isValid()){
  72.                         $this->redirect('perfil/Principal');           
  73.                 }
  74.  
  75.   }
  76. }