Ext.onReady(inicializar); function inicializar() { new Ext.Panel ( { renderTo:'panelInicial3', layout:'absolute', width:700, border:false, height:450, defaultType: 'label', items: [ { x:10, y:10, cls:'letraSubTituloSeccion', html:'Ingresa el número de registro patronal del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Registro Patronal:' }, { x:330, y:55, xtype:'textfield', width:300, id:'txtNumeroPatronal', cls:'SIUGJ_Control', }, { x:10, y:110, cls:'letraSubTituloSeccion', html:'Ingresa con e.firma (FIEL) del centro de trabajo:' }, { x:10, y:160, cls:'SIUGJ_Etiqueta', html:'Archivo de certificado digital (*.cer):' }, { x:330, y:160, html:'' }, { x:10, y:200, cls:'SIUGJ_Etiqueta', html:'Archivo de llave privada (*.key):' }, { x:330, y:200, html:'' }, { x:10, y:240, cls:'SIUGJ_Etiqueta', html:'Contraseña de llave privada:' }, { x:330, y:235, width:250, cls:'SIUGJ_Control', id:'txtPassword', xtype:'textfield', inputType:'password' }, { x:200, y:290, cls:'SIUGJ_Etiqueta', html:'' }, { x:300, y:350, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel(); } } ] } ) new Ext.Panel ( { renderTo:'panelInicial2', layout:'absolute', width:700, border:false, height:60, defaultType: 'label', items: [ { x:130, y:10, cls:'letraSubTituloSeccion', html:'Deberá realizar su afiliación en sucursal' } /*{ x:10, y:10, cls:'letraSubTituloSeccion', html:'Ingresa con e.firma (FIEL) del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Archivo de certificado digital (*.cer):' }, { x:330, y:60, html:'' }, { x:10, y:100, cls:'SIUGJ_Etiqueta', html:'Archivo de llave privada (*.key):' }, { x:330, y:100, html:'' }, { x:10, y:140, cls:'SIUGJ_Etiqueta', html:'Contraseña de llave privada:' }, { x:330, y:135, width:250, cls:'SIUGJ_Control', id:'txtPassword2', xtype:'textfield', inputType:'password' }, { x:200, y:190, cls:'SIUGJ_Etiqueta', html:'' }, { x:300, y:250, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel2(); } } */ ] } ) new Ext.Panel ( { renderTo:'panelInicial1', layout:'absolute', width:700, border:false, height:220, defaultType: 'label', items: [ { x:10, y:10, cls:'letraTituloSeccion', html:'Ingresa el número de registro patronal del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Registro Patronal:' }, { x:330, y:55, xtype:'textfield', width:300, id:'txtNumeroPatronal1', cls:'SIUGJ_Control', }, { x:300, y:120, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel(); } } ] } ) } function opcionSel(radio) { var arrDatos=radio.id.split('_'); oE('div_1'); oE('div_2'); oE('div_3'); mE('div_'+arrDatos[1]); switch(arrDatos[1]) { case '1': gEx('txtNumeroPatronal1').focus(); break; case '2': gEx('txtPassword2').focus(); break; case '3': gEx('txtNumeroPatronal').focus(); break; } } function enviarDatosFiel() { gE('divMsgErr').innerHTML=''; if(gEx('txtNumeroPatronal').getValue()=='') { function resp1() { gEx('txtNumeroPatronal').focus(); } msgBox('Debe ingresar el número de registro patronal',resp1); return; } if(gE('fileCer').value=='') { function resp1Cer() { gE('fileCer').focus(); } msgBox('Debe ingresar el archivo de certificado digital (*.cer)',resp1Cer); return; } if(gE('fileKey').value=='') { function resp2Cer() { gE('fileKey').focus(); } msgBox('Debe ingresar el archivo de llave privada (*.key)',resp2Cer); return; } if(gEx('txtPassword').getValue().trim()=='') { function resp3Cer() { gEx('txtPassword').focus(); } msgBox('Debe ingresar la contraseña de llave privada',resp3Cer); return; } var formData = new FormData(); formData.append('passwd',AES_Encrypt(gEx('txtPassword').getValue())); formData.append('fCer',gE('fileCer').files[0]); formData.append('fKey',gE('fileKey').files[0]); formData.append('noRegistroPatronal',gEx('txtNumeroPatronal').getValue()); formData.append('tipoEmpresa','1'); mostrarMensajeProcesando('Verificando e.Firma, ésta operación puede tardar unos minutos...'); $.ajax ({ url: "../modulosEspeciales_FONACOT/paginasFunciones/procesarDocumentoFiel.php", data: formData, processData: false, contentType: false, type: 'POST', success: function(data) { ocultarMensajeProcesando(); var oResp=eval('['+data+']')[0]; if(oResp.resultado=='1') { if(oResp.error=='1') { function resp4() { gEx('txtPassword').focus(); } msgBox('Error: '+oResp.msgErr,resp4); return; } else { if(oResp.error=='100') { function resp40() { gEx('txtPassword').focus(); } msgBox(oResp.msgErr,resp40); return; } gE('fileCer').value=''; gE('fileKey').value=''; gEx('txtPassword').setValue(''); gEx('txtNumeroPatronal').setValue(''); var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.modal=true; obj.openEffect='none'; obj.url='../modulosEspeciales_FONACOT/tblExpedienteSIA.php'; obj.params=[['idSolicitud',oResp.idRegistro]]; abrirVentanaFancySuperior(obj); } } else { msgBox('No se ha podido llevar a cabo la operación debido al siguiente problema:

'+oResp.mensaje); } } }); } function enviarDatosFiel2() { gE('divMsgErr').innerHTML=''; if(gE('fileCer2').value=='') { function resp1Cer() { gE('fileCer2').focus(); } msgBox('Debe ingresar el archivo de certificado digital (*.cer)',resp1Cer); return; } if(gE('fileKey2').value=='') { function resp2Cer() { gE('fileKey2').focus(); } msgBox('Debe ingresar el archivo de llave privada (*.key)',resp2Cer); return; } if(gEx('txtPassword2').getValue().trim()=='') { function resp3Cer() { gEx('txtPassword2').focus(); } msgBox('Debe ingresar la contraseña de llave privada',resp3Cer); return; } var formData = new FormData(); formData.append('passwd',AES_Encrypt(gEx('txtPassword2').getValue())); formData.append('fCer',gE('fileCer2').files[0]); formData.append('fKey',gE('fileKey2').files[0]); formData.append('noRegistroPatronal',''); formData.append('tipoEmpresa','0'); mostrarMensajeProcesando('Verificando e.Firma, ésta operación puede tardar unos minutos...'); $.ajax ({ url: "../modulosEspeciales_FONACOT/paginasFunciones/procesarDocumentoFiel.php", data: formData, processData: false, contentType: false, type: 'POST', success: function(data) { ocultarMensajeProcesando(); var oResp=eval('['+data+']')[0]; if(oResp.resultado=='1') { if(oResp.error=='1') { function resp4() { gEx('txtPassword2').focus(); } msgBox('Error: '+oResp.msgErr,resp4); return; } else { gE('fileCer2').value=''; gE('fileKey2').value=''; gEx('txtPassword2').setValue(''); var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.modal=true; obj.openEffect='none'; obj.url='../modulosEspeciales_FONACOT/tblExpedienteSIA.php'; obj.params=[['idSolicitud',oResp.idRegistro]]; abrirVentanaFancySuperior(obj); } } else { msgBox('No se ha podido llevar a cabo la operación debido al siguiente problema:

'+oResp.mensaje); } } }); }