Advertisement
Guest User

guardar

a guest
Nov 24th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.19 KB | None | 0 0
  1. public function indexAction()
  2.     {
  3.         if(!Zend_Auth::getInstance()->hasIdentity()){
  4.             $this->redirect("/");die;
  5.         }  
  6.         $form = new Application_Form_TramtAsociacion();
  7.         if($this->getRequest()->isPost()){            
  8.             $datos = $this->_request->getParams();
  9.             if ( $form->isValid( $datos ) ){
  10.                 if ( $this->guardar($datos['idrs'],$datos['tasoci'],$datos['nroresg'],$datos['fresg'],$datos['domcleg'],$datos['estado'],
  11.                         $datos['not_mem'],$datos['cert_aprob'],$datos['poder'],$datos['act_fun'],
  12.                         $datos['act_elec'],$datos['est_org'],$datos['act_aest'],$datos['list_asc'],$datos['cd_respl']) ){
  13.                    
  14.                     $Reserva=$this->entityManager->getRepository("Sistema\Entity\ResvNom")->find($datos['idrs']);
  15.                     $id_tr=$Reserva->getTramiteTrmte()->getTrmteId();
  16.                     $nrotramt=$this->entityManager->getRepository("Sistema\Entity\Tramite")->find($id_tr);
  17.                    
  18.                     $upload = $form->resimg->getTransferAdapter();
  19.                     $upload->addFilter('Rename', array(
  20.                     'target' => APPLICATION_PATH . '/../public/archivos/asociacion/'.$nrotramt->getNroTrmte().'.pdf',
  21.                     'overwrite' => true
  22.                     ));
  23.                     var_dump( $upload->receive() );
  24.                     $upload2 = $form->info->getTransferAdapter();
  25.                     $upload2->addFilter('Rename', array(
  26.                     'target' => APPLICATION_PATH . '/../public/archivos/asociacion/'.$nrotramt->getNroTrmte().'.docx',
  27.                     'overwrite' => true
  28.                     ));
  29.                     var_dump( $upload->receive() );
  30.                     $this->_helper->flashMessenger->addMessage('Ficha personal almacenada correctamente');
  31.                     $this->_redirect('/tramtAsociacion/listar');
  32.                 }else{
  33.                     $this->_helper->flashMessenger->addMessage('Ocurrio un error, intentelo nuevamente');
  34.                     $this->_redirect('/tramtAsociacion');
  35.                 }
  36.             }
  37.         }
  38.         $this->view->formulario = $form;
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement