bank.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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">Banche</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. <!--
  18. <section id="subheader" class="d-flex align-items-center justify-content-between">
  19. <form action="" class="group--action d-flex align-items-center">
  20. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example">
  21. <option selected>Open this select menu</option>
  22. <option value="1">One</option>
  23. <option value="2">Two</option>
  24. <option value="3">Three</option>
  25. </select>
  26. <button type="submit" class="btn--ui">applica</button>
  27. </form>
  28. <form action="" class="search--form d-flex align-items-center">
  29. <div class="input-group mb-3">
  30. <input type="text" class="form-control" placeholder="Cerca utente" aria-label="cerca utent" aria-describedby="button-addon2">
  31. <button class="btn--ui" type="button" id="button-addon2"><i class="ico--ui search"></i>Cerca</button>
  32. </div>
  33. </form>
  34. </section>
  35. -->
  36. <section id="resume-table">
  37. <div class="compare--chart_wrapper d-none"></div>
  38. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  39. <thead>
  40. <tr>
  41. <th scope="col">Nome</th>
  42. <th scope="col">Visibilità</th>
  43. <th scope="col">Abilitato</th>
  44. <th scope="col">...</th>
  45. </tr>
  46. </thead>
  47. <tbody id="checkall-target">
  48. @foreach($records as $record)
  49. <tr>
  50. <td>{{$record->name}}</td>
  51. <td>{{$record->getVisibility()}}</td>
  52. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  53. <td>
  54. <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>
  55. <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>
  56. </td>
  57. </tr>
  58. @endforeach
  59. </tbody>
  60. </table>
  61. <!--
  62. <div class="paginator d-flex justify-content-center">
  63. <nav aria-label="Page navigation example">
  64. <ul class="pagination">
  65. <li class="page-item">
  66. <a class="page-link" href="#" aria-label="Previous">
  67. <span aria-hidden="true"></span>
  68. </a>
  69. </li>
  70. <li class="page-item"><a class="page-link" href="#">1</a></li>
  71. <li class="page-item"><a class="page-link" href="#">2</a></li>
  72. <li class="page-item"><a class="page-link" href="#">3</a></li>
  73. <li class="page-item"><a class="page-link" href="#">3</a></li>
  74. <li class="page-item"><span class="more-page">...</span></li>
  75. <li class="page-item">
  76. <a class="page-link" href="#" aria-label="Next">
  77. <span aria-hidden="true"></span>
  78. </a>
  79. </li>
  80. </ul>
  81. </nav>
  82. </div>
  83. -->
  84. </section>
  85. @else
  86. <div class="container">
  87. <a class="btn--ui lightGrey" href="/banks"><i class="fa-solid fa-arrow-left"></i></a><br><br>
  88. @if (session()->has('error'))
  89. <div class="alert alert-danger" role="alert">
  90. {{ session()->get('error') }}
  91. </div>
  92. @endif
  93. <div class="row">
  94. <div class="col">
  95. <form action="">
  96. <div class="row mb-3">
  97. <div class="col">
  98. <div class="form--item">
  99. <label for="inputName" class="form-label">Nome</label>
  100. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  101. @error('name')
  102. <div class="invalid-feedback">{{ $message }}</div>
  103. @enderror
  104. </div>
  105. </div>
  106. <div class="col">
  107. <div class="form--item">
  108. <label for="inputName" class="form-label">Visibilità</label>
  109. <select class="form-control" id="visibility" wire:model="visibility">
  110. <option value="IN">Solo in entrata</option>
  111. <option value="OUT">Solo in uscita</option>
  112. <option value="ALL">Entrambi</option>
  113. </select>
  114. </div>
  115. </div>
  116. <div class="col">
  117. <div class="form--item">
  118. <label for="enabled" class="form-label">Abilitato</label>
  119. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
  120. </div>
  121. </div>
  122. </div>
  123. <!-- // inline input field -->
  124. <div class="form--item">
  125. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  126. @if($add)
  127. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  128. @endif
  129. @if($update)
  130. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  131. @endif
  132. </div>
  133. </form>
  134. </div>
  135. </div>
  136. </div>
  137. @endif
  138. </div>
  139. @push('scripts')
  140. <link href="/css/datatables.css" rel="stylesheet" />
  141. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  142. <script src="/assets/js/datatables.js"></script>
  143. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  144. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  145. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  146. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  147. @endpush
  148. @push('scripts')
  149. <script>
  150. $(document).ready(function() {
  151. loadDataTable();
  152. } );
  153. Livewire.on('load-data-table', () => {
  154. loadDataTable();
  155. });
  156. function loadDataTable(){
  157. let date = new Date();
  158. let date_export = `${date.getFullYear()}${date.getMonth()}${date.getDate()}_`;
  159. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  160. $('#tablesaw-350').DataTable().destroy();
  161. }
  162. $('#tablesaw-350').DataTable({
  163. processing: true,
  164. thead: {
  165. 'th': {'background-color': 'blue'}
  166. },
  167. layout: {
  168. topStart : null,
  169. topEnd : null,
  170. top1A: {
  171. // buttons: [
  172. // {
  173. // extend: 'collection',
  174. // text: 'ESPORTA',
  175. buttons: [
  176. {
  177. extend: 'excelHtml5',
  178. text: '<i class="fa-solid fa-file-excel"></i>',
  179. action: newexportaction,
  180. title: date_export + 'Banche',
  181. exportOptions: {
  182. columns: ":not(':last')"
  183. }
  184. },
  185. {
  186. extend: 'pdfHtml5',
  187. text: '<i class="fa-solid fa-file-pdf"></i>',
  188. action: newexportaction,
  189. title: date_export + 'Banche',
  190. exportOptions: {
  191. columns: ":not(':last')"
  192. }
  193. },
  194. {
  195. extend: 'print',
  196. action: newexportaction,
  197. text: '<i class="fa-solid fa-print"></i>',
  198. title: date_export + 'Banche',
  199. exportOptions: {
  200. columns: ":not(':last')"
  201. }
  202. }
  203. ],
  204. // dropup: true
  205. // }
  206. // ]
  207. },
  208. top1B : {
  209. pageLength: {
  210. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  211. }
  212. },
  213. top1C :'search',
  214. },
  215. pagingType: 'first_last_numbers',
  216. language: {
  217. "url": "/assets/js/Italian.json",
  218. paginate: {
  219. first: '<i class="fa-solid fa-angles-left"></i>',
  220. last: '<i class="fa-solid fa-angles-right"></i>',
  221. }
  222. },
  223. "fnInitComplete": function (oSettings, json) {
  224. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  225. $(".dt-search").append(html);
  226. }
  227. });
  228. $('#tablesaw-350 thead tr th').addClass('col');
  229. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  230. $(document).ready(function() {
  231. $(document).on("click",".addData",function() {
  232. $(".title--section_addButton").trigger("click")
  233. });
  234. } );
  235. }
  236. </script>
  237. @endpush