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;
 }
예제 #2
0
 public function grabar()
 {
     $sql = "";
     $count = 0;
     if (!$this->_existe) {
         $this->cve_tipo = UtilDB::getSiguienteNumero("tipos_actividades", "cve_tipo");
         $sql = "INSERT INTO tipos_actividades VALUES ({$this->cve_tipo}," . $this->cve_unidad_negocio->getCve_unidad_negocio() . ",'{$this->nombre}',{$this->activo})";
         $count = UtilDB::ejecutaSQL($sql);
         if ($count > 0) {
             $this->_existe = true;
         }
     } else {
         $sql = "UPDATE tipos_actividades SET ";
         $sql .= "cve_unidad_negocio = " . $this->cve_unidad_negocio->getCve_unidad_negocio() . ",";
         $sql .= "nombre = '{$this->nombre}',";
         $sql .= "activo=" . ($this->activo ? "1" : "0");
         $sql .= " WHERE cve_tipo = {$this->cve_tipo}";
         $count = UtilDB::ejecutaSQL($sql);
     }
     return $count;
 }
 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;
 }
예제 #4
0
    echo $Cuestionarios->descripcion;
    echo '<br>';
}
?>
  
                                            </i>
                                        </div>

                                    </div>
<!--                                  
                                                <?php 
$cuestionario = new Cuestionario();
$Cuestionarios = $cuestionario->findByAttributes(array('id_cuestionario' => 1));
if ($Cuestionarios != null) {
    //                                echo '';$preguntasEspesificas = $preguntaEspesifica->findAll();
    $un = new UnidadNegocio();
    $uns = $un->findByAttributes(array('id_empresa' => $Cuestionarios->idUnidadNegocio->id_empresa));
    echo 'NOMBRE: ';
    echo $uns->nombre;
    echo '<br>';
    echo 'DESCRIPCION: ';
    echo $uns->descripcion;
    ?>
  
                                                    <?php 
}
?>
  
                                            </i>
                                        </div>
예제 #5
0
  return;
  } */
$un = new UnidadNegocio();
$count = 0;
$xAccion = "";
$txtCveUnidadNegocio = 0;
$txtNombre = "";
$cbxActivo = 0;
$msg = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $xAccion = test_input($_POST["xAccion"]);
    $txtCveUnidadNegocio = (int) test_input($_POST["txtCveUnidadNegocio"]);
    $txtNombre = test_input($_POST["txtNombre"]);
    $cbxActivo = isset($_POST["cbxActivo"]) ? 1 : 0;
    if ($txtCveUnidadNegocio != 0) {
        $un = new UnidadNegocio($txtCveUnidadNegocio);
    }
    if ($xAccion == 'grabar') {
        $un->setNombre($txtNombre);
        $un->setActivo($cbxActivo);
        $count = $un->grabar();
        if ($count > 0) {
            $msg = "Los datos han sido guardados.";
        } else {
            $msg = "Ha ocurrido un imprevisto al guardar los datos";
        }
    } elseif ($xAccion == 'eliminar') {
        $count = $un->borrar();
        if ($count > 0) {
            $msg = "El registro ha sido borrado con éxito";
            $un = NULL;
예제 #6
0
                            </div>

                        </div>

                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div id="" class="form-group">
                                <label class="control-label">
                                    Unidad(s) de Negocio                                    
                                    <span class="symbol required"></span>
                                </label>
                                <select  id="idUnidadNegocioActualizar" name="idUnidadNegocioActualizar[]" class="js-example-basic-multiple" multiple="multiple" tabindex="1" aria-hidden="true" style="width:100%; height: 41px;overflow-y: auto;">     
                                    <option value="null">Seleccione</option> 
                                    <?php 
$unidadNegocioCrear = new UnidadNegocio();
$unidadesNegocioCrear = $unidadNegocioCrear->findAll();
foreach ($unidadesNegocioCrear as $value) {
    $riesgoUnidadNegocio = RiesgoUnidadNegocio::model()->findAllByAttributes(array('id_riesgo' => $riesgo->id_riesgo, 'id_unidad_negocio' => $value->id_unidad_negocio));
    if (count($riesgoUnidadNegocio) == 0) {
        ?>
 

                                            <option value="<?php 
        echo $value->id_unidad_negocio;
        ?>
" title="<?php 
        echo $value->nombre;
        ?>
">
                                                <?php 
예제 #7
0
                    <h3 class="no-margin"><i class="fa fa-list-alt"></i> Listado de Procesos</h3>
                </div>
                <div class="modal-body padding-20" style="overflow-x: hidden; overflow-y: auto">
                    <form >
                        <table id="tablaDetallesProcesos" class="table table-bordered table-striped" style="width:100%;" >
                            <thead class="text-center">
                                <tr>

                                    <th>Unidad de Negocio</th>                                                                      
                                    <th>Proceso-Responsable</th>

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

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

                                        <td class="text-left">
                                            <?php 
예제 #8
0
    <div class="box box-solid ">
        <div class="box-header panel-blue">
            <i class="fa fa-th"></i>
            <h3 class="box-title">Mapa de Riesgos Cualitativos</h3>
            <div class="box-tools pull-right">
                <button id="filterHeatMap" class="btn btn-transparent-white"><i class="fa fa-filter"></i></button>
                <button data-widget="collapse" class="btn btn-transparent-white btn-sm"><i class="fa fa-minus"></i></button>
                <button data-widget="remove" class="btn btn-transparent-white btn-sm"><i class="fa fa-times"></i></button>
            </div>
            <div id="idUnidadNegocioFilterDiv" style="display: none">
                <select  id="idUnidadNegocioFilter" name="idUnidadNegocioFilter" class="js-example-basic-single"  tabindex="1" aria-hidden="true" style="width:100%; height: 40px; margin-top: 5px;" placeholder="Seleccione">     
                    <option value="0" title="">
                        Todas      
                    </option> 
                    <?php 
$unidadNegocioFilter = new UnidadNegocio();
$unidadesNegocioFilter = $unidadNegocioFilter->findAll();
foreach ($unidadesNegocioFilter as $value) {
    ?>
 

                        <option value="<?php 
    echo $value->id_unidad_negocio;
    ?>
" title="<?php 
    echo $value->nombre;
    ?>
">
                            <?php 
    echo $value->nombre;
}
예제 #9
0
                <div id="busquedaAvanzadaDiv" class="box box-primary" style="display: none">
                    <div class="box-header">
                        <h3 class="box-title">Búsqueda Avanzada</h3>
                    </div>
                    <div class="box-body">

                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label class="control-label">
                                        Unidad(es) de Negocio
                                    </label>
                                    <select  id="unidadNegocioSearch" name="unidadNegocioSearch[]" class="js-example-basic-multiple" multiple="multiple" tabindex="1" aria-hidden="true" style="width:100%; height: 40px;">     
                                        <option value="">Seleccione</option> 
                                        <?php 
$modelUnidadNegocio = new UnidadNegocio();
$unidadesNegocio = $modelUnidadNegocio->findAll();
foreach ($unidadesNegocio as $value) {
    ?>
 

                                            <option value="<?php 
    echo $value->id_unidad_negocio;
    ?>
" title="">
                                                <?php 
    echo $value->nombre;
}
?>
 
                                        </option> 
예제 #10
0
                            <div class="col-sm-8">
                                <div class="media">
                                    <a class="pull-left" href="#">
                                        <i class="fa fa-paste fa-3x "></i>
                                    </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;
?>
 /**
  * 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;
 }