receipt.blade.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <div class="col">
  2. <div class="row h-100">
  3. <div class="col-auto filterWrapper" id="filter--section" wire:ignore.self>
  4. <aside>
  5. <header>
  6. <h2>Filtra Ricevute</h2>
  7. </header>
  8. <form action="" id="filter--form" class="dark-form row">
  9. <div class="filter--item">
  10. <span class="filter--item_title">Stato</span>
  11. <div class="filter--item_formElement">
  12. <select class="form-select" wire:model="filterStatus" onchange="destroyDataTable()">
  13. <option value="">--Seleziona--
  14. <option value="1">Attiva
  15. <option value="99">Annullata
  16. </select>
  17. </div>
  18. </div>
  19. <div class="filter--item">
  20. <span class="filter--item_title">Periodo</span>
  21. <div class="filter--item_formElement">
  22. <input id="date" type="date" class="form-control" wire:model="filterFrom" style="background-color:white">
  23. </div>
  24. <div class="filter--item_formElement">
  25. <input id="date" type="date" class="form-control" wire:model="filterTo" style="background-color:white" >
  26. </div>
  27. </div>
  28. </form>
  29. <footer>
  30. <div class="filter--buttons d-flex align-items-center justify-content-between">
  31. <button class="btn--ui small dark disable" wire:click.prevent="disableSearch()" onclick="destroyDataTable()">cancella</button>
  32. <button class="btn--ui small white" wire:click.prevent="search()" onclick="destroyDataTable()">filtra</button>
  33. </div>
  34. </footer>
  35. </aside>
  36. </div>
  37. <div class="col card--ui" id="card--dashboard">
  38. <header id="title--section" class="d-flex align-items-center justify-content-between">
  39. <div class="title--section_name d-flex align-items-center justify-content-between">
  40. <i class="ico--ui title_section utenti me-2"></i>
  41. <h2 class="primary">Ricevute</h2>
  42. </div>
  43. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  44. <div class="card--ui card--ui_btnAddHeaderUser entrata d-flex justify-items-between">
  45. <header class="d-flex justify-content-between"><div class="card-title d-flex align-items-start"><h2>Aggiungi&nbsp;&nbsp;&nbsp;</h2></div><a href="#" wire:click="add()"><i class="ico--ui big add primary"></i></a></header>
  46. </div>
  47. </div>
  48. </header>
  49. <button id="open-filter" onclick="pcsh1()"></button>
  50. <button id="close-filter" onclick="pcsh2()"></button>
  51. <section id="resume-table">
  52. <div class="compare--chart_wrapper d-none"></div>
  53. <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
  54. <thead>
  55. <tr>
  56. <th scope="col">Anno</th>
  57. <th scope="col">Numero</th>
  58. <th scope="col">Destinatario</th>
  59. <th scope="col">Stato</th>
  60. <th scope="col">Data</th>
  61. <th scope="col">...</th>
  62. </tr>
  63. </thead>
  64. <tbody id="checkall-target">
  65. @foreach($records as $record)
  66. <tr>
  67. <td>{{$record->year}}</td>
  68. <td>{{$record->number}}</td>
  69. <td>{{$record->type == 'IN' ? ($record->member->first_name . " " . $record->member->last_name) : 'Uscita'}}</td>
  70. <td>
  71. <span class="tablesaw-cell-content">
  72. <span class="badge tessera-badge {{$record->status == 1 ? 'active' : 'suspended'}}">{{$record->status == 1 ? 'Attivo' : 'Annullata'}}</span>
  73. </span>
  74. </td>
  75. <td>{{date("d/m/Y", strtotime($record->date))}}</td>
  76. <td>
  77. <button type="button" class="btn btn-outline-primary btn-sm" onclick="document.location.href='/in?id={{$record->record_id}}'">Dettaglio</button>
  78. <a target="_blank" class="btn btn-outline-primary btn-sm" href="/receipt/{{$record->id}}">Stampa</a>
  79. </td>
  80. </tr>
  81. @endforeach
  82. </tbody>
  83. </table>
  84. </section>
  85. </div>
  86. @push('scripts')
  87. <link href="/css/datatables.css" rel="stylesheet" />
  88. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  89. <script src="/assets/js/datatables.js"></script>
  90. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  91. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  92. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  93. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  94. @endpush
  95. @push('scripts')
  96. <script>
  97. $(document).ready(function() {
  98. loadDataTable();
  99. } );
  100. Livewire.on('load-data-table', () => {
  101. setTimeout(function() {loadDataTable()}, 100);
  102. });
  103. Livewire.on('destroy-data-table', () => {
  104. $('#tablesaw-350').DataTable().destroy();
  105. });
  106. function destroyDataTable()
  107. {
  108. $('#tablesaw-350').DataTable().destroy();
  109. }
  110. function loadDataTable(){
  111. $('#tablesaw-350').DataTable({
  112. thead: {
  113. 'th': {'background-color': 'blue'}
  114. },
  115. layout: {
  116. topStart: {
  117. buttons: [
  118. {
  119. extend: 'excelHtml5',
  120. title: 'Ricevute',
  121. exportOptions: {
  122. columns: ":not(':last')"
  123. }
  124. },
  125. {
  126. extend: 'pdfHtml5',
  127. title: 'Ricevute',
  128. exportOptions: {
  129. columns: ":not(':last')"
  130. }
  131. },
  132. {
  133. extend: 'print',
  134. text: 'Stampa',
  135. title: 'Ricevute',
  136. exportOptions: {
  137. columns: ":not(':last')"
  138. }
  139. }
  140. ]
  141. }
  142. },
  143. order: [[0, 'desc'], [1, 'desc']],
  144. pagingType: 'numbers',
  145. "language": {
  146. "url": "/assets/js/Italian.json"
  147. }
  148. });
  149. $('#tablesaw-350 thead tr th').addClass('col');
  150. $('#tablesaw-350 thead tr th').css("background-color", "#EDF0F2");
  151. }
  152. </script>
  153. @endpush