function getImportarDesdeAsociada($tipo) { $result = true; $svc = new MQLService("", ""); $cmd = $svc->getEncryptData($tipo); $xTu = new cSystemUser(TASK_USR, false); $xTu->init(); $ctx = $xTu->getCTX(); $data = $svc->getEncryptData($this->mCodigo); $host = SVC_ASOCIADA_HOST; switch ($tipo) { case TPERSONAS_GENERALES: $dpersona = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dpersona)) { $xSoc = new cSocios_general($dpersona); if (setNoMenorQueCero($xSoc->codigo()->v()) > 0) { $xSoc->query()->insert()->save(); $result = true; } } break; case TPERSONAS_DIRECCIONES: $ddomicilio = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($ddomicilio)) { $xDom = new cSocios_vivienda($ddomicilio); if (setNoMenorQueCero($xDom->idsocios_vivienda()->v())) { $xDom->query()->insert()->save(); $result = true; } } break; case TPERSONAS_ACTIVIDAD_ECONOMICA: $dtrabajo = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dtrabajo)) { $xTrab = new cSocios_aeconomica($dtrabajo); if (setNoMenorQueCero($xTrab->idsocios_aeconomica()->v())) { $xTrab->query()->insert()->save(); $result = true; } } break; case TCATALOGOS_EMPRESAS: $dempresa = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dempresa)) { $xEmp = new cSocios_aeconomica_dependencias($dempresa); if (setNoMenorQueCero($xEmp->idsocios_aeconomica_dependencias()->v())) { $xEmp->query()->insert()->save(); $result = true; } } break; } return $result; }
//<===== FIN_H //===================================================================================================== $xInit = new cHPage("", HP_SERVICE); $txt = ""; $svc = new MQLService("", ""); $ql = new MQL(); $data = isset($_REQUEST["data"]) ? $_REQUEST["data"] : null; $command = isset($_REQUEST["cmd"]) ? $svc->getDecryptData($_REQUEST["cmd"]) : null; //$context = (isset($_REQUEST["ctx"])) ? $svc->getDecryptData($_REQUEST["ctx"]) : null; $xTu = new cSystemUser(TASK_USR, false); $xTu->init(); $ctx = $xTu->getCTX(); $cmd = $svc->getEncryptData($command); switch ($command) { case TPERSONAS_GENERALES: $dpersona = $svc->getService(SVC_ASOCIADA_HOST . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dpersona)) { $xSoc = new cSocios_general($dpersona); $xSoc->query()->insert()->save(); //Iniciar Cuenta de Captacion } break; case TPERSONAS_DIRECCIONES: $ddomicilio = $svc->getService(SVC_ASOCIADA_HOST . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($ddomicilio)) { $xDom = new cSocios_vivienda($ddomicilio); $xDom->query()->insert()->save(); } break; case TPERSONAS_ACTIVIDAD_ECONOMICA: $dtrabajo = $svc->getService(SVC_ASOCIADA_HOST . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}");