/**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate()
 {
     $modelEmpresa = new Empresa();
     $model = $modelEmpresa->findByPk($_POST['idEmpresa']);
     $model->nombre = $_POST['nombreEmpresaEditar'];
     $model->ruc = $_POST['rucEditar'];
     $model->descripcion = $_POST['descripcionEmpresaEditar'];
     $model->save();
     $this->redirect(array('default/index'));
 }
Ejemplo n.º 2
0
 public function getemp_nombre()
 {
     return ($model = Empresa::findByPk($this->emp_rut)) ? $model->emp_nombre : "SIN EMPRESA";
 }