bank.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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">Abilitato</th>
  43. <th scope="col">...</th>
  44. </tr>
  45. </thead>
  46. <tbody id="checkall-target">
  47. @foreach($records as $record)
  48. <tr>
  49. <td>{{$record->name}}</td>
  50. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  51. <td>
  52. <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>
  53. <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>
  54. </td>
  55. </tr>
  56. @endforeach
  57. </tbody>
  58. </table>
  59. <!--
  60. <div class="paginator d-flex justify-content-center">
  61. <nav aria-label="Page navigation example">
  62. <ul class="pagination">
  63. <li class="page-item">
  64. <a class="page-link" href="#" aria-label="Previous">
  65. <span aria-hidden="true"></span>
  66. </a>
  67. </li>
  68. <li class="page-item"><a class="page-link" href="#">1</a></li>
  69. <li class="page-item"><a class="page-link" href="#">2</a></li>
  70. <li class="page-item"><a class="page-link" href="#">3</a></li>
  71. <li class="page-item"><a class="page-link" href="#">3</a></li>
  72. <li class="page-item"><span class="more-page">...</span></li>
  73. <li class="page-item">
  74. <a class="page-link" href="#" aria-label="Next">
  75. <span aria-hidden="true"></span>
  76. </a>
  77. </li>
  78. </ul>
  79. </nav>
  80. </div>
  81. -->
  82. </section>
  83. @else
  84. <div class="container">
  85. @if (session()->has('error'))
  86. <div class="alert alert-danger" role="alert">
  87. {{ session()->get('error') }}
  88. </div>
  89. @endif
  90. <div class="row">
  91. <div class="col">
  92. <form action="">
  93. <div class="row mb-3">
  94. <div class="col">
  95. <div class="form--item">
  96. <label for="inputName" class="form-label">Nome</label>
  97. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  98. @error('name')
  99. <div class="invalid-feedback">{{ $message }}</div>
  100. @enderror
  101. </div>
  102. </div>
  103. <div class="col">
  104. <div class="form--item">
  105. <label for="enabled" class="form-label">Abilitato</label>
  106. <input class="form-check-input form-control" style="width:22px; height:22px;" type="checkbox" id="enabled" wire:model="enabled">
  107. </div>
  108. </div>
  109. </div>
  110. <!-- // inline input field -->
  111. <div class="form--item">
  112. @if($add)
  113. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  114. @endif
  115. @if($update)
  116. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  117. @endif
  118. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  119. </div>
  120. </form>
  121. </div>
  122. </div>
  123. </div>
  124. @endif
  125. </div>
  126. @push('scripts')
  127. <link href="/css/datatables.css" rel="stylesheet" />
  128. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  129. <script src="/assets/js/datatables.js"></script>
  130. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  131. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  132. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  133. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  134. @endpush
  135. @push('scripts')
  136. <script>
  137. $(document).ready(function() {
  138. loadDataTable();
  139. } );
  140. Livewire.on('load-data-table', () => {
  141. loadDataTable();
  142. });
  143. function loadDataTable(){
  144. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  145. $('#tablesaw-350').DataTable().destroy();
  146. }
  147. $('#tablesaw-350').DataTable({
  148. thead: {
  149. 'th': {'background-color': 'blue'}
  150. },
  151. layout: {
  152. topStart : null,
  153. topEnd : null,
  154. top1A: {
  155. buttons: [
  156. {
  157. extend: 'collection',
  158. text: 'Esporta',
  159. buttons: [
  160. {
  161. extend: 'excelHtml5',
  162. title: 'Banche',
  163. exportOptions: {
  164. columns: ":not(':last')"
  165. }
  166. },
  167. {
  168. extend: 'pdfHtml5',
  169. title: 'Banche',
  170. exportOptions: {
  171. columns: ":not(':last')"
  172. }
  173. },
  174. {
  175. extend: 'print',
  176. text: 'Stampa',
  177. title: 'Banche',
  178. exportOptions: {
  179. columns: ":not(':last')"
  180. }
  181. }
  182. ],
  183. dropup: true
  184. }
  185. ]
  186. },
  187. top1B : {
  188. pageLength: {
  189. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  190. }
  191. },
  192. top1C :'search',
  193. },
  194. pagingType: 'numbers',
  195. "language": {
  196. "url": "/assets/js/Italian.json"
  197. },
  198. "fnInitComplete": function (oSettings, json) {
  199. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  200. $(".dt-search").append(html);
  201. }
  202. });
  203. $('#tablesaw-350 thead tr th').addClass('col');
  204. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  205. $(document).ready(function() {
  206. $(document).on("click",".addData",function() {
  207. $(".title--section_addButton").trigger("click")
  208. });
  209. } );
  210. }
  211. </script>
  212. @endpush