nation.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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)Nazioni @else Inserimento/modifica nazione @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. <!--<button id="open-filter" onclick="pcsh1()"></button>
  17. <button id="close-filter" onclick="pcsh2()"></button>-->
  18. <!--
  19. <section id="subheader" class="d-flex align-items-center justify-content-between">
  20. <form action="" class="group--action d-flex align-items-center">
  21. <select class="form-select form-select-lg me-1" aria-label=".form-select-lg example">
  22. <option selected>Open this select menu</option>
  23. <option value="1">One</option>
  24. <option value="2">Two</option>
  25. <option value="3">Three</option>
  26. </select>
  27. <button type="submit" class="btn--ui">applica</button>
  28. </form>
  29. <form action="" class="search--form d-flex align-items-center">
  30. <div class="input-group mb-3">
  31. <input type="text" class="form-control" placeholder="Cerca utente" aria-label="cerca utent" aria-describedby="button-addon2">
  32. <button class="btn--ui" type="button" id="button-addon2"><i class="ico--ui search"></i>Cerca</button>
  33. </div>
  34. </form>
  35. </section>
  36. -->
  37. <section id="resume-table">
  38. <div class="compare--chart_wrapper d-none"></div>
  39. <table class="table tablesaw tablesaw-stack" id="tablesaw-350" width="100%">
  40. <thead>
  41. <tr>
  42. <th scope="col">Codice</th>
  43. <th scope="col">Nome</th>
  44. <th scope="col">Abilitato</th>
  45. <th scope="col">...</th>
  46. </tr>
  47. </thead>
  48. <tbody id="checkall-target">
  49. @foreach($records as $record)
  50. <tr>
  51. <td>{{$record->code}}</td>
  52. <td>{{$record->name}}</td>
  53. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  54. <td>
  55. <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" onclick="hidePop(this)" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
  56. <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="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  57. </td>
  58. </tr>
  59. @endforeach
  60. </tbody>
  61. </table>
  62. <!--
  63. <div class="paginator d-flex justify-content-center">
  64. <nav aria-label="Page navigation example">
  65. <ul class="pagination">
  66. <li class="page-item">
  67. <a class="page-link" href="#" aria-label="Previous">
  68. <span aria-hidden="true"></span>
  69. </a>
  70. </li>
  71. <li class="page-item"><a class="page-link" href="#">1</a></li>
  72. <li class="page-item"><a class="page-link" href="#">2</a></li>
  73. <li class="page-item"><a class="page-link" href="#">3</a></li>
  74. <li class="page-item"><a class="page-link" href="#">3</a></li>
  75. <li class="page-item"><span class="more-page">...</span></li>
  76. <li class="page-item">
  77. <a class="page-link" href="#" aria-label="Next">
  78. <span aria-hidden="true"></span>
  79. </a>
  80. </li>
  81. </ul>
  82. </nav>
  83. </div>
  84. -->
  85. </section>
  86. @else
  87. <div class="container">
  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="code" class="form-label">Codice</label>
  100. <input class="form-control" type="text" id="code" placeholder="Codice" wire:model="code">
  101. </div>
  102. </div>
  103. <div class="col">
  104. <div class="form--item">
  105. <label for="inputName" class="form-label">Nome</label>
  106. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  107. @error('name')
  108. <div class="invalid-feedback">{{ $message }}</div>
  109. @enderror
  110. </div>
  111. </div>
  112. </div>
  113. <div class="form--item mb-3">
  114. <div class="form-check form-check-inline">
  115. <input class="form-check-input" type="checkbox" id="isItaly" wire:model="isItaly">
  116. <label class="form-check-label" for="isItaly">Italia?</label>
  117. </div>
  118. <div class="form-check form-check-inline">
  119. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  120. <label class="form-check-label" for="enabled">Abilitato</label>
  121. </div>
  122. </div>
  123. <!-- // inline input field -->
  124. <div class="form--item">
  125. @if($add)
  126. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  127. @endif
  128. @if($update)
  129. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  130. @endif
  131. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  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. fixedHeader: true,
  162. thead: {
  163. 'th': {'background-color': 'blue'}
  164. },
  165. layout: {
  166. topStart: {
  167. buttons: [
  168. {
  169. extend: 'excelHtml5',"action":newexportaction,
  170. title: 'Nazioni',
  171. exportOptions: {
  172. columns: ":not(':last')"
  173. }
  174. },
  175. {
  176. extend: 'pdfHtml5',"action":newexportaction,
  177. title: 'Nazioni',
  178. exportOptions: {
  179. columns: ":not(':last')"
  180. }
  181. },
  182. {
  183. extend: 'print',"action":newexportaction,
  184. text: 'Stampa',
  185. title: 'Nazioni',
  186. exportOptions: {
  187. columns: ":not(':last')"
  188. }
  189. }
  190. ]
  191. }
  192. },
  193. pagingType: 'numbers',
  194. "language": {
  195. "url": "/assets/js/Italian.json"
  196. }
  197. });
  198. $('#tablesaw-350 thead tr th').addClass('col');
  199. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  200. }
  201. </script>
  202. @endpush