You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.7KB

  1. <?= $this->extend('templates/baseAdmin') ?>
  2. <?= $this->section('content') ?>
  3. <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
  4. <script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
  5. <script src="https://cdn.datatables.net/1.12.1/js/dataTables.bootstrap5.min.js"></script>
  6. <h1><?= $tituloEncuesta ?></h1>
  7. <p>Respuestas de: <span class="font-weight-bolder"><?= $prestador['nombre'] . ' ' . $prestador['apaterno'] . ' ' . $prestador['amaterno'] ?></span></p>
  8. <div class="card">
  9. <div class="card-body">
  10. <table id="table-solicitudes" class="table table-bordered table-striped">
  11. <thead>
  12. <th>Pregunta</th>
  13. <th>Respuesta</th>
  14. </thead>
  15. <tbody>
  16. <?php foreach ($respuestas as $respuesta) : ?>
  17. <tr>
  18. <td><?= $respuesta[0]['question'] ?></td>
  19. <!-- Respuestas de opción múltiple -->
  20. <?php if ($respuesta[0]['type'] === '3') : ?>
  21. <td>
  22. <?php foreach ($respuesta as $opcion) : ?>
  23. <?= $opcion['answer'] ?>
  24. <br>
  25. <?php endforeach ?>
  26. </td>
  27. <?php else : ?>
  28. <td><?= $respuesta[0]['answer'] ?></td>
  29. <?php endif ?>
  30. </tr>
  31. <?php endforeach ?>
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. <script>
  37. document.addEventListener('DOMContentLoaded', function() {
  38. let table = new DataTable('#table-solicitudes', {
  39. 'searching': true,
  40. 'ordering': true,
  41. 'language': {
  42. "decimal": "",
  43. "emptyTable": "No hay información",
  44. "info": "Mostrando _START_ a _END_ de _TOTAL_ registros",
  45. "infoEmpty": "Mostrando 0 to 0 of 0 registros",
  46. "infoFiltered": "(Filtrado de _MAX_ total registros)",
  47. "infoPostFix": "",
  48. "thousands": ",",
  49. "lengthMenu": "Mostrar _MENU_ registros",
  50. "loadingRecords": "Cargando...",
  51. "processing": "Procesando...",
  52. "search": "Buscar:",
  53. "zeroRecords": "No se encontraron resultados",
  54. "paginate": {
  55. "first": "Primero",
  56. "last": "Ultimo",
  57. "next": "Siguiente",
  58. "previous": "Anterior"
  59. }
  60. },
  61. 'order': [],
  62. });
  63. });
  64. </script>
  65. <?= $this->endSection() ?>