motivation.blade.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <div class="col card--ui" id="card--dashboard">
  2. @if(!$add && !$update)
  3. <!--<button id="open-filter" onclick="pcsh1()"></button>
  4. <button id="close-filter" onclick="pcsh2()"></button>-->
  5. <a class="btn--ui lightGrey" href="/settings?type=contabilita"><i class="fa-solid fa-arrow-left"></i></a><br>
  6. <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
  7. <div class="title--section_name d-flex align-items-center justify-content-between">
  8. <i class="ico--ui title_section utenti me-2"></i>
  9. <h2 class="primary">Motivazioni annullamento</h2>
  10. </div>
  11. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  12. <div class="btn--ui entrata d-flex justify-items-between">
  13. <a href="#" wire:click="add()" style="color:white">Aggiungi</a>
  14. </div>
  15. </div>
  16. </header>
  17. <section id="resume-table">
  18. <div class="compare--chart_wrapper d-none"></div>
  19. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  20. <thead>
  21. <tr>
  22. <th scope="col">Nome</th>
  23. <th scope="col">Abilitato</th>
  24. <th scope="col">...</th>
  25. </tr>
  26. </thead>
  27. <tbody id="checkall-target">
  28. @foreach($records as $record)
  29. <tr>
  30. <td>{{$record->name}}</td>
  31. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  32. <td>
  33. <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  34. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="cestina"><i class="fa-regular fa-trash-can"></i></button>
  35. </td>
  36. </tr>
  37. @endforeach
  38. </tbody>
  39. </table>
  40. </section>
  41. @else
  42. <div class="container">
  43. <a class="btn--ui lightGrey" href="/banks"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  44. @if (session()->has('error'))
  45. <div class="alert alert-danger" role="alert">
  46. {{ session()->get('error') }}
  47. </div>
  48. @endif
  49. <div class="row">
  50. <div class="col">
  51. <form action="">
  52. <div class="row mb-3">
  53. <div class="col">
  54. <div class="form--item">
  55. <label for="inputName" class="form-label">Nome</label>
  56. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  57. @error('name')
  58. <div class="invalid-feedback">{{ $message }}</div>
  59. @enderror
  60. </div>
  61. </div>
  62. <div class="col">
  63. <div class="form--item">
  64. <label for="enabled" class="form-label">Abilitato</label>
  65. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
  66. </div>
  67. </div>
  68. </div>
  69. <!-- // inline input field -->
  70. <div class="form--item">
  71. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  72. @if($add)
  73. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  74. @endif
  75. @if($update)
  76. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  77. @endif
  78. </div>
  79. </form>
  80. </div>
  81. </div>
  82. </div>
  83. @endif
  84. </div>
  85. @push('scripts')
  86. <link href="/css/datatables.css" rel="stylesheet" />
  87. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  88. <script src="/assets/js/datatables.js"></script>
  89. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  90. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  91. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  92. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  93. @endpush
  94. @push('scripts')
  95. <script>
  96. $(document).ready(function() {
  97. loadDataTable();
  98. } );
  99. Livewire.on('load-data-table', () => {
  100. loadDataTable();
  101. });
  102. function loadDataTable(){
  103. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  104. $('#tablesaw-350').DataTable().destroy();
  105. }
  106. $('#tablesaw-350').DataTable({
  107. thead: {
  108. 'th': {'background-color': 'blue'}
  109. },
  110. layout: {
  111. topStart : null,
  112. topEnd : null,
  113. top1A: {
  114. buttons: [
  115. {
  116. extend: 'collection',
  117. text: 'ESPORTA',
  118. buttons: [
  119. {
  120. extend: 'excelHtml5',
  121. title: 'Motivazioni annullamento',
  122. exportOptions: {
  123. columns: ":not(':last')"
  124. }
  125. },
  126. {
  127. extend: 'pdfHtml5',
  128. title: 'Motivazioni annullamento',
  129. exportOptions: {
  130. columns: ":not(':last')"
  131. }
  132. },
  133. {
  134. extend: 'print',
  135. text: 'Stampa',
  136. title: 'Motivazioni annullamento',
  137. exportOptions: {
  138. columns: ":not(':last')"
  139. }
  140. }
  141. ],
  142. dropup: true
  143. }
  144. ]
  145. },
  146. top1B : {
  147. pageLength: {
  148. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  149. }
  150. },
  151. top1C :'search',
  152. },
  153. pagingType: 'numbers',
  154. "language": {
  155. "url": "/assets/js/Italian.json"
  156. },
  157. "fnInitComplete": function (oSettings, json) {
  158. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  159. $(".dt-search").append(html);
  160. }
  161. });
  162. $('#tablesaw-350 thead tr th').addClass('col');
  163. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  164. $(document).ready(function() {
  165. $(document).on("click",".addData",function() {
  166. $(".title--section_addButton").trigger("click")
  167. });
  168. } );
  169. }
  170. </script>
  171. @endpush