vat.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <div class="col card--ui" id="card--dashboard">
  2. @if(!$add && !$update)
  3. <header id="title--section" class="d-flex align-items-center justify-content-between">
  4. <div class="title--section_name d-flex align-items-center justify-content-between">
  5. <i class="ico--ui title_section utenti me-2"></i>
  6. <h2 class="primary">IVA</h2>
  7. </div>
  8. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  9. <div class="card--ui card--ui_btnAddHeaderUser entrata d-flex justify-items-between">
  10. <header class="d-flex justify-content-between"><div class="card-title d-flex align-items-start"><h2>Aggiungi&nbsp;&nbsp;&nbsp;</h2></div><a href="#" wire:click="add()"><i class="ico--ui big add primary"></i></a></header>
  11. </div>
  12. </div>
  13. </header>
  14. <section id="resume-table">
  15. <div class="compare--chart_wrapper d-none"></div>
  16. <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
  17. <thead>
  18. <tr>
  19. <th scope="col">Nome</th>
  20. <th scope="col">IVA</th>
  21. <th scope="col">Abilitato</th>
  22. <th scope="col">...</th>
  23. </tr>
  24. </thead>
  25. <tbody id="checkall-target">
  26. @foreach($records as $record)
  27. <tr>
  28. <td>{{$record->name}}</td>
  29. <td>{{$record->value}}</td>
  30. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  31. <td>
  32. <button type="button" class="btn btn-outline-primary btn-sm" wire:click="edit({{ $record->id }})">Modifica</button>
  33. <button type="button" class="btn btn-outline-danger btn-sm" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})">Elimina</button>
  34. </td>
  35. </tr>
  36. @endforeach
  37. </tbody>
  38. </table>
  39. </section>
  40. @else
  41. <div class="container">
  42. @if (session()->has('error'))
  43. <div class="alert alert-danger" role="alert">
  44. {{ session()->get('error') }}
  45. </div>
  46. @endif
  47. <div class="row">
  48. <div class="col">
  49. <form action="">
  50. <div class="row mb-3">
  51. <div class="col">
  52. <div class="form--item">
  53. <label for="inputName" class="form-label">Nome</label>
  54. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  55. @error('name')
  56. <div class="invalid-feedback">{{ $message }}</div>
  57. @enderror
  58. </div>
  59. </div>
  60. <div class="col">
  61. <div class="form--item">
  62. <label for="inputValue" class="form-label">Valore %</label>
  63. <input class="form-control js-keyupTitle @error('value') is-invalid @enderror" type="text" id="value" placeholder="Valore %" wire:model="value" type="number">
  64. @error('value')
  65. <div class="invalid-feedback">{{ $message }}</div>
  66. @enderror
  67. </div>
  68. </div>
  69. <div class="col">
  70. <div class="form-check form-check-inline">
  71. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  72. <label class="form-check-label" for="enabled">Abilitato</label>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- // inline input field -->
  77. <div class="form--item">
  78. @if($add)
  79. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  80. @endif
  81. @if($update)
  82. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  83. @endif
  84. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. </div>
  90. @endif
  91. </div>
  92. @push('scripts')
  93. <link href="/css/datatables.css" rel="stylesheet" />
  94. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  95. <script src="/assets/js/datatables.js"></script>
  96. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  97. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  98. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  99. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  100. @endpush
  101. @push('scripts')
  102. <script>
  103. $(document).ready(function() {
  104. loadDataTable();
  105. } );
  106. Livewire.on('load-data-table', () => {
  107. loadDataTable();
  108. });
  109. function loadDataTable(){
  110. $('#tablesaw-350').DataTable({
  111. thead: {
  112. 'th': {'background-color': 'blue'}
  113. },
  114. layout: {
  115. topStart: {
  116. buttons: [
  117. {
  118. extend: 'excelHtml5',
  119. title: 'Aliquote IVA',
  120. exportOptions: {
  121. columns: ":not(':last')"
  122. }
  123. },
  124. {
  125. extend: 'pdfHtml5',
  126. title: 'Aliquote IVA',
  127. exportOptions: {
  128. columns: ":not(':last')"
  129. }
  130. },
  131. {
  132. extend: 'print',
  133. text: 'Stampa',
  134. title: 'Aliquote IVA',
  135. exportOptions: {
  136. columns: ":not(':last')"
  137. }
  138. }
  139. ]
  140. }
  141. },
  142. pagingType: 'numbers',
  143. "language": {
  144. "url": "/assets/js/Italian.json"
  145. }
  146. });
  147. $('#tablesaw-350 thead tr th').addClass('col');
  148. $('#tablesaw-350 thead tr th').css("background-color", "#EDF0F2");
  149. }
  150. </script>
  151. @endpush