function getBuscarEnListaNegra($nombre = "", $primerapellido = "", $segundoapellido = "")
 {
     $this->init();
     $nombre = $nombre == "" ? $this->getOPersona()->getNombre() : $nombre;
     $primerapellido = $primerapellido == "" ? $this->getOPersona()->getApellidoPaterno() : $primerapellido;
     $segundoapellido = $segundoapellido == "" ? $this->getOPersona()->getApellidoMaterno() : $segundoapellido;
     $xUser = new cSystemUser();
     $ctx = $xUser->getCTX();
     $extras = AML_BUSQUEDA_PERSONAS_REFORZADA == true ? "&jarowinkler=true&metaphone=true" : "";
     //$nombre				= urlencode($nombre);
     $result = false;
     $items = 0;
     //count($data);
     $mURL = SVC_REMOTE_HOST . "svc/listanegra.svc.php?n=" . urlencode($nombre) . "&p=" . urlencode($primerapellido) . "&m=" . urlencode($segundoapellido) . "&ctx={$ctx}" . $extras;
     if (MODO_DEBUG == true) {
         setLog($mURL);
     }
     $ql = new MQLService("", "");
     $json = $ql->getRequest($mURL);
     //file_get_contents($mURL);
     $data = json_decode($json, true);
     if (!$data) {
         $this->mMessages .= "ERROR\tNo existen ITEMS\r\n";
     } else {
         foreach ($data as $subobj) {
             $items++;
             //{"codigo":"16145","primerapellido":"CALLE","segundoapellido":"QUIROS","nombres":" LUIS SANTIAGO","curp":"SDNTK-16145","tipo":"metaphone"}
             //var_dump($subobj);
             //setLog( $subobj->primerapellido );
             //foreach ($subobj as $cls){
             //}
             $this->mMessages .= "WARN\t" . $subobj["curp"] . " : Coincidencia " . $subobj["primerapellido"] . " " . $subobj["segundoapellido"] . " " . $subobj["nombres"] . " encontrado con  " . $subobj["tipo"] . "\r\n";
         }
     }
     //setLog("NUMERO DE ITEMS $items");
     $this->mMessages .= "WARN\tReporte : {$mURL}&report=true&ret=true \r\n";
     $this->mURLConsulta = "{$mURL}&report=true&ret=true";
     //var_dump($data);
     if ($items >= 1) {
         $result = true;
         $this->mMessages .= "ERROR\tPersona en Lista Negra o con Alto riesgo con {$items} posibles concindencias\r\n";
     }
     return $result;
 }
 function patch($force = false, $version_inicial = false, $soloIdioma = false)
 {
     $ql = new MQL();
     $xConf = new cConfiguration();
     $localver = $xConf->get("safe_osms_database_version");
     //Actualiza la configuracion
     //if($force == true){			$xConf->set("safe_osms_database_version", $version);		}
     if (FORCE_UPDATES_ON_BOOT == true or $force == true) {
         //Ejecutar Vistas y Functions
         if ($soloIdioma == false) {
             $this->setAplicarScripts();
         }
         $current = $version_inicial === false ? intval(SAFE_DB_VERSION) : $version_inicial;
         //201406.01
         $dbversion = intval(SAFE_VERSION . SAFE_REVISION);
         $sqlMenu = "INSERT INTO `general_menu` (`idgeneral_menu`, `menu_parent`, `menu_title`, `menu_file`, `menu_type`, `menu_order`) VALUES ";
         $lang = array();
         $sql = array();
         $xSrv = new MQLService("", "");
         $ulang = $xSrv->getRequest(URL_UPDATES . "install/updates/lang.php");
         $lang = json_decode($ulang, true);
         $ulang2 = $xSrv->getRequest(URL_UPDATES . "install/updates/lang2.php");
         $lang2 = json_decode($ulang2, true);
         $usql = $xSrv->getRequest(URL_UPDATES . "install/updates/sql.php?version={$localver}");
         $sql = json_decode($usql, true);
         //setLog(URL_UPDATES . "install/updates/sql.php?version=$dbversion");
         $this->mMessages .= "URL\t" . URL_UPDATES . "install/updates/sql.php?version={$localver}" . "\r\n";
         $upt = false;
         if (is_array($lang)) {
             foreach ($lang as $version => $patchs) {
                 if ($current <= intval($version)) {
                     foreach ($patchs as $idx => $content) {
                         $palabra = $content[0];
                         $traduccion = $content[1];
                         $language = $content[2];
                         $this->addLang($palabra, $traduccion, $language);
                     }
                     $upt = true;
                 }
             }
         }
         if (is_array($lang2)) {
             foreach ($lang2 as $version2 => $patchs2) {
                 if ($current <= intval($version2)) {
                     foreach ($patchs2 as $idx2 => $content2) {
                         $palabra = $content2[0];
                         $spanish = $content2[1];
                         $english = $content2[2];
                         $this->addLang($palabra, $spanish, "es");
                         $this->addLang($palabra, $english, "en");
                     }
                     $upt = true;
                 }
             }
         }
         if ($soloIdioma == false) {
             foreach ($sql as $version => $patchs) {
                 if ($current <= intval($version)) {
                     $this->mMessages .= "WARN\t===========PATCH {$version}\r\n";
                     foreach ($patchs as $idx => $content) {
                         $ql->setRawQuery($content);
                         $content = preg_replace('!\\s+!', ' ', $content);
                         $this->mMessages .= "{$idx}\t===={$content}====\r\n";
                         $upt = true;
                         //syslog(E_ERROR, $content);
                     }
                 } else {
                     $this->mMessages .= "WARN\tDescartado por ser {$version} de {$current}\r\n";
                 }
             }
             //Obtener el codigo y parcharlo
             //URL_UPDATES
             //Convierte la DB a UTF8
             //ALTER TABLE `operaciones_recibos` CHANGE COLUMN `clave_de_moneda` `clave_de_moneda` VARCHAR(6) NULL DEFAULT 'MXN', ADD COLUMN `archivo_fisico` VARCHAR(200) NULL COMMENT 'Archivo fisico del recibo, almacenado en server ftp' AFTER `origen_aml`
             $codif = $ql->getDataRecord("SHOW TABLES IN " . MY_DB_IN);
             foreach ($codif as $rows) {
                 $table = $rows["Tables_in_" . MY_DB_IN];
                 $trs = "ALTER TABLE `{$table}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
                 //$ql->setRawQuery($trs);
             }
             $ql->setRawQuery("ALTER SCHEMA `" . MY_DB_IN . "`  DEFAULT CHARACTER SET utf8  DEFAULT COLLATE utf8_general_ci");
         }
         //Actualizar vistas y functions
         if ($soloIdioma == false) {
             if ($this->setAplicarScripts() == false) {
                 $this->mMessages .= "ERROR\tAl Aplicar Vistas y funciones...\r\n";
             } else {
                 $this->mMessages .= "OK\tSe aplicaron Vistas y funciones...\r\n";
             }
         }
         //ejecutar Mensajes
         $this->mMessages .= $ql->getMessages(OUT_TXT);
         if ($upt == true) {
             /*Actualiza la configuracion*/
             $xConf->set("safe_osms_database_version", $dbversion);
         }
     } else {
         $this->mMessages .= "WARN\tSistema no Actualizado\r\n";
     }
     return $this->mMessages;
 }