Ejemplo n.º 1
0
function DameArregloFiltradoUN($id)
{
    $id = (int) $id;
    $arregloFiltradoUN = [];
    $arregloIDGRFiltradoUN = [];
    $GrupoRiesgos = GrupoRiesgo::model()->findAll();
    //    $riesgoss = Riesgo::model()->findAllByAttributes(array('estado' => 1));
    //    $riesgoUnidadNegocio = RiesgoUnidadNegocio::model()->findAllByAttributes(array('id_unidad_negocio' => $id));
    for ($index1 = 0; $index1 < count($GrupoRiesgos); $index1++) {
        $arregloIDGRFiltradoUN[$index1] = $GrupoRiesgos[$index1]->id_grupo_riesgo;
    }
    for ($index2 = 0; $index2 < count($GrupoRiesgos); $index2++) {
        $arregloFiltradoUN[$index2] = DameTuCantidadFiltrada($arregloIDGRFiltradoUN[$index2], $id);
    }
    return $arregloFiltradoUN;
}
 public function actionRiesgoFiltradoPolar()
 {
     /* Este */
     $id = $_POST['id'];
     $id = (int) $id;
     $arregloFiltradoUN = [];
     $arregloIDGRFiltradoUN = [];
     $GrupoRiesgos = GrupoRiesgo::model()->findAll();
     //    $riesgoss = Riesgo::model()->findAllByAttributes(array('estado' => 1));
     //    $riesgoUnidadNegocio = RiesgoUnidadNegocio::model()->findAllByAttributes(array('id_unidad_negocio' => $id));
     for ($index1 = 0; $index1 < count($GrupoRiesgos); $index1++) {
         $arregloIDGRFiltradoUN[$index1] = $GrupoRiesgos[$index1]->id_grupo_riesgo;
     }
     for ($index2 = 0; $index2 < count($GrupoRiesgos); $index2++) {
         $arregloFiltradoUN[$index2] = DameTuCantidadFiltrada($arregloIDGRFiltradoUN[$index2], $id);
     }
     echo json_encode($arregloFiltradoUN);
 }
 /**
  * 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 GrupoRiesgo the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = GrupoRiesgo::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 4
0
                    <span class="text-extra-small text-dark"><i class="fa fa-warning fa-2x"></i></span><span class="text-large text-white"> DATOS DEL RIESGO</span>

                </div>
                <div class="panel-body ">
                    <div class="row">
                        <div class="col-md-3">

                            <div id="" class="form-group">
                                <label class="control-label">
                                    Grupo de Riesgo                                    
                                    <span class="symbol required"></span>
                                </label>
                                <select  id="idGrupoRiesgoActualizar" name="idGrupoRiesgoActualizar" class="js-example-basic-single" tabindex="-1" aria-hidden="true" style="width:100%; height: 40px;">     
                                    <option value="null">Seleccione</option> 
                                    <?php 
$grupoRiesgoCrear = new GrupoRiesgo();
$gruposRiesgoCrear = $grupoRiesgoCrear->findAll();
foreach ($gruposRiesgoCrear as $value) {
    if ($value->id_grupo_riesgo != $riesgo->id_grupo_riesgo) {
        ?>
 

                                            <option value="<?php 
        echo $value->id_grupo_riesgo;
        ?>
" title="<?php 
        echo $value->codigo;
        ?>
">
                                                <?php 
        echo $value->nombre;
Ejemplo n.º 5
0
                    <h3 class="no-margin"><i class="fa fa-list-alt"></i> Listado de Grupos de Riesgo</h3>
                </div>
                <div class="modal-body padding-10">
                    <form>
                        <table id="tablaDetallesGrupoRiesgoCualitativo" class="table table-bordered table-striped">
                            <thead class="text-center">
                                <tr>
                                    <th>Grupo de Riesgo</th>
                                    <th>Código</th>
                                    <th>Descripción</th>

                                </tr>
                            </thead>
                            <tbody class="text-center">
                                <?php 
$grupoRiesgo = new GrupoRiesgo();
$gruposRiesgo = $grupoRiesgo->findAll();
foreach ($gruposRiesgo as $value) {
    ?>
 
                                    <tr>

                                        <td>
                                            <?php 
    echo $value->nombre;
    ?>
                
                                        </td>
                                        <td>
                                            <?php 
    echo $value->codigo;