public function actionDatosHeatMap() { if (isset($_POST['IdUnidadNegocio'])) { $idUnidadNegocio = $_POST['IdUnidadNegocio']; } else { $idUnidadNegocio = 0; } $maxValueImpactoCualitativo = $_POST['maxValueImpactoCualitativo']; $maxValueProbabilidadCualitativa = $_POST['maxValueProbabilidadCualitativa']; $arrayTabla = array(); for ($index = $maxValueImpactoCualitativo; $index >= 1; $index--) { $arrayFilas = array(); for ($index1 = 1; $index1 <= $maxValueProbabilidadCualitativa; $index1++) { $totalRiesgosCol = 0; $probabilidadCualitativa = ProbabilidadCualitativa::model()->findByAttributes(array('valor' => $index1)); $impactoCualitativo = ImpactoCualitativo::model()->findByAttributes(array('valor' => $index)); if ($idUnidadNegocio == 0 || $idUnidadNegocio == "0") { $riesgos = Riesgo::model()->findAll(); } else { $unidadNegocio = UnidadNegocio::model()->findByPk($idUnidadNegocio); $riesgos = $unidadNegocio->riesgos; } foreach ($riesgos as $value) { if ($value->probabilidad_cualitativa == $probabilidadCualitativa->nombre && $value->impacto_cualitativo == $impactoCualitativo->nombre) { $totalRiesgosCol++; } } array_push($arrayFilas, $totalRiesgosCol); } array_push($arrayTabla, $arrayFilas); } $json = json_encode($arrayTabla); echo $json; }
public function actionUnidadNegocioMacroproceso() { $model = UnidadNegocioMacroproceso::model()->findAllByAttributes(array('id_macroproceso' => $_POST['idMacroproceso'])); $array = array(); foreach ($model as $value) { $unidadNegocio = UnidadNegocio::model()->findByPk($value->id_unidad_negocio); $array1 = array("id_unidad_negocio" => $unidadNegocio->id_unidad_negocio, "nombre" => $unidadNegocio->nombre); array_push($array, $array1); } $json = json_encode($array); echo $json; }
<div class="form-group"> <table id="tablaUnidadesNegocioResponsableEditar" class="table table-bordered table-striped"> <thead class="label-grey text-white center"> <tr> <!--<th style="width:1% !important;"></th>--> <th> <input type="checkbox" id="check_all" onchange="checkAll()" value="0" /></th> <th>Unidad de Negocio</th> <th>Nombre del Responsable</th> <th>Id Unidad Negocio</th> </tr> </thead> <tbody class="center"> <?php $unidadesNegocioResponsableEditar = UnidadNegocio::model()->findAll(); $countUnidadesNegocioResponsableEditar = count($unidadesNegocioResponsableEditar); foreach ($unidadesNegocioResponsableEditar as $value) { ?> <tr> <td> <!--<input type="checkbox" class="minimal"/>--> <input type="checkbox" class="activar-tex" value="0"/> <!--<input type="checkbox" value="true" checked="checked"/> checked box --> </td> <td><?php echo $value->nombre; ?> </td> <td></td>
//parte de arriva del dashboard $cantidadRiesgos = count(Riesgo::model()->findAll()); $cantidadMacroproceso = count(Macroproceso::model()->findAll()); $cantidadProceso = count(Proceso::model()->findAll()); $GradorMadurez = new UnidadNegocio(); $GradorMadurez = UnidadNegocio::model()->findAll(); $cantidadUnidadesNegocio = count($GradorMadurez); $suma = 0; for ($index = 0; $index < $cantidadUnidadesNegocio; $index++) { $suma = $suma + $GradorMadurez[$index]->evaluacion; } $GradorMadurez = (int) ($suma / $cantidadUnidadesNegocio); //end //graficas //polar $unidadesNegocio = UnidadNegocio::model()->findAll(); $Griesgos = GrupoRiesgo::model()->findAll(); $riesgos = Riesgo::model()->findAllByAttributes(array('estado' => 1)); //arreglo de riesgos $arregloUnidadNegocio = []; $arregloGRiesgos = []; $arregloIDGRiesgos = []; $arregloRiesgosToltips = []; //select unidades de negocio for ($index1 = 0; $index1 < count($unidadesNegocio); $index1++) { $arregloUnidadNegocio[$index1] = $unidadesNegocio[$index1]->nombre; } //grupo de riesgos para la grafica polar NOMBRES for ($index1 = 0; $index1 < count($Griesgos); $index1++) { $arregloGRiesgos[$index1] = $Griesgos[$index1]->nombre; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return UnidadNegocio the loaded model * @throws CHttpException */ public function loadModel($id) { $model = UnidadNegocio::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }