province.blade.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <div class="col card--ui" id="card--dashboard">
  2. <header id="title--section" 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)Elenco Province @else Inserimento/modifica provincia @endif</h2>
  6. </div>
  7. @if(!$add && !$update)
  8. <div class="title--section_addButton">
  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. @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" data-tablesaw="" id="tablesaw-350">
  19. <thead>
  20. <tr>
  21. <th scope="col">Nazione</th>
  22. <th scope="col">Codice</th>
  23. <th scope="col">Nome</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->nation->name}}</td>
  32. <td>{{$record->code}}</td>
  33. <td>{{$record->name}}</td>
  34. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  35. <td>
  36. <button type="button" class="btn btn-outline-primary btn-sm" wire:click="edit({{ $record->id }})">Modifica</button>
  37. <button type="button" class="btn btn-outline-danger btn-sm" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})">Elimina</button>
  38. </td>
  39. </tr>
  40. @endforeach
  41. </tbody>
  42. </table>
  43. <!--
  44. <div class="paginator d-flex justify-content-center">
  45. <nav aria-label="Page navigation example">
  46. <ul class="pagination">
  47. <li class="page-item">
  48. <a class="page-link" href="#" aria-label="Previous">
  49. <span aria-hidden="true"></span>
  50. </a>
  51. </li>
  52. <li class="page-item"><a class="page-link" href="#">1</a></li>
  53. <li class="page-item"><a class="page-link" href="#">2</a></li>
  54. <li class="page-item"><a class="page-link" href="#">3</a></li>
  55. <li class="page-item"><a class="page-link" href="#">3</a></li>
  56. <li class="page-item"><span class="more-page">...</span></li>
  57. <li class="page-item">
  58. <a class="page-link" href="#" aria-label="Next">
  59. <span aria-hidden="true"></span>
  60. </a>
  61. </li>
  62. </ul>
  63. </nav>
  64. </div>
  65. -->
  66. </section>
  67. @else
  68. <div class="container">
  69. @if (session()->has('error'))
  70. <div class="alert alert-danger" role="alert">
  71. {{ session()->get('error') }}
  72. </div>
  73. @endif
  74. <div class="row">
  75. <div class="col">
  76. <form action="">
  77. <div class="row mb-3">
  78. <div class="col">
  79. <div class="form--item">
  80. <label for="code" class="form-label">Codice</label>
  81. <input class="form-control" type="text" id="code" placeholder="Codice" wire:model="code">
  82. </div>
  83. </div>
  84. <div class="col">
  85. <div class="form--item">
  86. <label for="inputName" class="form-label">Nome</label>
  87. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  88. @error('name')
  89. <div class="invalid-feedback">{{ $message }}</div>
  90. @enderror
  91. </div>
  92. </div>
  93. </div>
  94. <div class="row mb-3">
  95. <div class="col">
  96. <label for="nation_id" class="form-label">Nazione</label>
  97. <select name="nation_id" class="form-select @error('nation_id') is-invalid @enderror" aria-label="Seleziona una nazione" wire:model="nation_id">
  98. <option value="">--Seleziona--
  99. @foreach($nations as $nation)
  100. <option value="{{$nation->id}}">{{$nation->name}}
  101. @endforeach
  102. </select>
  103. </div>
  104. <div class="col">
  105. <div class="form--item">
  106. <div class="form-check form-check-inline">
  107. <label class="form-check-label" for="enabled">Abilitato</label><br>
  108. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!-- // inline input field -->
  114. <div class="form--item">
  115. @if($add)
  116. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  117. @endif
  118. @if($update)
  119. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  120. @endif
  121. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  122. </div>
  123. </form>
  124. </div>
  125. </div>
  126. </div>
  127. @endif
  128. </div>