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.

74 lines
3.0KB

  1. <?= $this->extend('templates/baseAdmin') ?>
  2. <?= $this->section('content') ?>
  3. <table class="table table-striped" style="table-layout: fixed; word-wrap: break-word;">
  4. <thead class="">
  5. <th>Título</th>
  6. <th colspan="3">Descripción</th>
  7. <th>Opciones</th>
  8. </thead>
  9. <tbody>
  10. <?php foreach ($encuestas as $encuesta) : ?>
  11. <tr>
  12. <td><?= esc($encuesta['title']) ?></td>
  13. <td colspan="3"><?= esc($encuesta['description']) ?></td>
  14. <td>
  15. <div class="button-group mr-2" role="group">
  16. <a href="<?= route_to('admin_encuesta_editar', $encuesta['id']) ?>" class="btn btn-info ">
  17. <i class="nav-icon fas fa-edit"></i>
  18. </a>
  19. <a href="<?= route_to('admin_encuesta', $encuesta['id']) ?>" class="btn btn-success ">
  20. <i class="nav-icon fas fa-eye"></i>
  21. </a>
  22. <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#eliminarModal" data-id="<?= $encuesta['id'] ?>" data-title="<?= $encuesta['title'] ?>" data-link="<?= route_to('admin_encuesta_eliminar', $encuesta['id']) ?>">
  23. <i class="nav-icon fas fa-trash"></i>
  24. </button>
  25. </div>
  26. </td>
  27. </tr>
  28. <?php endforeach ?>
  29. </tbody>
  30. </table>
  31. <!-- Modal: eliminar encuesta -->
  32. <div class="modal fade" id="eliminarModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  33. <div class="modal-dialog" role="document">
  34. <div class="modal-content">
  35. <div class="modal-header">
  36. <h5 class="modal-title" id="exampleModalLabel">Eliminar Encuesta</h5>
  37. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  38. <span aria-hidden="true">&times;</span>
  39. </button>
  40. </div>
  41. <div class="modal-body">
  42. </div>
  43. <div class="modal-footer">
  44. <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
  45. <a href="#" id="eliminar-link" class="btn btn-danger">Eliminar</a>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <script src="plugins/jquery/jquery.min.js"></script>
  51. <script>
  52. $(document).ready(function() {
  53. $('#eliminarModal').on('show.bs.modal', (event) => {
  54. let button = $(event.relatedTarget)
  55. let encuestaId = button.data('id')
  56. let encuestaTitle = button.data('title')
  57. let encuestaLink = button.data('link')
  58. let modal = $(this)
  59. // modal.find('.modal-title').text('New message to ' + recipient)
  60. modal.find('.modal-body').text('Eliminar: ' + encuestaTitle)
  61. modal.find('#eliminar-link').attr('href', encuestaLink)
  62. })
  63. })
  64. </script>
  65. <?= $this->endSection() ?>