1 | <!DOCTYPE html> |
---|
2 | <html lang="es"> |
---|
3 | <head> <!--Inicio del head --> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
---|
5 | <meta http-equiv="Content-Style-Type" content="text/css"> |
---|
6 | <meta http-equiv="Content-Script-Type" content="text/javascript"> |
---|
7 | |
---|
8 | <link rel="stylesheet" href="css/jquery.Jcrop.css" type="text/css" /> |
---|
9 | |
---|
10 | <script type="text/javascript" src="js/jquery.min.js"></script> |
---|
11 | <script type="text/javascript" src="js/hwcrypto-legacy.js"></script> |
---|
12 | <script type="text/javascript" src="js/hwcrypto.js"></script> |
---|
13 | <script type="text/javascript" src="js/hex2base.js"></script> |
---|
14 | <script type="text/javascript" src="js/forge.min.js"></script> |
---|
15 | <script type="text/javascript" src="js/ajaxSetup.js"></script> |
---|
16 | <script src="js/jquery.Jcrop.js"></script> |
---|
17 | |
---|
18 | <script type="text/javascript" charset="utf-8"> |
---|
19 | |
---|
20 | var urlActiva = "https://"+window.location.hostname; |
---|
21 | var jcrop_api; |
---|
22 | $(document).ready(function() { |
---|
23 | $.ajaxSetup({ |
---|
24 | error:function(x,e){ |
---|
25 | if(x.status==0){ |
---|
26 | alert('Está fuera de línea!!\n Por favor chequee su conexión.'); |
---|
27 | }else if(x.status==404){ |
---|
28 | alert('La URL solicitada no fue encontrada.'); |
---|
29 | }else if(x.status==500){ |
---|
30 | alert('Error interno de servidor.'); |
---|
31 | }else if(e=='parsererror'){ |
---|
32 | alert('Error.\nSolicitud de interpretación de cadena JSON inválida.'); |
---|
33 | }else if(e=='timeout'){ |
---|
34 | alert('Tiempo de espera alcanzado.'); |
---|
35 | }else { |
---|
36 | alert('Error desconocido.\n'+x.responseText); |
---|
37 | } |
---|
38 | } |
---|
39 | }); |
---|
40 | $("#botonEnvia").click(enviaFormulario); |
---|
41 | $("#botonCertificadoTarjeta").click(obtieneCertificado); |
---|
42 | $("#botonPK12").click(cargaP12); |
---|
43 | $("#botonImagen").click(cargaImagen); |
---|
44 | $("#botonEstadisticas").click(verificaEstadisticas); |
---|
45 | $("#botonSubeVerifica").click(cargaVerifica); |
---|
46 | $("#botonTest").click(ejecutaPrueba); |
---|
47 | $('#tablaImagen').css("display","none"); |
---|
48 | $("input[name=tipoPos]").click(cambioTipoPos) |
---|
49 | $('input[name^="posFijo"]').click(cambiaPosFijo); |
---|
50 | |
---|
51 | descargarArchivo = downQuery; |
---|
52 | }); |
---|
53 | |
---|
54 | function showCoords(c){ |
---|
55 | var alto = parseInt($('#imagenPrevia').attr("height").replace("px","")); |
---|
56 | $("#llx").val(c.x); |
---|
57 | $("#lly").val(((alto-c.y)-c.h)); |
---|
58 | $("#urx").val(c.w); |
---|
59 | $("#ury").val(c.h); |
---|
60 | }; |
---|
61 | |
---|
62 | var descargarArchivo; |
---|
63 | function ejecutaDescarga(){ |
---|
64 | var opciones = new Object(); |
---|
65 | opciones.onCompletado = solicitudCompletada; |
---|
66 | opciones.onSend = antesEnvioSolicitud; |
---|
67 | opciones.onExito = exitoSolicitud; |
---|
68 | opciones.onProgreso = muestraProgreso; |
---|
69 | opciones.tipoResultado="binary"; |
---|
70 | opciones.id="1"; |
---|
71 | descargarArchivo.dArchivo($(this).attr("linkDescarga"),opciones); |
---|
72 | } |
---|
73 | |
---|
74 | function muestraProgreso(evt,xhr){ |
---|
75 | $("#progresoDescarga").html(evt.lengthComputable+"<br>"); |
---|
76 | if (evt.lengthComputable) { |
---|
77 | var percentComplete = evt.loaded / evt.total; |
---|
78 | percentComplete *= 100; |
---|
79 | $("#progresoDescarga").html(percentComplete.toFixed(2).replace(".",",")+" % Descargado"); |
---|
80 | }else{ |
---|
81 | $("#progresoDescarga").html("Progreso solo<br>"); |
---|
82 | } |
---|
83 | } |
---|
84 | function errorSolicitud(xhr, ajaxOptions, errorArrojado) { |
---|
85 | $("#progresoDescarga").append("Error"); |
---|
86 | $("#progresoDescarga").append("<br>"); |
---|
87 | $("#progresoDescarga").append(xhr.responseText); |
---|
88 | $("#progresoDescarga").append("<br>"); |
---|
89 | $("#progresoDescarga").append(errorArrojado); |
---|
90 | $("#progresoDescarga").append("<br>"); |
---|
91 | |
---|
92 | } |
---|
93 | function antesEnvioSolicitud(evt,opciones) { |
---|
94 | console.log("antesEnvioSolicitud") |
---|
95 | console.log(opciones.id); |
---|
96 | $("#progresoDescarga").html("Iniciando descarga"); |
---|
97 | //$("#progresoDescarga").html("antesEnvioSolicitud") |
---|
98 | } |
---|
99 | function solicitudCompletada(evt,state) { |
---|
100 | console.log("solicitudCompletada"); |
---|
101 | console.log(evt.opciones.id) |
---|
102 | $("#progresoDescarga").html(""); |
---|
103 | //$("#progresoDescarga").html("solicitudCompletada"); |
---|
104 | } |
---|
105 | function exitoSolicitud(data, status, xhr) { |
---|
106 | if(data){ |
---|
107 | //$("#progresoDescarga"+"B").append("Objetivo: " + xhr.opciones.url + "<br>"); |
---|
108 | var nombreArchivo = descargarArchivo.obtieneNombre(xhr); |
---|
109 | //$("#progresoDescarga"+"B").append("Archivo: " + nombreArchivo + "<br>"); |
---|
110 | var downloadUrl = URL.createObjectURL(data); |
---|
111 | if(xhr.opciones.id=="1"){ |
---|
112 | $("#progresoDescarga").html("100% Descarga completada"); |
---|
113 | var a = document.createElement("a"); |
---|
114 | a.href = downloadUrl; |
---|
115 | a.download = nombreArchivo; |
---|
116 | document.body.appendChild(a); |
---|
117 | a.click(); |
---|
118 | }/*else{ |
---|
119 | var a = document.createElement("img"); |
---|
120 | a.src = downloadUrl; |
---|
121 | document.body.appendChild(a); |
---|
122 | }*/ |
---|
123 | } |
---|
124 | $("#progresoDescarga"+"B").append("exitoSolicitud 2<br>"); |
---|
125 | } |
---|
126 | |
---|
127 | var certificadoActivo; |
---|
128 | var almacenDigitalActivo=false; |
---|
129 | function obtieneCertificado(){ |
---|
130 | window.hwcrypto.getCertificate({lang: "en"}).then(function(response) { |
---|
131 | var cert = response; |
---|
132 | certificadoActivo = cert; |
---|
133 | console.log("Using certificate:\n" + hexToPem(response.hex)); |
---|
134 | console.log("Using certificate(HEX):\n" + response.hex); |
---|
135 | if(totalArchivos.length>0){ |
---|
136 | $("button[name^='botonFirma-'").attr("disabled",false); |
---|
137 | } |
---|
138 | }); |
---|
139 | } |
---|
140 | |
---|
141 | var fileIdActivo; |
---|
142 | function enviaFormulario(){ |
---|
143 | for(var n =0;n<$("#file-sign")[0].files.length;n++){ |
---|
144 | var formData = new FormData(); |
---|
145 | formData.append("upload", $("#file-sign")[0].files[n]); |
---|
146 | //alert(urlActiva+"/Murachi/0.4/archivos/"); |
---|
147 | $.ajax({ |
---|
148 | url: urlActiva+"/Murachi/0.4/archivos/", |
---|
149 | type: "post", |
---|
150 | dataType: "json", |
---|
151 | data: formData, |
---|
152 | xhr: function() { |
---|
153 | var myXhr = $.ajaxSettings.xhr(); |
---|
154 | if(myXhr.upload){ |
---|
155 | myXhr.upload.addEventListener('progress',progressUpload, false); |
---|
156 | } |
---|
157 | return myXhr; |
---|
158 | }, |
---|
159 | cache: false, |
---|
160 | contentType: false, |
---|
161 | processData: false, |
---|
162 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
163 | success: function(response) { |
---|
164 | $("#respuesta").html(""); |
---|
165 | for(var key in response) { |
---|
166 | $("#respuesta").html($("#respuesta").html()+"<br>"+response[key]) |
---|
167 | console.log(key); |
---|
168 | } |
---|
169 | $("input[name=tipoPos]").attr("checked",false); |
---|
170 | incluyeArchivo(response); |
---|
171 | console.log(response) |
---|
172 | if(jcrop_api != null){ |
---|
173 | jcrop_api.destroy(); |
---|
174 | } |
---|
175 | $('#tablaImagen').css("display","none"); |
---|
176 | }, |
---|
177 | error: function(jqXHR, textStatus, errorThrown){ |
---|
178 | console.log('error: ' + textStatus); |
---|
179 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
180 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
181 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
182 | } |
---|
183 | }) |
---|
184 | } |
---|
185 | } |
---|
186 | function progressUpload(e){ |
---|
187 | if(e.lengthComputable){ |
---|
188 | var max = e.total; |
---|
189 | var current = e.loaded; |
---|
190 | |
---|
191 | var Percentage = (current * 100)/max; |
---|
192 | console.log(Percentage); |
---|
193 | |
---|
194 | |
---|
195 | if(Percentage >= 100) |
---|
196 | { |
---|
197 | // process completed |
---|
198 | $("#progresoCarga").html("100 % (Carga completada)"); |
---|
199 | }else{ |
---|
200 | $("#progresoCarga").html((Percentage.toFixed(2).replace(".",","))+" %"); |
---|
201 | |
---|
202 | } |
---|
203 | } |
---|
204 | } |
---|
205 | |
---|
206 | function buscaPos(cod){ |
---|
207 | var obj = new Array(); |
---|
208 | var alto = parseInt($('#imagenPrevia').attr("height").replace("px","")); |
---|
209 | var ancho = parseInt($('#imagenPrevia').attr("width").replace("px","")); |
---|
210 | var anchoFirma = parseInt($('#urx').val()); |
---|
211 | var altoFirma = parseInt($('#ury').val()); |
---|
212 | obj["alto"] = altoFirma; |
---|
213 | obj["ancho"] = anchoFirma; |
---|
214 | if(cod==1){ |
---|
215 | obj["x"] = 0; |
---|
216 | obj["y"] = (alto-altoFirma); |
---|
217 | }else if(cod==2){ |
---|
218 | obj["y"] = (alto-altoFirma); |
---|
219 | obj["x"] = ((ancho/2)-(anchoFirma/2)); |
---|
220 | }else if(cod==3){ |
---|
221 | obj["y"] = (alto-altoFirma); |
---|
222 | obj["x"] = ((ancho)-anchoFirma); |
---|
223 | }else if(cod==4){ |
---|
224 | obj["x"] = 0; |
---|
225 | obj["y"] = ((alto/2)-(altoFirma/2)); |
---|
226 | }else if(cod==5){ |
---|
227 | obj["y"] = ((alto/2)-(altoFirma/2)); |
---|
228 | obj["x"] = ((ancho/2)-(anchoFirma/2)); |
---|
229 | }else if(cod==6){ |
---|
230 | obj["y"] = ((alto/2)-(altoFirma/2)); |
---|
231 | obj["x"] = (ancho-anchoFirma); |
---|
232 | }else if(cod==7){ |
---|
233 | obj["x"] = 0; |
---|
234 | obj["y"] = 0; |
---|
235 | }else if(cod==8){ |
---|
236 | obj["y"] = 0; |
---|
237 | obj["x"] = ((ancho/2)-(anchoFirma/2)); |
---|
238 | }else if(cod==9){ |
---|
239 | obj["y"] = 0; |
---|
240 | obj["x"] = (ancho-anchoFirma); |
---|
241 | } |
---|
242 | return obj; |
---|
243 | } |
---|
244 | function buscaPos2(cod){ |
---|
245 | var obj = new Array(); |
---|
246 | var alto = parseInt($('#imagenPrevia').attr("height").replace("px","")); |
---|
247 | var ancho = parseInt($('#imagenPrevia').attr("width").replace("px","")); |
---|
248 | var anchoFirma = parseInt($('#urx').val()); |
---|
249 | var altoFirma = parseInt($('#ury').val()); |
---|
250 | obj["alto"] = altoFirma; |
---|
251 | obj["ancho"] = anchoFirma; |
---|
252 | if(cod==1){ |
---|
253 | obj["x"] = 0; |
---|
254 | obj["y"] = 0; |
---|
255 | }else if(cod==2){ |
---|
256 | obj["y"] = 0; |
---|
257 | //obj["x"] = ((ancho/2)-(anchoFirma/2)); |
---|
258 | obj["x"] = (ancho/2)-(anchoFirma/2); |
---|
259 | }else if(cod==3){ |
---|
260 | obj["y"] = 0; |
---|
261 | obj["x"] = ancho-anchoFirma; |
---|
262 | }else if(cod==4){ |
---|
263 | obj["x"] = 0; |
---|
264 | obj["y"] = (alto/2)-(altoFirma/2); |
---|
265 | }else if(cod==5){ |
---|
266 | obj["y"] = (alto/2)-(altoFirma/2); |
---|
267 | obj["x"] = (ancho/2)-(anchoFirma/2); |
---|
268 | }else if(cod==6){ |
---|
269 | obj["y"] = (alto/2)-(altoFirma/2); |
---|
270 | obj["x"] = ancho-anchoFirma; |
---|
271 | }else if(cod==7){ |
---|
272 | obj["x"] = 0; |
---|
273 | obj["y"] = alto-altoFirma; |
---|
274 | }else if(cod==8){ |
---|
275 | obj["y"] = alto-altoFirma; |
---|
276 | obj["x"] = (ancho/2)-(anchoFirma/2); |
---|
277 | }else if(cod==9){ |
---|
278 | obj["y"] = alto-altoFirma; |
---|
279 | obj["x"] = ancho-anchoFirma; |
---|
280 | } |
---|
281 | return obj; |
---|
282 | } |
---|
283 | var predeterminado = false; |
---|
284 | function cambiaPosFijo(){ |
---|
285 | predeterminado = true; |
---|
286 | var nuevaPos = buscaPos2($("input[name=posFijo]:checked").val()); |
---|
287 | //alert(nuevaPos["x"]+"|"+nuevaPos["y"]+"|"+nuevaPos["ancho"]+"|"+nuevaPos["alto"]); |
---|
288 | jcrop_api.setSelect([nuevaPos["x"],nuevaPos["y"],nuevaPos["x"]+nuevaPos["ancho"],nuevaPos["y"]+nuevaPos["alto"]]); |
---|
289 | } |
---|
290 | function cambioTipoPos(){ |
---|
291 | |
---|
292 | if($("input[name=idArchivo]:checked").val()!=undefined){ |
---|
293 | if(jcrop_api != null){ |
---|
294 | jcrop_api.destroy(); |
---|
295 | } |
---|
296 | if($(this).val()==1){ |
---|
297 | $('#tablaImagen').css("display","none"); |
---|
298 | dimensionesActuales=null; |
---|
299 | }else{ |
---|
300 | var objArchivo = $("input[name=idArchivo]:checked"); |
---|
301 | dimensionesActuales = new Array(); |
---|
302 | dimensionesActuales["alto"] = objArchivo.attr("alto"); |
---|
303 | dimensionesActuales["ancho"] = objArchivo.attr("ancho"); |
---|
304 | dimensionesActuales["paginas"] = objArchivo.attr("paginas"); |
---|
305 | if(dimensionesActuales["alto"]!=undefined){ |
---|
306 | $('#imagenPrevia').attr("height","0"); |
---|
307 | $('#imagenPrevia').attr("width","0"); |
---|
308 | $('#tablaImagen').css("display","block"); |
---|
309 | $('#tablaImagen').attr("width",dimensionesActuales["ancho"]+"px"); |
---|
310 | $('#tablaImagen').attr("style","border:1px solid #000000"); |
---|
311 | $('#imagenPrevia').attr("width",dimensionesActuales["ancho"]+"px"); |
---|
312 | $('#imagenPrevia').attr("height",dimensionesActuales["alto"]+"px"); |
---|
313 | var nuevaPos = buscaPos2(1); |
---|
314 | $("input:radio[name=posFijo]").attr("checked",false); |
---|
315 | $('#imagenPrevia').Jcrop({ |
---|
316 | onChange: showCoords, |
---|
317 | bgColor: 'black', |
---|
318 | bgOpacity: .4, |
---|
319 | setSelect: [nuevaPos["x"],nuevaPos["y"],nuevaPos["x"]+nuevaPos["ancho"],nuevaPos["y"]+nuevaPos["alto"]] |
---|
320 | },function(){ |
---|
321 | jcrop_api = this; |
---|
322 | }) |
---|
323 | } |
---|
324 | |
---|
325 | } |
---|
326 | }else{ |
---|
327 | alert("Debe seleccionar primero un archivo"); |
---|
328 | } |
---|
329 | } |
---|
330 | var dimensionesActuales; |
---|
331 | function cambiaArchivo(){ |
---|
332 | if(jcrop_api != null){ |
---|
333 | jcrop_api.destroy(); |
---|
334 | } |
---|
335 | $('#tablaImagen').css("display","none"); |
---|
336 | |
---|
337 | } |
---|
338 | function reemplazaCadena(busca,cambia,texto){ |
---|
339 | while(texto.indexOf(busca)>-1){ |
---|
340 | texto = texto.replace(busca,cambia); |
---|
341 | } |
---|
342 | return texto; |
---|
343 | } |
---|
344 | |
---|
345 | var totalArchivos = new Array(); |
---|
346 | function incluyeArchivo(response){ |
---|
347 | var idArchivo = response["fileId"]; |
---|
348 | totalArchivos.push(idArchivo); |
---|
349 | var archivoNuevo = '<tr id="archivo-'+idArchivo+'">'+$("#archivoPrototipo").html()+'</tr>'; |
---|
350 | archivoNuevo = reemplazaCadena('/-idArchivo-/',idArchivo,archivoNuevo); |
---|
351 | archivoNuevo = reemplazaCadena('/-ancho-/',response["ancho"],archivoNuevo); |
---|
352 | archivoNuevo = reemplazaCadena('/-alto-/',response["alto"],archivoNuevo); |
---|
353 | archivoNuevo = reemplazaCadena('/-paginas-/',response["paginas"],archivoNuevo); |
---|
354 | archivoNuevo = reemplazaCadena('/-valorArchivo-/',idArchivo,archivoNuevo); |
---|
355 | archivoNuevo = reemplazaCadena('/-valorRadioArchivo-/',idArchivo,archivoNuevo); |
---|
356 | //archivoNuevo = reemplazaCadena('"montoUnitarioArticulo-"','"montoUnitarioArticulo-'+indice+'"',archivoNuevo); |
---|
357 | //archivoNuevo = reemplazaCadena('"montoTotalArticulo-"','"montoTotalArticulo-'+indice+'"',archivoNuevo); |
---|
358 | //archivoNuevo = reemplazaCadena('"cantidadArticulo-n-oferta"','"cantidadArticulo-'+indice+'-oferta"',archivoNuevo); |
---|
359 | //archivoNuevo = reemplazaCadena('"montoUnitarioArticulo-n-oferta"','"montoUnitarioArticulo-'+indice+'-oferta"',archivoNuevo); |
---|
360 | //archivoNuevo = reemplazaCadena('"montoTotalArticulo-n-oferta"','"montoTotalArticulo-'+indice+'-oferta"',archivoNuevo); |
---|
361 | //archivoNuevo = reemplazaCadena('"botonEliminaArticulo-"','"botonEliminaArticulo-'+indice+'"',archivoNuevo); |
---|
362 | //archivoNuevo = reemplazaCadena('"marcaArticulo-"','"marcaArticulo-'+indice+'"',archivoNuevo); |
---|
363 | //archivoNuevo = reemplazaCadena('"exoneraArticulo-"','"exoneraArticulo-'+indice+'"',archivoNuevo); |
---|
364 | |
---|
365 | //$("#tablaArticulos").append(archivoNuevo); |
---|
366 | $(archivoNuevo).insertBefore("#totalArchivos"); |
---|
367 | $("input[name=idArchivo]").unbind('click'); |
---|
368 | $("input[name=idArchivo]").click(cambiaArchivo); |
---|
369 | $("#botonFirma-"+idArchivo).click(procesaIndividual); |
---|
370 | $("#botonDescarga-"+idArchivo).click(ejecutaDescarga); |
---|
371 | var activo = false; |
---|
372 | if(!certificadoActivo && !almacenDigitalActivo){ |
---|
373 | activo = true; |
---|
374 | } |
---|
375 | $("#botonFirma-"+idArchivo).attr("disabled",activo); |
---|
376 | $("#botonDescarga-"+idArchivo).attr("disabled",true); |
---|
377 | $("#sinArchivos").css("display","none"); |
---|
378 | $("#archivo-"+idArchivo).css("display","block"); |
---|
379 | $("#cantArchivos").html(totalArchivos.length+" Archivos por firma") |
---|
380 | } |
---|
381 | var almacenId = ""; |
---|
382 | function cargaP12(){ |
---|
383 | if($("#p12")[0].files.length>0){ |
---|
384 | var formData = new FormData(); |
---|
385 | formData.append("upload", $("#p12")[0].files[0]); |
---|
386 | formData.append("clave", $("#clavePCKS12").val()); |
---|
387 | $.ajax({ |
---|
388 | url: urlActiva+"/Murachi/0.4/archivos/p12", |
---|
389 | type: "post", |
---|
390 | dataType: "json", |
---|
391 | data: formData, |
---|
392 | xhr: function() { |
---|
393 | var myXhr = $.ajaxSettings.xhr(); |
---|
394 | if(myXhr.upload){ |
---|
395 | myXhr.upload.addEventListener('progress',progressUpload, false); |
---|
396 | } |
---|
397 | return myXhr; |
---|
398 | }, |
---|
399 | cache: false, |
---|
400 | contentType: false, |
---|
401 | processData: false, |
---|
402 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
403 | success: function(response) { |
---|
404 | $("#respuesta").html(""); |
---|
405 | for(var key in response) { |
---|
406 | $("#respuesta").html($("#respuesta").html()+"<br>"+response[key]) |
---|
407 | console.log(key); |
---|
408 | } |
---|
409 | if(response["error"]==""){ |
---|
410 | almacenDigitalActivo = true; |
---|
411 | almacenId = response["fileId"]; |
---|
412 | $("#mensajeP12").html("Archivo almacen digital PCKS12 cargado<br>Se firmará a nombre de "+response["propietario"]) |
---|
413 | if(totalArchivos.length>0){ |
---|
414 | $("button[name^='botonFirma-'").attr("disabled",false); |
---|
415 | } |
---|
416 | }else{ |
---|
417 | $("#mensajeP12").html("Se produjo un error al cargar el almacen digital PCKS12") |
---|
418 | } |
---|
419 | console.log(response) |
---|
420 | |
---|
421 | }, |
---|
422 | error: function(jqXHR, textStatus, errorThrown){ |
---|
423 | console.log('error: ' + textStatus); |
---|
424 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
425 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
426 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
427 | } |
---|
428 | }) |
---|
429 | }else{ |
---|
430 | alert("Debe seleccionar un almacén digital de firma primero") |
---|
431 | } |
---|
432 | } |
---|
433 | var imagenActiva = false; |
---|
434 | var imagenId = ""; |
---|
435 | function cargaImagen(){ |
---|
436 | if($("#imagen")[0].files.length>0){ |
---|
437 | var formData = new FormData(); |
---|
438 | formData.append("upload", $("#imagen")[0].files[0]); |
---|
439 | $.ajax({ |
---|
440 | url: urlActiva+"/Murachi/0.4/archivos/imagenAdjunta", |
---|
441 | type: "post", |
---|
442 | dataType: "json", |
---|
443 | data: formData, |
---|
444 | xhr: function() { |
---|
445 | var myXhr = $.ajaxSettings.xhr(); |
---|
446 | if(myXhr.upload){ |
---|
447 | myXhr.upload.addEventListener('progress',progressUpload, false); |
---|
448 | } |
---|
449 | return myXhr; |
---|
450 | }, |
---|
451 | cache: false, |
---|
452 | contentType: false, |
---|
453 | processData: false, |
---|
454 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
455 | success: function(response) { |
---|
456 | $("#respuesta").html(""); |
---|
457 | for(var key in response) { |
---|
458 | $("#respuesta").html($("#respuesta").html()+"<br>"+response[key]) |
---|
459 | console.log(key); |
---|
460 | } |
---|
461 | imagenActiva = true; |
---|
462 | imagenId = response["fileId"]; |
---|
463 | $("#mensajeImagen").html("Archivo imagen cargado") |
---|
464 | console.log(response) |
---|
465 | |
---|
466 | }, |
---|
467 | error: function(jqXHR, textStatus, errorThrown){ |
---|
468 | console.log('error: ' + textStatus); |
---|
469 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
470 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
471 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
472 | } |
---|
473 | }) |
---|
474 | }else{ |
---|
475 | alert("Debe seleccionar un archivo digital primero") |
---|
476 | } |
---|
477 | } |
---|
478 | |
---|
479 | function cargaVerifica(){ |
---|
480 | if($("#archivoVerifica")[0].files.length>0){ |
---|
481 | var formData = new FormData(); |
---|
482 | formData.append("upload", $("#archivoVerifica")[0].files[0]); |
---|
483 | $.ajax({ |
---|
484 | url: urlActiva+"/Murachi/0.4/archivos/firmados", |
---|
485 | type: "post", |
---|
486 | dataType: "json", |
---|
487 | data: formData, |
---|
488 | xhr: function() { |
---|
489 | var myXhr = $.ajaxSettings.xhr(); |
---|
490 | if(myXhr.upload){ |
---|
491 | myXhr.upload.addEventListener('progress',progressVerifica, false); |
---|
492 | } |
---|
493 | return myXhr; |
---|
494 | }, |
---|
495 | cache: false, |
---|
496 | contentType: false, |
---|
497 | processData: false, |
---|
498 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
499 | success: function(response) { |
---|
500 | $("#mensajeVerifica").html("Archivo subido correctamente"); |
---|
501 | for(var key in response) { |
---|
502 | //$("#mensajeVerifica").html($("#mensajeVerifica").html()+"<br>"+response[key]) |
---|
503 | console.log(key); |
---|
504 | } |
---|
505 | console.log(response) |
---|
506 | $("#mensajeVerifica").html($("#mensajeVerifica").html()+"<br>Cantidad de firmas en el documento: "+response["numberOfSignatures"]); |
---|
507 | if(response["numberOfSignatures"]>0){ |
---|
508 | $("#mensajeVerifica").html($("#mensajeVerifica").html()+"<br>Firmantes del documento: "); |
---|
509 | |
---|
510 | for(var n=0;n<response["signatures"].length;n++){ |
---|
511 | var datosFirmante = new Array(); |
---|
512 | datosFirmante.push("Nombre firmante: "+response["signatures"][n]["nameOfTheSigner"]); |
---|
513 | datosFirmante.push("Fecha de la firma: "+response["signatures"][n]["signedOn"]); |
---|
514 | var validez = "No"; |
---|
515 | if(response["signatures"][n]["signerCertificateStillValid"]){ |
---|
516 | validez = "Si"; |
---|
517 | } |
---|
518 | datosFirmante.push("Certificado válido: "+validez); |
---|
519 | //datosFirmante.push("Fecha límite de la validez del certificado: "+response["signatures"][n]["signerCertificateValidTo"]); |
---|
520 | //datosFirmante.push("Nombre: "+response["signatures"][n][""]); |
---|
521 | $("#mensajeVerifica").html($("#mensajeVerifica").html()+"<blockquote>"+datosFirmante.join("<br>")+"</blockquote>"); |
---|
522 | } |
---|
523 | } |
---|
524 | |
---|
525 | }, |
---|
526 | error: function(jqXHR, textStatus, errorThrown){ |
---|
527 | console.log('error: ' + textStatus); |
---|
528 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
529 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
530 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
531 | archivoVerificarId = null; |
---|
532 | } |
---|
533 | }) |
---|
534 | }else{ |
---|
535 | alert("Debe seleccionar un archivo para verificar primero") |
---|
536 | } |
---|
537 | } |
---|
538 | |
---|
539 | |
---|
540 | function progressVerifica(e){ |
---|
541 | if(e.lengthComputable){ |
---|
542 | var max = e.total; |
---|
543 | var current = e.loaded; |
---|
544 | |
---|
545 | var Percentage = (current * 100)/max; |
---|
546 | console.log(Percentage); |
---|
547 | |
---|
548 | |
---|
549 | if(Percentage >= 100) |
---|
550 | { |
---|
551 | // process completed |
---|
552 | $("#progresoVerifica").html("100 % (Carga completada)"); |
---|
553 | }else{ |
---|
554 | $("#progresoVerifica").html((Percentage.toFixed(2).replace(".",","))+" %"); |
---|
555 | |
---|
556 | } |
---|
557 | } |
---|
558 | } |
---|
559 | |
---|
560 | function verificaEstadisticas(){ |
---|
561 | $.ajax({ |
---|
562 | url: urlActiva+"/Murachi/0.4/archivos/estadisticas", |
---|
563 | type: "get", |
---|
564 | dataType: "json", |
---|
565 | xhr: function() { |
---|
566 | var myXhr = $.ajaxSettings.xhr(); |
---|
567 | if(myXhr.upload){ |
---|
568 | myXhr.upload.addEventListener('progress',progressUpload, false); |
---|
569 | } |
---|
570 | return myXhr; |
---|
571 | }, |
---|
572 | cache: false, |
---|
573 | contentType: false, |
---|
574 | processData: false, |
---|
575 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
576 | success: function(response) { |
---|
577 | $("#respuesta").html(""); |
---|
578 | for(var key in response) { |
---|
579 | $("#respuesta").html($("#respuesta").html()+"<br>"+response[key]) |
---|
580 | console.log(key); |
---|
581 | } |
---|
582 | console.log(response) |
---|
583 | |
---|
584 | }, |
---|
585 | error: function(jqXHR, textStatus, errorThrown){ |
---|
586 | console.log('error: ' + textStatus); |
---|
587 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
588 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
589 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
590 | } |
---|
591 | }) |
---|
592 | } |
---|
593 | |
---|
594 | function ejecutaPrueba(){ |
---|
595 | $.ajax({ |
---|
596 | url: urlActiva+"/Murachi/0.4/archivos/verificadirectorio", |
---|
597 | type: "get", |
---|
598 | dataType: "json", |
---|
599 | xhr: function() { |
---|
600 | var myXhr = $.ajaxSettings.xhr(); |
---|
601 | if(myXhr.upload){ |
---|
602 | myXhr.upload.addEventListener('progress',progressUpload, false); |
---|
603 | } |
---|
604 | return myXhr; |
---|
605 | }, |
---|
606 | cache: false, |
---|
607 | contentType: false, |
---|
608 | processData: false, |
---|
609 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
610 | success: function(response) { |
---|
611 | $("#mensajeTest").html("Resultado obtenido"); |
---|
612 | for(var key in response) { |
---|
613 | $("#mensajeTest").html($("#mensajeTest").html()+"<br>"+response[key]) |
---|
614 | console.log(key); |
---|
615 | } |
---|
616 | console.log(response) |
---|
617 | |
---|
618 | }, |
---|
619 | error: function(jqXHR, textStatus, errorThrown){ |
---|
620 | console.log('error: ' + textStatus); |
---|
621 | //var responseText = jQuery.parseJSON(jqXHR.responseText); |
---|
622 | console.log('ajax error function: ' + jqXHR.responseText); |
---|
623 | $("#respuesta").html("error function: " + jqXHR.responseText); |
---|
624 | } |
---|
625 | }) |
---|
626 | } |
---|
627 | var hashtype = "SHA-256"; |
---|
628 | var lang = "eng"; |
---|
629 | function procesaIndividual(){ |
---|
630 | var cert = certificadoActivo; |
---|
631 | var continua = true; |
---|
632 | var mensajeContinua = ""; |
---|
633 | var archivoEstimado = $(this).attr("id").replace("botonFirma-",""); |
---|
634 | if($("input[name=fimaTarjeta]:checked").val()== undefined){ |
---|
635 | if($("input[name=idArchivo]:checked").val()== archivoEstimado){ |
---|
636 | if(!cert && !almacenDigitalActivo){ |
---|
637 | alert("Debe seleccionar el certificado para firmar"); |
---|
638 | }else{ |
---|
639 | var firmaVisible = false; |
---|
640 | if($("input[name=firmaVisible]:checked").val()==1){ |
---|
641 | firmaVisible = true; |
---|
642 | } |
---|
643 | if($("input[name=idArchivo]:checked").val()==undefined){ |
---|
644 | alert("Debe seleccionar primero un archivo"); |
---|
645 | }else{ |
---|
646 | |
---|
647 | if($("input[name=tipoPos]:checked").val()!=3){ |
---|
648 | $("#llx").val(0); |
---|
649 | $("#lly").val(0); |
---|
650 | if($("#urx").val()==0 || $("#urx").val() < 0 || $("#urx").val() == ""){ |
---|
651 | $("#urx").val(100); |
---|
652 | } |
---|
653 | if($("#ury").val()==0 || $("#ury").val() < 0 || $("#ury").val() == ""){ |
---|
654 | $("#ury").val(50); |
---|
655 | } |
---|
656 | |
---|
657 | }else if($("input[name=tipoPos]:checked").val()==3){ |
---|
658 | var api = jcrop_api; |
---|
659 | //if(!predeterminado){ |
---|
660 | var alto = parseInt($('#imagenPrevia').attr("height").replace("px","")); |
---|
661 | $("#llx").val(api.tellSelect().x); |
---|
662 | $("#lly").val(((alto-api.tellSelect().y)-api.tellSelect().h)); |
---|
663 | $("#urx").val(api.tellSelect().w); |
---|
664 | $("#ury").val(api.tellSelect().h); |
---|
665 | /*}else{ |
---|
666 | var pos = buscaPos($("input[name=posFijo]:checked").val()); |
---|
667 | $("#llx").val(pos["x"]); |
---|
668 | $("#lly").val(pos["y"]); |
---|
669 | $("#urx").val(pos["ancho"]); |
---|
670 | $("#ury").val(pos["alto"]); |
---|
671 | }*/ |
---|
672 | |
---|
673 | } |
---|
674 | if(!cert){ |
---|
675 | var certificado = ""; |
---|
676 | }else{ |
---|
677 | certificado = cert.hex; |
---|
678 | } |
---|
679 | var muestraImagen = false; |
---|
680 | if($("input[name=muestraImagen]:checked").val()==1){ |
---|
681 | muestraImagen = true; |
---|
682 | } |
---|
683 | var muestraImagenSola = false; |
---|
684 | if($("input[name=muestraImagenSola]:checked").val()==1){ |
---|
685 | muestraImagenSola = true; |
---|
686 | } |
---|
687 | var ancho = 100; |
---|
688 | if(!isNaN(parseInt($("#urx").val()))){ |
---|
689 | ancho = parseInt($("#urx").val()); |
---|
690 | } |
---|
691 | var alto = 100; |
---|
692 | if(!isNaN(parseInt($("#ury").val()))){ |
---|
693 | alto = parseInt($("#ury").val()); |
---|
694 | } |
---|
695 | var posX = 100; |
---|
696 | if(!isNaN(parseInt($("#llx").val()))){ |
---|
697 | posX = parseInt($("#llx").val()); |
---|
698 | } |
---|
699 | var posY = 100; |
---|
700 | if(!isNaN(parseInt($("#lly").val()))){ |
---|
701 | posY = parseInt($("#lly").val()); |
---|
702 | } |
---|
703 | var urlFirma = urlActiva+"/Murachi/0.4/archivos/pdfs"; |
---|
704 | var firmaPK12 = false; |
---|
705 | var clavePCKS12 =""; |
---|
706 | var imagenAdjunta = ""; |
---|
707 | var tsa = false; |
---|
708 | if($("input[name=tsa]:checked").val()==1){ |
---|
709 | tsa = true; |
---|
710 | } |
---|
711 | if(imagenId!=null){ |
---|
712 | imagenAdjunta = imagenId; |
---|
713 | } |
---|
714 | if($("input[name=firmaTarjeta]:checked").val()==2){ |
---|
715 | if($("#clavePCKS12").val()!=""){ |
---|
716 | urlFirma = urlActiva+"/Murachi/0.4/archivos/pdfsPk"; |
---|
717 | firmaPK12 = true; |
---|
718 | clavePCKS12 = $("#clavePCKS12").val(); |
---|
719 | }else{ |
---|
720 | continua = false; |
---|
721 | mensajeContinua = "Debe ingresar la clave del almacén digital para poder continuar" |
---|
722 | } |
---|
723 | } |
---|
724 | if(continua){ |
---|
725 | var fileId = $("input[name=idArchivo]:checked").val(); |
---|
726 | var parameters = JSON.stringify({ |
---|
727 | "fileId":fileId, |
---|
728 | "certificate":certificado, |
---|
729 | "reason":$("#razon").val(), |
---|
730 | "location":$("#lugar").val(), |
---|
731 | "contact":$("#contacto").val(), |
---|
732 | "rotacion":$("#rotacion").val(), |
---|
733 | "pagina":$("#pagina").val(), |
---|
734 | "pk12":firmaPK12, |
---|
735 | "clavePCKS12":clavePCKS12, |
---|
736 | "almacenPCKS12":almacenId, |
---|
737 | "signatureVisible":firmaVisible, |
---|
738 | "lly":posY, |
---|
739 | "llx":posX, |
---|
740 | "ury":posY+alto, |
---|
741 | "urx":posX+ancho, |
---|
742 | "muestraImagen":muestraImagen, |
---|
743 | "muestraImagenSola":muestraImagenSola, |
---|
744 | "imagen":imagenAdjunta, |
---|
745 | "tsa":tsa |
---|
746 | }); |
---|
747 | if($("input[name=firmaTarjeta]:checked").val()==1){ |
---|
748 | $.ajax({ |
---|
749 | url:urlFirma, |
---|
750 | type: "post", |
---|
751 | dataType: "json", |
---|
752 | data: parameters, |
---|
753 | contentType: "application/json", |
---|
754 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
755 | success: function(data, textStatus, jqXHR){ |
---|
756 | for(var key in data) { |
---|
757 | $("#respuesta").html($("#respuesta").html()+"<br>"+data[key]) |
---|
758 | console.log(key); |
---|
759 | } |
---|
760 | console.log(data) |
---|
761 | hashActual = data['hash']; |
---|
762 | sesionActual = data['sessionId']; |
---|
763 | window.hwcrypto.sign(certificadoActivo, {type: hashtype, hex: hashActual}, {lang: lang}).then(function(signature) { |
---|
764 | var firmaActual = signature; |
---|
765 | console.log(hexToPem(signature.hex)); |
---|
766 | console.log(signature.hex); |
---|
767 | var fileIdAct = $("input[name=idArchivo]:checked").val(); |
---|
768 | |
---|
769 | $.ajax({ |
---|
770 | type: 'POST', |
---|
771 | contentType: 'application/json', |
---|
772 | //url:"https://192.168.12.125:8443/Murachi/0.1/archivos/pdfs/resenas", |
---|
773 | url:urlActiva+"/Murachi/0.4/archivos/pdfs/resenas", |
---|
774 | dataType: 'json', |
---|
775 | data: JSON.stringify({"signature":firmaActual.hex,fileId:fileIdAct,tsa:tsa}), |
---|
776 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
777 | success: function(data, textStatus, jqXHR){ |
---|
778 | for(var key in data) { |
---|
779 | $("#respuesta").html($("#respuesta").html()+"<br>"+data[key]) |
---|
780 | console.log(key); |
---|
781 | var linkToDownload = "<a href=\""+urlActiva+"/Murachi/0.4/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>"; |
---|
782 | $("#respuesta").html($("#respuesta").html()+"<br>"+linkToDownload); |
---|
783 | idFileDescargaActual = data['signedFileId']; |
---|
784 | } |
---|
785 | console.log(data); |
---|
786 | $("#botonDescarga-"+archivoEstimado).attr("linkDescarga",urlActiva+"/Murachi/0.4/archivos/descargas/" + data['signedFileId']); |
---|
787 | $("#botonDescarga-"+archivoEstimado).attr("disabled",false); |
---|
788 | }, function(err) { |
---|
789 | var error; |
---|
790 | if(err == "Error: user_cancel") { |
---|
791 | console.log("getCertificate() failed: El usuario cancelo la operación" ); |
---|
792 | error = "El usuario cancelo la operación"; |
---|
793 | } |
---|
794 | else if(err == "Error: no_certificates") { |
---|
795 | console.log("getCertificate() failed: No hay certificado disponible") ; |
---|
796 | error = "No hay certificado disponible"; |
---|
797 | } |
---|
798 | else if(err == "Error: no_implementation") { |
---|
799 | console.log("getCertificate() failed: No hay soporte para el manejo del certificado"); |
---|
800 | error = "No hay soporte para el manejo del certificado"; |
---|
801 | } |
---|
802 | $("#respuesta").html("getCertificate() failed: " + error); |
---|
803 | } |
---|
804 | }); |
---|
805 | }) |
---|
806 | |
---|
807 | |
---|
808 | |
---|
809 | }, function(err) { |
---|
810 | var error; |
---|
811 | if(err == "Error: user_cancel") { |
---|
812 | console.log("getCertificate() failed: El usuario cancelo la operación" ); |
---|
813 | error = "El usuario cancelo la operación"; |
---|
814 | } |
---|
815 | else if(err == "Error: no_certificates") { |
---|
816 | console.log("getCertificate() failed: No hay certificado disponible") ; |
---|
817 | error = "No hay certificado disponible"; |
---|
818 | } |
---|
819 | else if(err == "Error: no_implementation") { |
---|
820 | console.log("getCertificate() failed: No hay soporte para el manejo del certificado"); |
---|
821 | error = "No hay soporte para el manejo del certificado"; |
---|
822 | } |
---|
823 | $("#respuesta").html("getCertificate() failed: " + error); |
---|
824 | } |
---|
825 | }); |
---|
826 | |
---|
827 | }else{ |
---|
828 | $.ajax({ |
---|
829 | url: urlFirma, |
---|
830 | type: "post", |
---|
831 | dataType: "json", |
---|
832 | data: parameters, |
---|
833 | contentType: "application/json", |
---|
834 | headers: {"Authorization":"Basic YWRtaW46YWRtaW4="}, |
---|
835 | success: function(data, textStatus, jqXHR){ |
---|
836 | for(var key in data) { |
---|
837 | $("#respuesta").html($("#respuesta").html()+"<br>"+data[key]) |
---|
838 | console.log(key); |
---|
839 | } |
---|
840 | console.log(data) |
---|
841 | $("#botonFirma-"+archivoEstimado).attr("disabled",true); |
---|
842 | if(!almacenDigitalActivo){ |
---|
843 | |
---|
844 | }else{ |
---|
845 | var linkDescarga = "<a href=\""+urlActiva+"/Murachi/0.4/archivos/descargas/" + data['fileId'] +"\">descargar archivo firmado</a>"; |
---|
846 | $("#respuesta").html($("#respuesta").html()+"<br>"+linkDescarga); |
---|
847 | idFileDescargaActual = data['fileId']; |
---|
848 | $("#botonDescarga-"+archivoEstimado).attr("linkDescarga",urlActiva+"/Murachi/0.4/archivos/descargas/" + data['fileId']); |
---|
849 | $("#botonDescarga-"+archivoEstimado).attr("disabled",false); |
---|
850 | } |
---|
851 | |
---|
852 | |
---|
853 | }, function(err) { |
---|
854 | var error; |
---|
855 | if(err == "Error: user_cancel") { |
---|
856 | console.log("getCertificate() failed: El usuario cancelo la operación" ); |
---|
857 | error = "El usuario cancelo la operación"; |
---|
858 | } |
---|
859 | else if(err == "Error: no_certificates") { |
---|
860 | console.log("getCertificate() failed: No hay certificado disponible") ; |
---|
861 | error = "No hay certificado disponible"; |
---|
862 | } |
---|
863 | else if(err == "Error: no_implementation") { |
---|
864 | console.log("getCertificate() failed: No hay soporte para el manejo del certificado"); |
---|
865 | error = "No hay soporte para el manejo del certificado"; |
---|
866 | } |
---|
867 | $("#respuesta").html("getCertificate() failed: " + error); |
---|
868 | } |
---|
869 | }); |
---|
870 | } |
---|
871 | }else{ |
---|
872 | alert(mensajeContinua); |
---|
873 | } |
---|
874 | } |
---|
875 | } |
---|
876 | }else{ |
---|
877 | alert("Debe seleccionar este archivo para poder firmarlo") |
---|
878 | } |
---|
879 | }else{ |
---|
880 | alert("Debe seleccionar un método de firma") |
---|
881 | } |
---|
882 | } |
---|
883 | |
---|
884 | </script> |
---|
885 | </head> |
---|
886 | |
---|
887 | |
---|
888 | <body> |
---|
889 | <table width="1200" border="0" cellspacing="2" cellpadding="5" id="tablaArticulos" align="center"> |
---|
890 | <tr> |
---|
891 | <td colspan="4" style="text-align:center;">PRUEBA DE MURACHI</td> |
---|
892 | </tr> |
---|
893 | <tr> |
---|
894 | <td colspan="4" style="text-align:center;"> </td> |
---|
895 | </tr> |
---|
896 | <tr> |
---|
897 | <td colspan="4" style="text-align:center;">SELECCIONE UN ARCHIVO PARA COLOCARLO</td> |
---|
898 | </tr> |
---|
899 | <tr> |
---|
900 | <td colspan="4" style="text-align:left;"><input id="file-sign" type="file" data-min-file-count="1" name="upload" multiple ></td> |
---|
901 | </tr> |
---|
902 | <tr> |
---|
903 | <td colspan="4" style="text-align:left;"><button type="button" class="button" name="botonEnvia" id="botonEnvia">Cargar archivos</button></td> |
---|
904 | </tr> |
---|
905 | <tr> |
---|
906 | <td colspan="4" style="text-align:left;" id="progresoCarga"> </td> |
---|
907 | </tr> |
---|
908 | <tr> |
---|
909 | <td colspan="4" style="text-align:left;" id="progresoDescarga"> </td> |
---|
910 | </tr> |
---|
911 | |
---|
912 | <tr> |
---|
913 | <td colspan="4" style="text-align:center;">ARCHIVOS INCLUIDOS PARA LA FIRMA</td> |
---|
914 | </tr> |
---|
915 | <tr> |
---|
916 | <td colspan="4" id="sinArchivos" align="center" valign="middle" height="40"> |
---|
917 | <strong>No se han ingresado items aún</strong> |
---|
918 | </td> |
---|
919 | </tr> |
---|
920 | <tr id="archivoPrototipo" style="display:none;"> |
---|
921 | <td style="text-align:left;" width="20"><input type="hidden" value="/-valorArchivo-/" id="/-idArchivo-/" name="/-idArchivo-/"/><input type="radio" id="idArchivo" name="idArchivo" value="/-valorRadioArchivo-/" ancho="/-ancho-/" alto="/-alto-/" paginas="/-paginas-/"/></td> |
---|
922 | <td style="text-align:left;" width="480">/-valorArchivo-/</td> |
---|
923 | <td style="text-align:left;" width="150"><button type="button" class="button" name="botonFirma-/-idArchivo-/" id="botonFirma-/-idArchivo-/" disabled>Firma Archivo</button></td> |
---|
924 | <td style="text-align:left;" width="180"><button type="button" class="button" name="botonDescarga-/-idArchivo-/" id="botonDescarga-/-idArchivo-/" disabled>Descarga Archivo</button></td> |
---|
925 | </tr> |
---|
926 | <tr id="totalArchivos"> |
---|
927 | <td colspan="4" style="text-align:center;" id="cantArchivos"> </td> |
---|
928 | </tr> |
---|
929 | <tr> |
---|
930 | <td colspan="4" style="text-align:center;"> |
---|
931 | <table width="1200" border="0" cellspacing="2" cellpadding="5" align="center"> |
---|
932 | <tr> |
---|
933 | <td style="text-align:left;">Razon: <input type="text" value="" id="razon" name="razon"/></td> |
---|
934 | <td style="text-align:left;">Lugar: <input type="text" value="" id="lugar" name="lugar"/></td> |
---|
935 | <td style="text-align:left;">Contacto: <input type="text" value="" id="contacto" name="contacto"/></td> |
---|
936 | </tr> |
---|
937 | </table> |
---|
938 | </td> |
---|
939 | </tr> |
---|
940 | |
---|
941 | <tr> |
---|
942 | <td style="text-align:left;" width="20" colspan="4"> |
---|
943 | <input type="radio" id="firmaTarjeta" name="firmaTarjeta" value="1"/>Se firmará con tarjeta Smartcard |
---|
944 | </td> |
---|
945 | </tr> |
---|
946 | <tr> |
---|
947 | <td colspan="4" style="text-align:center;"> |
---|
948 | FIRMA CON TARJETA |
---|
949 | </td> |
---|
950 | </tr> |
---|
951 | |
---|
952 | <tr> |
---|
953 | <td colspan="4" style="text-align:center;"> |
---|
954 | <button type="button" class="button" name="botonCertificadoTarjeta" id="botonCertificadoTarjeta">Obtiene Certificado desde Tarjeta</button> |
---|
955 | </td> |
---|
956 | </tr> |
---|
957 | <tr> |
---|
958 | <td colspan="4" style="text-align:center;"> |
---|
959 | FIRMA CON CERTIFICADO DIGITAL (.P12) |
---|
960 | </td> |
---|
961 | </tr> |
---|
962 | <tr> |
---|
963 | <td style="text-align:left;" width="20" colspan="4"> |
---|
964 | <input type="radio" id="firmaTarjeta" name="firmaTarjeta" value="2" checked/>Se firmará con almacén digital |
---|
965 | </td> |
---|
966 | </tr> |
---|
967 | <tr> |
---|
968 | <td colspan="4" style="text-align:left;"> |
---|
969 | <input id="p12" type="file" data-min-file-count="1" name="p12"> |
---|
970 | </td> |
---|
971 | </tr> |
---|
972 | <tr> |
---|
973 | <td colspan="4" style="text-align:center;" id="mensajeP12"> |
---|
974 | |
---|
975 | </td> |
---|
976 | </tr> |
---|
977 | <tr> |
---|
978 | <td style="text-align:left;" colspan="2" width="500"> |
---|
979 | CLAVE DEL ALMACEN: <input type="password" value="" id="clavePCKS12" name="clavePCKS12"/> |
---|
980 | </td> |
---|
981 | <td style="text-align:left;" width="150"> </td> |
---|
982 | <td style="text-align:left;" width="150"> </td> |
---|
983 | <td style="text-align:left;" width="150"> </td> |
---|
984 | </tr> |
---|
985 | |
---|
986 | <tr> |
---|
987 | <td colspan="4" style="text-align:center;"> |
---|
988 | <button type="button" class="button" name="botonPK12" id="botonPK12">Carga PKCS 12</button> |
---|
989 | </td> |
---|
990 | </tr> |
---|
991 | |
---|
992 | <tr> |
---|
993 | <td colspan="4" style="text-align:center;"> |
---|
994 | |
---|
995 | </td> |
---|
996 | </tr> |
---|
997 | <tr> |
---|
998 | <td colspan="4" style="text-align:center;"> |
---|
999 | CARACTERÍSTICAS A MOSTRAR |
---|
1000 | </td> |
---|
1001 | </tr> |
---|
1002 | <tr> |
---|
1003 | <td colspan="4" style="text-align:center;"> |
---|
1004 | |
---|
1005 | <table width="900" border="0" cellspacing="2" cellpadding="5" align="center"> |
---|
1006 | <tr> |
---|
1007 | <td style="text-align:left;" colspan="2">COLOCAR SERVICIO DE ESTAMPADO DE TIEMPO</td> |
---|
1008 | </tr> |
---|
1009 | <tr> |
---|
1010 | <td style="text-align:left;" width="450"><input type="radio" id="tsa" name="tsa" value="1"/>Si</td> |
---|
1011 | <td style="text-align:left;" width="450"><input type="radio" id="tsa" name="tsa" value="0" checked/>No</td> |
---|
1012 | </tr> |
---|
1013 | </table> |
---|
1014 | </td> |
---|
1015 | </tr> |
---|
1016 | <tr> |
---|
1017 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1018 | <input type="radio" id="firmaVisible" name="firmaVisible" value="1" checked/>Firma Visible |
---|
1019 | </td> |
---|
1020 | </tr> |
---|
1021 | <tr> |
---|
1022 | <td colspan="4" style="text-align:center;"> |
---|
1023 | |
---|
1024 | <table width="1000" border="0" cellspacing="2" cellpadding="5" align="center"> |
---|
1025 | <tr> |
---|
1026 | <td style="text-align:left;" width="200">Pos X<br><input type="text" value="0" id="llx" name="llx"/></td> |
---|
1027 | <td style="text-align:left;" width="200">Pos Y<br><input type="text" value="0" id="lly" name="lly"/></td> |
---|
1028 | <td style="text-align:left;" width="200">Ancho<br><input type="text" value="100" id="urx" name="urx"/></td> |
---|
1029 | <td style="text-align:left;" width="200">Alto<br><input type="text" value="50" id="ury" name="ury"/></td> |
---|
1030 | <td style="text-align:left;" width="200">Rotación<br><input type="text" value="0" id="rotacion" name="rotacion"/></td> |
---|
1031 | </tr> |
---|
1032 | |
---|
1033 | <tr> |
---|
1034 | <td style="text-align:left;" colspan="5">Página<br><input type="text" value="1" id="pagina" name="pagina"/></td> |
---|
1035 | </tr> |
---|
1036 | </table> |
---|
1037 | </td> |
---|
1038 | </tr> |
---|
1039 | <tr> |
---|
1040 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1041 | <input type="radio" id="firmaVisible" name="firmaVisible" value="2"/>Firma no Visible |
---|
1042 | </td> |
---|
1043 | </tr> |
---|
1044 | |
---|
1045 | |
---|
1046 | <tr> |
---|
1047 | <td colspan="4" style="text-align:center;"> |
---|
1048 | IMÁGEN ADJUNTA AL MENSAJE |
---|
1049 | </td> |
---|
1050 | </tr> |
---|
1051 | |
---|
1052 | <tr> |
---|
1053 | <td colspan="4" style="text-align:left;"><input id="imagen" name="imagen" type="file" data-min-file-count="1" name="min"></td> |
---|
1054 | </tr> |
---|
1055 | <tr> |
---|
1056 | <td colspan="4" style="text-align:center;" id="mensajeImagen"> |
---|
1057 | |
---|
1058 | </td> |
---|
1059 | </tr> |
---|
1060 | <tr> |
---|
1061 | <td colspan="4" style="text-align:center;"> |
---|
1062 | <button type="button" class="button" name="botonImagen" id="botonImagen">Carga Imágen</button> |
---|
1063 | </td> |
---|
1064 | </tr> |
---|
1065 | |
---|
1066 | <tr> |
---|
1067 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1068 | <input type="radio" id="muestraImagen" name="muestraImagen" value="1"/>Muestra Imágen |
---|
1069 | </td> |
---|
1070 | </tr> |
---|
1071 | <tr> |
---|
1072 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1073 | <input type="radio" id="muestraImagen" name="muestraImagen" value="2" checked/>No muestra imágen |
---|
1074 | </td> |
---|
1075 | </tr> |
---|
1076 | |
---|
1077 | <tr> |
---|
1078 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1079 | <input type="radio" id="muestraImagenSola" name="muestraImagenSola" value="1"/>Muestra imagen sola |
---|
1080 | </td> |
---|
1081 | </tr> |
---|
1082 | <tr> |
---|
1083 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1084 | <input type="radio" id="muestraImagenSola" name="muestraImagenSola" value="2" checked/>No muestra imagen sola |
---|
1085 | </td> |
---|
1086 | </tr> |
---|
1087 | <tr> |
---|
1088 | <td colspan="4" style="text-align:center;"> |
---|
1089 | POSICIONAMIENTO |
---|
1090 | </td> |
---|
1091 | </tr> |
---|
1092 | <tr> |
---|
1093 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1094 | <input type="radio" id="tipoPos" name="tipoPos" value="1" checked/>Por defecto |
---|
1095 | </td> |
---|
1096 | </tr> |
---|
1097 | <tr> |
---|
1098 | <td style="text-align:left;" width="20" colspan="4"> |
---|
1099 | <input type="radio" id="tipoPos" name="tipoPos" value="3"/>Personalizado |
---|
1100 | </td> |
---|
1101 | </tr> |
---|
1102 | <tr> |
---|
1103 | <td colspan="4" style="text-align:center;"> |
---|
1104 | <table width="1200" border="0" cellspacing="2" cellpadding="5" id="tablaImagen" align="center"> |
---|
1105 | <tr> |
---|
1106 | <td> |
---|
1107 | <table width="120" border="0" cellspacing="2" cellpadding="5" align="center"> |
---|
1108 | <tr> |
---|
1109 | <td style="text-align:center;" width="40"> |
---|
1110 | <input type="radio" id="posFijo" name="posFijo" value="1"/> |
---|
1111 | </td> |
---|
1112 | <td style="text-align:center;" width="40"> |
---|
1113 | <input type="radio" id="posFijo" name="posFijo" value="2"/> |
---|
1114 | </td> |
---|
1115 | <td style="text-align:center;" width="40"> |
---|
1116 | <input type="radio" id="posFijo" name="posFijo" value="3"/> |
---|
1117 | </td> |
---|
1118 | </tr> |
---|
1119 | <tr> |
---|
1120 | <td style="text-align:center;" width="40"> |
---|
1121 | <input type="radio" id="posFijo" name="posFijo" value="4"/> |
---|
1122 | </td> |
---|
1123 | <td style="text-align:center;" width="40"> |
---|
1124 | <input type="radio" id="posFijo" name="posFijo" value="5"/> |
---|
1125 | </td> |
---|
1126 | <td style="text-align:center;" width="40"> |
---|
1127 | <input type="radio" id="posFijo" name="posFijo" value="6"/> |
---|
1128 | </td> |
---|
1129 | </tr> |
---|
1130 | <tr> |
---|
1131 | <td style="text-align:center;" width="40"> |
---|
1132 | <input type="radio" id="posFijo" name="posFijo" value="7"/> |
---|
1133 | </td> |
---|
1134 | <td style="text-align:center;" width="40"> |
---|
1135 | <input type="radio" id="posFijo" name="posFijo" value="8"/> |
---|
1136 | </td> |
---|
1137 | <td style="text-align:center;" width="40"> |
---|
1138 | <input type="radio" id="posFijo" name="posFijo" value="9"/> |
---|
1139 | </td> |
---|
1140 | </tr> |
---|
1141 | </table> |
---|
1142 | </td> |
---|
1143 | </tr> |
---|
1144 | <tr> |
---|
1145 | <td> |
---|
1146 | <img src="img/pixelBlanco.jpg" width="0" height="0" style="border:0px solid #000000;" id="imagenPrevia"/> |
---|
1147 | </td> |
---|
1148 | </tr> |
---|
1149 | </table> |
---|
1150 | </td> |
---|
1151 | </tr> |
---|
1152 | |
---|
1153 | <tr> |
---|
1154 | <td colspan="4" style="text-align:center;"> |
---|
1155 | |
---|
1156 | </td> |
---|
1157 | </tr> |
---|
1158 | <tr> |
---|
1159 | <td colspan="4" style="text-align:center;"> |
---|
1160 | |
---|
1161 | </td> |
---|
1162 | </tr> |
---|
1163 | <tr> |
---|
1164 | <td colspan="4" style="text-align:center;"> |
---|
1165 | VERIFICACIÓN DE FIRMAS |
---|
1166 | </td> |
---|
1167 | </tr> |
---|
1168 | |
---|
1169 | <tr> |
---|
1170 | <td colspan="4" style="text-align:left;"><input id="archivoVerifica" name="archivoVerifica" type="file" data-min-file-count="1" name="min"></td> |
---|
1171 | </tr> |
---|
1172 | <tr> |
---|
1173 | <td colspan="4" style="text-align:center;" id="progresoVerifica"> |
---|
1174 | |
---|
1175 | </td> |
---|
1176 | </tr> |
---|
1177 | <tr> |
---|
1178 | <td colspan="4" style="text-align:center;" id="mensajeVerifica"> |
---|
1179 | |
---|
1180 | </td> |
---|
1181 | </tr> |
---|
1182 | <tr> |
---|
1183 | <td colspan="4" style="text-align:center;"> |
---|
1184 | <button type="button" class="button" name="botonSubeVerifica" id="botonSubeVerifica">Carga Archivo a Verificar</button> |
---|
1185 | </td> |
---|
1186 | </tr> |
---|
1187 | <tr> |
---|
1188 | <td colspan="4" style="text-align:center;"> |
---|
1189 | |
---|
1190 | </td> |
---|
1191 | </tr> |
---|
1192 | <tr> |
---|
1193 | <td colspan="4" style="text-align:center;" id="mensajeVerificacion"> |
---|
1194 | |
---|
1195 | </td> |
---|
1196 | </tr> |
---|
1197 | <tr> |
---|
1198 | <td colspan="4" style="text-align:center;"> |
---|
1199 | <button type="button" class="button" name="botonEstadisticas" id="botonEstadisticas">Obtiene estadisticas</button> |
---|
1200 | </td> |
---|
1201 | </tr> |
---|
1202 | <tr> |
---|
1203 | <td colspan="4" style="text-align:center;"> |
---|
1204 | |
---|
1205 | </td> |
---|
1206 | </tr> |
---|
1207 | <tr> |
---|
1208 | <td colspan="4" style="text-align:center;"> |
---|
1209 | <button type="button" class="button" name="botonTest" id="botonTest">Prueba de función</button> |
---|
1210 | </td> |
---|
1211 | </tr> |
---|
1212 | <tr> |
---|
1213 | <td colspan="4" style="text-align:center;" id="mensajeTest"> |
---|
1214 | |
---|
1215 | </td> |
---|
1216 | </tr> |
---|
1217 | <tr> |
---|
1218 | <td colspan="4" style="text-align:center;"> |
---|
1219 | |
---|
1220 | </td> |
---|
1221 | </tr> |
---|
1222 | </table> |
---|
1223 | |
---|
1224 | </body> |
---|
1225 | </html> |
---|