Selaa lähdekoodia

Opción para descargar PDF o Excel

encuestas-excel
Sergio 2 vuotta sitten
vanhempi
commit
2484732678
2 muutettua tiedostoa jossa 39 lisäystä ja 33 poistoa
  1. +35
    -31
      app/Views/Admin/respuestasGenerales.php
  2. +4
    -2
      app/Views/templates/baseAdmin.php

+ 35
- 31
app/Views/Admin/respuestasGenerales.php Näytä tiedosto

@@ -1,10 +1,15 @@
<?= $this->extend('templates/baseAdmin') ?>

<?= $this->section('content') ?>

<?= $this->section('headLibraries') ?>

<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">

<?= $this->endSection() ?>

<?= $this->section('content') ?>

<h1><?= $tituloEncuesta ?></h1>

<div class="card">
@@ -48,6 +53,13 @@
</div>
</div>




<?= $this->endSection() ?>

<?= $this->section('scripts') ?>

<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
@@ -62,38 +74,30 @@
$('#table-respuestas').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
'excel', 'pdf',
],
language: {
"decimal": "",
"emptyTable": "No hay información",
"info": "Mostrando _START_ a _END_ de _TOTAL_ registros",
"infoEmpty": "Mostrando 0 to 0 of 0 registros",
"infoFiltered": "(Filtrado de _MAX_ total registros)",
"infoPostFix": "",
"thousands": ",",
"lengthMenu": "Mostrar _MENU_ registros",
"loadingRecords": "Cargando...",
"processing": "Procesando...",
"search": "Buscar:",
"zeroRecords": "No se encontraron resultados",
"paginate": {
"first": "Primero",
"last": "Ultimo",
"next": "Siguiente",
"previous": "Anterior"
}
},
});
});
// document.addEventListener('DOMContentLoaded', function() {
// let table = new DataTable('#table-respuestas', {
// 'buttons': ['excel'],
// 'searching': true,
// 'ordering': true,
// 'language': {
// "decimal": "",
// "emptyTable": "No hay información",
// "info": "Mostrando _START_ a _END_ de _TOTAL_ registros",
// "infoEmpty": "Mostrando 0 to 0 of 0 registros",
// "infoFiltered": "(Filtrado de _MAX_ total registros)",
// "infoPostFix": "",
// "thousands": ",",
// "lengthMenu": "Mostrar _MENU_ registros",
// "loadingRecords": "Cargando...",
// "processing": "Procesando...",
// "search": "Buscar:",
// "zeroRecords": "No se encontraron resultados",
// "paginate": {
// "first": "Primero",
// "last": "Ultimo",
// "next": "Siguiente",
// "previous": "Anterior"
// }
// },
// 'order': [],
// });
// });
</script>

<?= $this->endSection() ?>

+ 4
- 2
app/Views/templates/baseAdmin.php Näytä tiedosto

@@ -18,8 +18,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">

<link rel="stylesheet" media="screen" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css" />
<link rel="stylesheet" media="screen" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.dataTables.min.css" />
<?= $this->renderSection('headLibraries') ?>


</head>
@@ -167,6 +166,9 @@ scratch. This page gets rid of all links and provides the needed markup only.
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>

<?= $this->renderSection('scripts') ?>

</body>

</html>

Loading…
Peruuta
Tallenna