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.

index.php 4.7KB

2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?= $this->extend('templates/base') ?>
  2. <!-- title -->
  3. <?= $this->section('title') ?>Prestador<?= $this->endSection() ?>
  4. <!-- head -->
  5. <?= $this->section('head') ?>
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css">
  7. <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
  8. <script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
  9. <script src="https://cdn.datatables.net/1.12.1/js/dataTables.bootstrap5.min.js"></script>
  10. <?= $this->endSection() ?>
  11. <!-- content -->
  12. <?= $this->section('content') ?>
  13. <div class="row mb-5">
  14. <!-- ENCUESTAS DISPONIBLES -->
  15. <?php if (isset($encuestas)) : ?>
  16. <div class="col-md-4">
  17. <div class="card">
  18. <div class="card-header">
  19. Encuestas disponibles
  20. </div>
  21. <div class="card-body">
  22. <div class="list-group list-group-flush">
  23. <?php foreach ($encuestas as $encuesta) : ?>
  24. <a href="<?= route_to('encuesta', $encuesta['id']) ?>" class="list-group-item list-group-item-action"><?= $encuesta['title'] ?></a>
  25. <?php endforeach ?>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <?php endif ?>
  31. <!-- HORAS MENSUALES -->
  32. <div class="col-md-4 mb-5">
  33. <div class="card">
  34. <div class="card-header">
  35. Horas realizadas por mes
  36. </div>
  37. <div class="card-body">
  38. <table class="table table-sm table-hover">
  39. <thead>
  40. <th>Mes</th>
  41. <th>Horas</th>
  42. </thead>
  43. <tbody>
  44. <?php foreach ($segundosMensuales as $mes) : ?>
  45. <tr>
  46. <td><?= esc($mes['mes']) ?> / <?= esc($mes['ano']) ?></td>
  47. <td><?= esc($mes['segundos']) / 3600 ?></td>
  48. </tr>
  49. <?php endforeach ?>
  50. </tbody>
  51. <tfoot class="table-active">
  52. <td>Total</td>
  53. <td><?= $horasTotales ?></td>
  54. </tfoot>
  55. </table>
  56. <!-- <a data-bs-toggle="collapse" href="#collapseHoras" role="button" aria-expanded="true" aria-controls="collapseHoras">Ver desglose de horas</a> -->
  57. </div>
  58. </div>
  59. </div>
  60. <!-- DESGLOSE DE HORAS -->
  61. <!-- <div class="collapse show" id="collapseHoras"> -->
  62. <div class="col-md-5">
  63. <div class="card">
  64. <div class="card-header">
  65. Desglose por día
  66. </div>
  67. <div class="card-body">
  68. <table id="example" class="table table-striped" style="width:100%" aria-describedby="example_info">
  69. <thead>
  70. <tr>
  71. <th class="sorting sorting_asc" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 128.867px;" aria-sort="ascending" aria-label="Name: activate to sort column descending">Fecha</th>
  72. <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 217.267px;" aria-label="Position: activate to sort column ascending">Horas</th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. <?php foreach ($segundosDiarios as $dia) : ?>
  77. <tr>
  78. <td class="sorting_1"><?= sprintf("%02d", esc($dia['dia'])) ?> / <?= sprintf("%02d", esc($dia['mes'])) ?> / <?= esc($dia['ano']) ?></td>
  79. <td><?= esc($dia['total_horas_truncadas']) / 3600 ?>
  80. </tr>
  81. </tr>
  82. <?php endforeach ?>
  83. </tbody>
  84. </table>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- </div> -->
  89. </div>
  90. <script>
  91. document.addEventListener('DOMContentLoaded', function() {
  92. let table = new DataTable('#example', {
  93. 'searching': false,
  94. 'ordering': false,
  95. 'language': {
  96. "lengthMenu": "Mostrar _MENU_ registros",
  97. "info": "Página: _PAGE_ / _PAGES_",
  98. "zeroRecords": "No se encontraron registros",
  99. "paginate": {
  100. "first": "Inicio",
  101. "last": "Fin",
  102. "next": ">",
  103. "previous": "<"
  104. },
  105. },
  106. 'order': [],
  107. });
  108. });
  109. </script>
  110. <?= $this->endSection() ?>