bank.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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">Canali finanziari</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. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  158. $('#tablesaw-350').DataTable().destroy();
  159. }
  160. $('#tablesaw-350').DataTable({
  161. thead: {
  162. 'th': {'background-color': 'blue'}
  163. },
  164. layout: {
  165. topStart : null,
  166. topEnd : null,
  167. top1A: {
  168. buttons: [
  169. {
  170. extend: 'collection',
  171. text: 'ESPORTA',
  172. buttons: [
  173. {
  174. extend: 'excelHtml5',
  175. title: 'Banche',
  176. exportOptions: {
  177. columns: ":not(':last')"
  178. }
  179. },
  180. {
  181. extend: 'pdfHtml5',
  182. title: 'Banche',
  183. exportOptions: {
  184. columns: ":not(':last')"
  185. }
  186. },
  187. {
  188. extend: 'print',
  189. text: 'Stampa',
  190. title: 'Banche',
  191. exportOptions: {
  192. columns: ":not(':last')"
  193. }
  194. }
  195. ],
  196. dropup: true
  197. }
  198. ]
  199. },
  200. top1B : {
  201. pageLength: {
  202. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  203. }
  204. },
  205. top1C :'search',
  206. },
  207. pagingType: 'numbers',
  208. "language": {
  209. "url": "/assets/js/Italian.json"
  210. },
  211. "fnInitComplete": function (oSettings, json) {
  212. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  213. $(".dt-search").append(html);
  214. }
  215. });
  216. $('#tablesaw-350 thead tr th').addClass('col');
  217. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  218. $(document).ready(function() {
  219. $(document).on("click",".addData",function() {
  220. $(".title--section_addButton").trigger("click")
  221. });
  222. } );
  223. }
  224. </script>
  225. @endpush