/** * 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() { $modelUnidadNegocio = new UnidadNegocio(); $model = $modelUnidadNegocio->findByPk($_POST['idUnidadNegocio']); $model->nombre = $_POST['nombreUnidadNegocioEditar']; $model->id_empresa = $_POST['idEmpresaEditar']; $model->descripcion = $_POST['descripcionUnidadNegocioEditar']; $model->save(); $this->redirect(array('default/index')); }
</a> <div class="media-body"> <h2 class="media-heading text-uppercase text-primary text-bold"><?php echo $riesgo->codigo; ?> : <?php echo $riesgo->nombre; ?> </h2> <small> <?php $modelUnidadNegocio = new UnidadNegocio(); $riesgoUnidadNegocio = new RiesgoUnidadNegocio(); $riesgoUnidadesNegocio = $riesgoUnidadNegocio->findAllByAttributes(array('id_riesgo' => $riesgo->id_riesgo)); foreach ($riesgoUnidadesNegocio as $value) { $unidadNegocio = $modelUnidadNegocio->findByPk($value->id_unidad_negocio); //chequear que la empresa sea una sola para todas las unidades } $modelProceso = new Proceso(); $procesoRiesgo = new ProcesoRiesgo(); $procesosRiesgo = $procesoRiesgo->findAllByAttributes(array('id_riesgo' => $riesgo->id_riesgo)); $nombresMacroprocesos = array(); ?> <strong>Empresa:</strong> <?php echo $unidadNegocio->idEmpresa->nombre; ?> <br> <strong>Tipo de Riesgo:</strong> <?php echo $riesgo->idTipoRiesgo->nombre; ?>