bank.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
  6. <div class="title--section_name d-flex align-items-center justify-content-between">
  7. <i class="ico--ui title_section utenti me-2"></i>
  8. <h2 class="primary">Banche</h2>
  9. </div>
  10. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  11. <div class="card--ui card--ui_btnAddHeaderUser entrata d-flex justify-items-between">
  12. <a href="#" wire:click="add()" style="color:white">Aggiungi</a>
  13. </div>
  14. </div>
  15. </header>
  16. <!--
  17. <section id="subheader" class="d-flex align-items-center justify-content-between">
  18. <form action="" class="group--action d-flex align-items-center">
  19. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example">
  20. <option selected>Open this select menu</option>
  21. <option value="1">One</option>
  22. <option value="2">Two</option>
  23. <option value="3">Three</option>
  24. </select>
  25. <button type="submit" class="btn--ui">applica</button>
  26. </form>
  27. <form action="" class="search--form d-flex align-items-center">
  28. <div class="input-group mb-3">
  29. <input type="text" class="form-control" placeholder="Cerca utente" aria-label="cerca utent" aria-describedby="button-addon2">
  30. <button class="btn--ui" type="button" id="button-addon2"><i class="ico--ui search"></i>Cerca</button>
  31. </div>
  32. </form>
  33. </section>
  34. -->
  35. <section id="resume-table">
  36. <div class="compare--chart_wrapper d-none"></div>
  37. <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
  38. <thead>
  39. <tr>
  40. <th scope="col">Nome</th>
  41. <th scope="col">Abilitato</th>
  42. <th scope="col">...</th>
  43. </tr>
  44. </thead>
  45. <tbody id="checkall-target">
  46. @foreach($records as $record)
  47. <tr>
  48. <td>{{$record->name}}</td>
  49. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  50. <td>
  51. <button type="button" class="btn" wire:click="edit({{ $record->id }})"><i class="fa-regular fa-pen-to-square"></i></button>
  52. <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})"><i class="fa-regular fa-trash-can"></i></button>
  53. </td>
  54. </tr>
  55. @endforeach
  56. </tbody>
  57. </table>
  58. <!--
  59. <div class="paginator d-flex justify-content-center">
  60. <nav aria-label="Page navigation example">
  61. <ul class="pagination">
  62. <li class="page-item">
  63. <a class="page-link" href="#" aria-label="Previous">
  64. <span aria-hidden="true"></span>
  65. </a>
  66. </li>
  67. <li class="page-item"><a class="page-link" href="#">1</a></li>
  68. <li class="page-item"><a class="page-link" href="#">2</a></li>
  69. <li class="page-item"><a class="page-link" href="#">3</a></li>
  70. <li class="page-item"><a class="page-link" href="#">3</a></li>
  71. <li class="page-item"><span class="more-page">...</span></li>
  72. <li class="page-item">
  73. <a class="page-link" href="#" aria-label="Next">
  74. <span aria-hidden="true"></span>
  75. </a>
  76. </li>
  77. </ul>
  78. </nav>
  79. </div>
  80. -->
  81. </section>
  82. @else
  83. <div class="container">
  84. @if (session()->has('error'))
  85. <div class="alert alert-danger" role="alert">
  86. {{ session()->get('error') }}
  87. </div>
  88. @endif
  89. <div class="row">
  90. <div class="col">
  91. <form action="">
  92. <div class="row mb-3">
  93. <div class="col">
  94. <div class="form--item">
  95. <label for="inputName" class="form-label">Nome</label>
  96. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  97. @error('name')
  98. <div class="invalid-feedback">{{ $message }}</div>
  99. @enderror
  100. </div>
  101. </div>
  102. <div class="col">
  103. <div class="form-check form-check-inline">
  104. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  105. <label class="form-check-label" for="enabled">Abilitato</label>
  106. </div>
  107. </div>
  108. </div>
  109. <!-- // inline input field -->
  110. <div class="form--item">
  111. @if($add)
  112. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  113. @endif
  114. @if($update)
  115. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  116. @endif
  117. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  118. </div>
  119. </form>
  120. </div>
  121. </div>
  122. </div>
  123. @endif
  124. </div>
  125. @push('scripts')
  126. <link href="/css/datatables.css" rel="stylesheet" />
  127. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  128. <script src="/assets/js/datatables.js"></script>
  129. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  130. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  131. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  132. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  133. @endpush
  134. @push('scripts')
  135. <script>
  136. $(document).ready(function() {
  137. loadDataTable();
  138. } );
  139. Livewire.on('load-data-table', () => {
  140. loadDataTable();
  141. });
  142. function loadDataTable(){
  143. $('#tablesaw-350').DataTable({
  144. thead: {
  145. 'th': {'background-color': 'blue'}
  146. },
  147. layout: {
  148. topStart : null,
  149. topEnd : null,
  150. top1A: {
  151. buttons: [
  152. {
  153. extend: 'collection',
  154. text: 'Esporta',
  155. buttons: [
  156. {
  157. extend: 'excelHtml5',
  158. title: 'Utenti',
  159. exportOptions: {
  160. columns: ":not(':last')"
  161. }
  162. },
  163. {
  164. extend: 'pdfHtml5',
  165. title: 'Utenti',
  166. exportOptions: {
  167. columns: ":not(':last')"
  168. }
  169. },
  170. {
  171. extend: 'print',
  172. text: 'Stampa',
  173. title: 'Utenti',
  174. exportOptions: {
  175. columns: ":not(':last')"
  176. }
  177. }
  178. ],
  179. dropup: true
  180. }
  181. ]
  182. },
  183. top1B : {
  184. pageLength: {
  185. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  186. }
  187. },
  188. top1C :'search',
  189. },
  190. pagingType: 'numbers',
  191. "language": {
  192. "url": "/assets/js/Italian.json"
  193. },
  194. "fnInitComplete": function (oSettings, json) {
  195. var html = '&nbsp;<a href="#" class="addData card--ui card--ui_btnAddHeaderUser">&nbsp;&nbsp;<i class="fa-solid fa-plus"></i>&nbsp;&nbsp;</a>';
  196. $(".dt-search").append(html);
  197. }
  198. });
  199. $('#tablesaw-350 thead tr th').addClass('col');
  200. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  201. $(document).ready(function() {
  202. $(document).on("click",".addData",function() {
  203. $(".title--section_addButton").trigger("click")
  204. });
  205. } );
  206. }
  207. </script>
  208. @endpush