Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: 'vistas/modulos/secundaria.php',
- method: 'POST',
- data: parametros,
- dataType: 'json',
- cache: false,
- contentType: false,
- processData: false,
- success: function(registros){
- var opcion;
- var entrega;
- var costo;
- var auxiliar = 0;
- $.each(registros, function(i, registro){
- if (typeof (registro.primer_aviso) != "undefined") {
- opcion = registro.primer_aviso;
- entrega = registro.entrega_primer;
- costo = registro.costo_primer;
- }
- else{
- opcion = registro.testimonio;
- entrega = registro.entrega_testimonio;
- costo = registro.costo_testimonio;
- }
- auxiliar = parseInt(auxiliar) + parseInt(costo);
- $('#consultaSecundaria').append(
- '<tr>'+
- '<td>'+registro.municipio+'</td>'+
- '<td>'+registro.escritura+'</td>'+
- '<td>'+registro.enajenante+'</td>'+
- '<td>'+registro.adquiriente+'</td>'+
- '<td>'+opcion+'</td>'+
- '<td>'+entrega+'</td>'+
- '<td>'+costo+'</td>'+
- '</tr>'
- );
- });
- }
- });
- $('#pdf').on('click', function() {
- var auxiliar = $('#consultaSecundaria').html();
- var contenido = "<table border='1'>"+auxiliar+"</table>";
- //contenidoPdf(contenido);
- window.open ("vistas/modulos/pdf.php?contenido="+contenido, '_blank');
- });
- <?php
- require '../../vendor/autoload.php';
- use SpipuHtml2PdfHtml2Pdf;
- $imprimir = $_GET['contenido'];
- $objeto = new Html2Pdf();
- $objeto -> writeHTML($imprimir);
- $objeto -> output('archivo.pdf');
- ?>
Add Comment
Please, Sign In to add comment