{% extends 'base.html.twig' %} {% block js_document_ready %} //defino variable para fecha actual function addZeroBefore(n) { return (n < 10 ? '0' : '') + n; } //defino variable para fecha actual var currentdate = new Date(); var datetime = "Extraído el: " + currentdate.getDate() + "/" + addZeroBefore((currentdate.getMonth()+1)) + "/" + currentdate.getFullYear() + " " + addZeroBefore(currentdate.getHours()) + ":" + addZeroBefore(currentdate.getMinutes()) + ":" + addZeroBefore(currentdate.getSeconds()); $('#datatable').dataTable({ pageLength: 15, dom: 'Bfrtip', buttons: [ { extend: 'excel', title: 'Aprobados de: {{tomaExamenFecha.tomaExamen.convocatoriaExamen1.cargo|capitalize ~ (tomaExamenFecha.tomaExamen.convocatoriaExamen2 ? " - " ~ tomaExamenFecha.tomaExamen.convocatoriaExamen2.cargo|capitalize : "") ~ ' del ' ~ tomaExamenFecha.fecha|date('d-m-Y')}}', text: 'Excel description', titleAttr: 'Descargar Excel', exportOptions: { }, }, { extend: 'pdf', title: 'Aprobados de: {{tomaExamenFecha.tomaExamen.convocatoriaExamen1.cargo|capitalize ~ (tomaExamenFecha.tomaExamen.convocatoriaExamen2 ? " - " ~ tomaExamenFecha.tomaExamen.convocatoriaExamen2.cargo|capitalize : "") ~ ' del ' ~ tomaExamenFecha.fecha|date('d/m/Y')}}', text: 'PDF picture_as_pdf', titleAttr: 'Descargar PDF', exportOptions: { columns: ':visible' }, //customizo footer con fecha de extracción y número de página customize: function(doc) { doc['footer'] = (function(page, pages) { return { columns: [ { alignment: 'center', text: [ { text: datetime, italics: true }, ] }, { alignment: 'center', text: [ { text: page.toString(), italics: true }, ' de ', { text: pages.toString(), italics: true } ] }, ], margin: [2, 0] } }); } }, { extend: 'colvis', text: 'Visibilidad', titleAttr: 'Visibilidad', }, ], filter : false, language: { "url": "//cdn.datatables.net/plug-ins/1.12.1/i18n/es-ES.json" }, aLengthMenu: "", bAutoWidth: false, "columns": [ { "data": "dni" }, { "data": "apellidos" }, { "data": "nombres" }, { "data": "email" }, { "data": "telefono" }, { "data": "domCodPostal" }, { "data": "calle" }, { "data": "numero" }, { "data": "localidad" }, { "data": "partido" }, ], order: [[ 0, 'asc' ]], columnDefs: [ // These are the column name variables that will be sent to the server { "name": "dni", "targets": 0 }, { "name": "apellidos", "targets": 1, }, { "name": "nombres", "targets": 2, }, { "name": "email", "targets": 3 }, { "name": "telefono", "targets": 4 }, { "name": "domCodPostal", "targets": 5 }, { "name": "calle", "targets": 6 }, { "name": "numero", "targets": 7 }, { "name": "localidad", "targets": 8 }, { "name": "partido", "targets": 9 } ], serverSide: false, processing: true, ajax: { url: '{{ path('aprobados_datos', {'idView':tomaExamenFecha.idView }) }}', type: 'POST' }, }); // the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered $('select').formSelect(); var select = $('select'); $('.limpiar').click(function(){ $("input[type=text]").val(""); select.prop('selectedIndex', 0); //Sets the first option as selected select.material_select(); //Update material select form.submit(); }); {% endblock %} {% block breadcrumb %}
{% endblock %} {% block titulo_body %} {% endblock %} {% block body %}DNI | Apellido/s | Nombre/s | Teléfono | Cód.Postal | Calle | Núm. | Localidad | Partido |
---|