$doc1 = isset($_FILES["f1"]) ? $_FILES["f1"] : false;
 $observaciones = isset($DDATA["idobservaciones"]) ? $DDATA["idobservaciones"] : "";
 $tipoimportacion = isset($DDATA["idtipoimportacion"]) ? $DDATA["idtipoimportacion"] : "SDN";
 $xFil = new cFileImporter();
 $limit = $tipoimportacion == "SDN" ? 12 : 6;
 $xFil->setLimitCampos($limit);
 $xFil->setCharDelimiter("|");
 $xFil->setType("PIP");
 //var_dump($_FILES["f1"]);
 if ($xFil->processFile($doc1) == true) {
     $data = $xFil->getData();
     foreach ($data as $valores => $cont) {
         $id = $xT->cInt($cont[0]);
         switch ($tipoimportacion) {
             case "SDN":
                 $xFil->setDataRow($cont);
                 /*
                 4149|"CAVIEDES CRUZ, Leonardo"|"individual"|"SDNT"|
                 -5  - 6  - 7  - 8  -  9 - 10 - 11
                 -0- |-0- |-0- |-0- |-0- |-0- |-0-
                 -12 
                 |"DOB 23 Nov 1952; Cedula No. 16593470 (Colombia); Passport AB151486 (Colombia); alt. Passport AC444270 (Colombia); alt. Passport OC444290 (Colombia)." 
                 					 * */
                 $tipo = $xT->cChar(str_replace('"', "", $cont[2]));
                 if ($id > 0) {
                     if ($tipo == "individual" or $tipo == "-0-") {
                         $xSoc = new cSocio($id);
                         $programa = strtoupper(str_replace('"', "", $cont[3]));
                         $idpoblacion = "{$programa}-{$id}";
                         $nombres = strtoupper(str_replace('"', "", $cont[1]));
                         $apellido1 = "";
     public $TRABAJO_FECHA_INGRESO = 22;
     public $NACIONALIDAD = 23;
     public $CIUDAD_NACIMIENTO = 24;
     public $INGRESOS_MENSUALES = 25;
 }
 //Cedula de Identidad
 $tmp = new cTmp();
 $xFi->setCharDelimiter("|");
 $xFi->setLimitCampos(26);
 //var_dump($_FILES["f1"]);
 if ($xFi->processFile($doc1) == true) {
     $data = $xFi->getData();
     $conteo = 1;
     foreach ($data as $rows) {
         if ($conteo > 1) {
             $xFi->setDataRow($rows);
             $xSoc = new cSocio(false);
             /*$nombre, $apellidopaterno = "", $apellidomaterno = "",
             		$rfc = "POR_REGISTRAR", $curp = "POR_REGISTRAR", $cajalocal = 99,
             		$fecha_de_nacimiento = false, $lugar_de_nacimiento = "DESCONOCIDO",
             		
             		$tipo_de_ingreso = FALLBACK_PERSONAS_TIPO_ING, $estado_civil = DEFAULT_ESTADO_CIVIL,
             		
             		$genero = DEFAULT_GENERO, $dependencia = FALLBACK_CLAVE_EMPRESA, $regimen_conyugal = DEFAULT_REGIMEN_CONYUGAL,
             		
             		$personalidad_juridica = 1, $grupo_solidario = DEFAULT_GRUPO, $observaciones = "",
             		
             		$identificado_con = 1, $documento_de_identificacion = "0", $codigo = false, $sucursal = false,
             		
             		$movil	= "", $correo = "", $dependientes = 0, $fecha = false, $riesgo = AML_PERSONA_BAJO_RIESGO, $clave_fiel = "", 
             		$pais = EACP_CLAVE_DE_PAIS
    $xFRM->addSubmit();
    $xFRM->addFootElement('<input type="hidden" name="MAX_FILE_SIZE" value="1024000">');
    echo $xFRM->get();
} else {
    $doc1 = isset($_FILES["f1"]) ? $_FILES["f1"] : false;
    $observaciones = isset($DDATA["idobservaciones"]) ? $DDATA["idobservaciones"] : "";
    $xFil = new cFileImporter();
    $xFil->setCharDelimiter("\",");
    $xTmp = new cTmp();
    //var_dump($_FILES["f1"]);
    if ($xFil->processFile($doc1) == true) {
        $data = $xFil->getData();
        $linea = 0;
        foreach ($data as $valores => $cont) {
            //
            $xFil->setDataRow($data);
            $xSoc = new cSocio(false);
            /*$nombre, $apellidopaterno = "", $apellidomaterno = "",
            		$rfc = "", $curp = "", $cajalocal = DEFAULT_CAJA_LOCAL,
            		$fecha_de_nacimiento = false, $lugar_de_nacimiento = "",
            		$tipo_de_ingreso = FALLBACK_PERSONAS_TIPO_ING, $estado_civil = ,
            		$genero = , $dependencia = , $regimen_conyugal = ,
            		$personalidad_juridica = , $grupo_solidario = , $observaciones = "",
            		$identificado_con = 1, $documento_de_identificacion = "0", $codigo = false, $sucursal = false,
            		$movil	= "", $correo = "", $dependientes = 0, $fecha = false, $riesgo = AML_PERSONA_BAJO_RIESGO, $clave_fiel = "", 
            		$pais = EACP_CLAVE_DE_PAIS, $regimen_fiscal = DEFAULT_REGIMEN_FISCAL*/
            $xSoc->setOmitirAML();
            $ready = $xSoc->add($xFil->getV($xTmp->NOMBRE), $xFil->getV($xTmp->PRIMER_APP), $xFil->getV($xTmp->SEGUNDO_APP), "", "", false, false, "", TIPO_INGRESO_PEP, DEFAULT_ESTADO_CIVIL, DEFAULT_GENERO, FALLBACK_CLAVE_EMPRESA, DEFAULT_REGIMEN_CONYUGAL, PERSONAS_FIGURA_FISICA, DEFAULT_GRUPO, "", 1, 0, false, false, $xFil->getEntero($xTmp->TELEFONO), $xFil->cleanMail($xFil->getV($xTmp->MAIL)));
            if ($ready == true) {
                $xAct = new cPersonaActividadEconomica();
                //$clave_de_actividad, $ingreso, $antiguedad = DEFAULT_TIEMPO, $nombrecomercial = "",