function setActualizarNivelDeRiesgo($actualizar = false)
 {
     $xQL = new MQL();
     $xLi = new cSQLListas();
     $xLog = new cCoreLog();
     //$xLi->getInicialDeCuentas()
     $rs = $xQL->getDataRecord($xLi->getInicialDePersonas());
     foreach ($rs as $rows) {
         $persona = $rows["codigo"];
         $xAml = new cAMLPersonas($persona);
         $xAml->init($persona, $rows);
         $riesgo = $xAml->setAnalizarNivelDeRiesgo();
         $NivelActual = $xAml->getOPersona()->getNivelDeRiesgo();
         if ($riesgo != $NivelActual) {
             if ($riesgo >= SYS_RIESGO_MEDIO) {
                 $xLog->add($xAml->getMessages(), $xLog->DEVELOPER);
             }
             if ($actualizar == true) {
                 $xAml->getOPersona()->setActualizarNivelDeRiesgo($riesgo, $xAml->getMessages());
             }
             $xLog->add($xAml->getOPersona()->getMessages(), $xLog->DEVELOPER);
         }
     }
     return $xLog->getMessages();
 }
 function setCuandoSeActualiza()
 {
     //Actualizar Relaciones
     $xQl = new MQL();
     $rs = $xQl->getDataRecord("SELECT * FROM `socios_relaciones` WHERE `numero_socio`= " . $this->mCodigo);
     $xcRel = new cSocios_relaciones();
     foreach ($rs as $rows) {
         $xcRel->setData($rows);
         $id = $xcRel->idsocios_relaciones()->v();
         $persona = $xcRel->socio_relacionado()->v();
         $xRe = new cPersonasRelaciones($id, $persona);
         if ($xRe->init() == true) {
             $xRe->setActualizarPorPersona();
             $this->mMessages .= $xRe->getMessages();
         }
     }
     //Actualizar Empresa
     if ($this->getEsEmpresaConConvenio(true) == true) {
         $xEmp = $this->getOEmpresa();
         if ($xEmp != null) {
             $xEmp->setActualizarPorPersona();
             $this->mMessages .= $xEmp->getMessages();
         }
     }
     //Actualizar Grupo Solidario
     if ($this->getEsGrupoSolidario(true)) {
         $xGrp = $this->getOGrupoSol();
         if ($xGrp != null) {
             $xGrp->setActualizarPorPersona();
             $this->mMessages .= $xGrp->getMessages();
         }
     }
     //actualizar Sucursal
     if ($this->getEsSucursal() == true) {
         $xSuc = new cSucursal($this->mIDSucursal);
         $xSuc->setActualizarPorPersona();
         $this->mMessages .= $xSuc->getMessages();
     }
     //Actualizar Usuario
     if ($this->getEsUsuario(true)) {
         $xUsr = $this->getOUsuario();
         if ($xUsr != null) {
             $xUsr->setActualizarPorPersona();
             $this->mMessages .= $xUsr->getMessages();
         }
     }
     if (MODULO_AML_ACTIVADO == true and $this->mNoAML == false) {
         $xAML = new cAMLPersonas($this->mCodigo);
         $xAML->init($this->mCodigo, $this->getDatosInArray());
         $riesgo = $xAML->setAnalizarNivelDeRiesgo();
         if ($riesgo != $this->getNivelDeRiesgo()) {
             $this->setActualizarNivelDeRiesgo($riesgo, $xAML->getMessages());
         }
         $xAML->setActualizarRiesgoPorNucleo();
         $this->mMessages .= $xAML->getMessages();
     }
 }
function jsaValidarRiesgo($persona)
{
    $xAml = new cAMLPersonas($persona);
    $xAml->init($persona);
    $xAml->setAnalizarNivelDeRiesgo();
    //$xAml->setVerificarDocumentosCompletos();
    //$xAml->setVerificarDocumentosVencidos();
    return $xAml->getMessages(OUT_HTML);
}
$credito = parametro("idsolicitud", $credito, MQL_INT);
$credito = parametro("solicitud", $credito, MQL_INT);
$cuenta = parametro("cuenta", DEFAULT_CUENTA_CORRIENTE, MQL_INT);
$cuenta = parametro("idcuenta", $cuenta, MQL_INT);
$jscallback = parametro("callback");
$tiny = parametro("tiny");
$form = parametro("form");
$action = parametro("action", SYS_NINGUNO);
$xF = new cFecha();
$xAml = new cAML();
$nivelcargado = SYS_RIESGO_BAJO;
$notas = "";
if ($persona > DEFAULT_SOCIO) {
    $xAml = new cAMLPersonas($persona);
    if ($xAml->init() == true) {
        $nivelcargado = $xAml->setAnalizarNivelDeRiesgo();
        $notas = $xAml->getMessages();
    }
}
//$jxc = new TinyAjax();
//$jxc ->exportFunction('datos_del_pago', array('idsolicitud', 'idparcialidad'), "#iddatos_pago");
//$jxc ->process();
$xHP->init();
//$jxc ->drawJavaScript(false, true);
$xFRM = new cHForm("frmriesgo", "registro_persona_riesgosa.frm.php?action=" . MQL_ADD);
$xBtn = new cHButton();
$xTxt = new cHText();
$xSel = new cHSelect();
$xFec = new cHDate();
$xTa = new cHTextArea();
if ($action == SYS_NINGUNO) {