payment_method.blade.php 12 KB

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