}
    $texto_contrato = $base_contrato;
    foreach ($vars as $key => $value) {
        $texto_contrato = str_replace($key, $value, $texto_contrato);
    }
    if ($monto_parcialidad > 0) {
        $xRPT->addContent($texto_contrato);
        $ppn++;
        if ($ppn == 2) {
            if ($out == OUT_DOC) {
            } else {
                $xRPT->addContent("<hr class='divisormedio' />\n");
            }
        }
        if ($ppn > 2) {
            if ($out == OUT_DOC) {
                $xRPT->addContent("<br clear=all style='mso-special-character:line-break;page-break-before:always'>");
            } else {
                $xRPT->addContent("\n\n<br class='npage' />\n\n");
            }
            $ppn = 1;
        }
    }
    $contar++;
}
if ($out == OUT_DOC) {
    header("Content-type: application/vnd.ms-word");
    header("Content-Disposition: attachment;Filename=document_name.doc");
}
echo $xRPT->render(false);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("fecha-1", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$jsEvent = $out != OUT_EXCEL ? "initComponents()" : "";
$senders = getEmails($_REQUEST);
$xODat = new cPersonasCatalogoOtrosDatos();
$sql = "SELECT\r\n\t`socios`.`codigo`,\r\n\t`socios`.`nombre`,\r\n\t`socios_otros_parametros`.`clave_del_parametro` \r\nFROM\r\n\t`socios_otros_parametros` `socios_otros_parametros` \r\n\t\tINNER JOIN `socios` `socios` \r\n\t\tON `socios_otros_parametros`.`clave_de_persona` = `socios`.`codigo` \r\nWHERE\r\n\t(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_PRINCIPAL . "')\r\n\t\t\tOR\r\n\t(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_AFINIDAD . "')\t\t\t\r\n\tOR\r\n(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_CONSANGUINIDAD . "')\t\t\t\r\n\t\tOR\r\n(`socios_otros_parametros`.`clave_del_parametro` ='" . $xODat->AML_PEP_VINCULO_ECONOM . "')\t";
$titulo = "";
$archivo = "";
$xRPT = new cReportes($titulo);
$xRPT->setFile($archivo);
$xRPT->setOut($out);
$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$xT = new cTabla($sql, 1);
$xT->setTipoSalida($out);
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
//$xT->setEventKey("jsGoPanel");
//$xT->setKeyField("creditos_solicitud");
$xRPT->addContent($xT->Show());
//============ Agregar HTML
//$xRPT->addContent( $xHP->init($jsEvent) );
//$xRPT->addContent( $xHP->end() );
$xRPT->setResponse();
$xRPT->setSenders($senders);
echo $xRPT->render(true);
            $xFld = new cHFieldset($flTitle);
            $xFld->addHElem($xTbl->get());
            $txtLst .= $xFld->get();
        }
    }
    if ($getPDF == true) {
        //base64_encode($sql)
        $xFMT = new cFormato(8801);
        $xFMT->setProcesarVars(array("variable_listado_de_cedulas" => $txtLst, "variable_item_buscado" => "{$nombre} / {$apaterno} / {$amaterno}", "variable_cadena_consulta" => ""));
        $xRPT = new cReportes($xHP->getTitle());
        $xRPT->getEncabezado($xHP->getTitle());
        if ($ret == true) {
            $xRPT->setOut(OUT_HTML);
            $xRPT->setFile("ofacs_list_");
            $xRPT->addContent($xFMT->get());
            $xRPT->render(true);
            $dompdf = new DOMPDF();
            $dompdf->load_html($xRPT->render(true));
            $dompdf->set_paper("letter", "portrait");
            $dompdf->render();
            $json["pdf"] = base64_encode($dompdf->output());
        } else {
            $xRPT->setSenders($mails);
            $xRPT->setOut(OUT_PDF);
            $xRPT->setFile("ofacs_list_");
            $xRPT->addContent($xFMT->get());
            $xRPT->render(true);
        }
    }
} else {
    $json = $json["error"] = $mql->getMessages(OUT_TXT);