{% 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: '{{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: {
columns: [1, 2, 3, 4, 5, 6, 7, 8] // Incluye todas las columnas, incluida la "fechaRespuesta" y la fecha de Lectura
}
},
{
extend: 'pdf',
title: '{{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: [1, 2, 3, 4, 5, 6, 7, 8] // Incluye todas las columnas, incluida la "fechaRespuesta" y la fecha de Lectura
},
//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]
}
});
}
},
'colvis'
],
filter : false,
language: {
"url": "//cdn.datatables.net/plug-ins/1.12.1/i18n/es-ES.json"
},
aLengthMenu: "",
bAutoWidth: false,
"columns": [
{
"data": "foto",
render: function(data, type, row, meta) {
if (type === 'display') {
foto = [
'',
].join('');
return foto;
}
return data;
},
},
{ "data": "dni" },
{ "data": "nombre_apellido" },
{ "data": "email" },
{ "data": "telefono" },
{ "data": "leida" },
{ "data": "fechaLectura",
"visible": false
},
{ "data": "respuesta" },
{ "data": "fechaRespuesta",
"visible": false
},
],
order: [[ 0, 'asc' ]],
columnDefs: [
// These are the column name variables that will be sent to the server
{
"name": "foto",
"searchable": false,
"orderable": false,
"targets": 0
},
{
"name": "p.dni",
"targets": 1
},
{
"name": "nombre_apellido",
"targets": 2
},
{
"name": "email",
"orderable": false,
"targets": 3
},
{
"name": "telefono",
"orderable": false,
"targets": 4
},
{
"name": "leida",
"targets": 5
},
{
"name": "fechaLectura",
"targets": 6
},
{
"name": "respuesta",
"targets": 7
},
{
"data": "fechaRespuesta",
"targets": 8
},
],
serverSide: false,
processing: true,
ajax: {
url: '{{ path('ver_notificados_datos', {'tomaExamenFecha': tomaExamenFecha.id}) }}',
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();
});
$('.tooltipped').tooltip();
{% endblock %}
{% block breadcrumb %}
Territorio: {{tomaExamenFecha.territorialidad|join(", ") }}
{% endif %}place {{tomaExamenFecha.lugar|capitalize}}
description Acta: {% if tomaExamenFecha.numeroActa is not null %} {{tomaExamenFecha.numeroActa }} {% else %} Sin Definir {% endif %}
DNI | Nombre y Apellido | Teléfono | Respuesta | Fecha Respuesta |
---|