causal.blade.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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)causali @else Inserimento/modifica causale @endif</h2>
  6. </div>
  7. @if(!$add && !$update)
  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. @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">Nome</th>
  22. <th scope="col">Tipologia</th>
  23. <th scope="col">Abilitato</th>
  24. <th scope="col">...</th>
  25. </tr>
  26. </thead>
  27. <tbody id="checkall-target" wire:sortable="reorder" wire:sortable.options="{ animation: 100 }" wire:sortable-group="reorderGroup">
  28. @foreach($records as $record)
  29. <tr wire:sortable.item="{{ $record->id }}" wire:sortable.triggers="reorder">
  30. <td>{{$record->name}}</td>
  31. <td>{{$record->type == 'IN' ? 'Entrata' : 'Uscita'}}</td>
  32. <td> <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->enabled ? 'active' : 'suspended'}}">{{$record->enabled ? 'attivo' : 'disattivo'}}</span></span></td>
  33. <td>
  34. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  35. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  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. @if(count($record->childs))
  41. @include('livewire/causal_child',['records' => $record->childs, 'indentation' => 1])
  42. @endif
  43. @endforeach
  44. </tbody>
  45. </table>
  46. </section>
  47. @else
  48. <div class="container">
  49. @if (session()->has('error'))
  50. <div class="alert alert-danger" role="alert">
  51. {{ session()->get('error') }}
  52. </div>
  53. @endif
  54. <div class="row">
  55. <div class="col">
  56. <form action="">
  57. <div class="row mb-3">
  58. <div class="col">
  59. <div class="form--item">
  60. <label for="inputName" class="form-label">Nome</label>
  61. <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
  62. @error('name')
  63. <div class="invalid-feedback">{{ $message }}</div>
  64. @enderror
  65. </div>
  66. </div>
  67. </div>
  68. <div class="row mb-3">
  69. <div class="col">
  70. <label for="next_month_expire" class="form-label">Tipologia</label>
  71. <select name="type" class="form-select @error('type') is-invalid @enderror" aria-label="Seleziona una tipologia" wire:model="type">
  72. <option value="">--Seleziona--
  73. <option value="IN">Entrata
  74. <option value="OUT">Uscita
  75. </select>
  76. </div>
  77. </div>
  78. <div class="form--item mb-3">
  79. <div class="form-check form-check-inline">
  80. <input class="form-check-input" type="checkbox" id="enabled" wire:model="enabled">
  81. <label class="form-check-label" for="enabled">Abilitato</label>
  82. </div>
  83. </div>
  84. <div class="form--item mb-3">
  85. <div class="form-check form-check-inline">
  86. <input class="form-check-input" type="checkbox" id="money" wire:model="money">
  87. <label class="form-check-label" for="money">Incrementa borsellino virtuale</label>
  88. </div>
  89. </div>
  90. <div class="form--item mb-3">
  91. <div class="form-check form-check-inline">
  92. <input class="form-check-input" type="checkbox" id="user_status" wire:model="user_status">
  93. <label class="form-check-label" for="user_status">Impatta stato utente</label>
  94. </div>
  95. </div>
  96. <div class="form--item mb-3">
  97. <div class="form-check form-check-inline">
  98. <input class="form-check-input" type="checkbox" id="no_first" wire:model="no_first">
  99. <label class="form-check-label" for="no_first">Escludi dalla prima nota</label>
  100. </div>
  101. </div>
  102. <div class="form--item mb-3">
  103. <div class="form-check form-check-inline">
  104. <input class="form-check-input" type="checkbox" id="no_records" wire:model="no_records">
  105. <label class="form-check-label" for="no_records">Escludi da ingressi/uscite</label>
  106. </div>
  107. </div>
  108. <!-- // inline input field -->
  109. <div class="form--item">
  110. @if($add)
  111. <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
  112. @endif
  113. @if($update)
  114. <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
  115. @endif
  116. <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
  117. </div>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. @endif
  123. </div>
  124. @push('scripts')
  125. <!--
  126. <script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v0.x.x/dist/livewire-sortable.js"></script>
  127. -->
  128. @endpush