rate.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <div class="col card--ui" id="card--dashboard">
  2. <header id="title--section" style="display:none !important"
  3. 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">Rate</h2>
  7. </div>
  8. <!--
  9. <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
  10. <div class="btn--ui entrata d-flex justify-items-between">
  11. <a href="#" wire:click="add()" style="color:white">Aggiungi</a>
  12. </div>
  13. </div>
  14. -->
  15. </header>
  16. <a class="btn--ui lightGrey" href="/course_member?id={{$mc->course_id}}"><i class="fa-solid fa-arrow-left"></i></a><br>
  17. <div class="showFilter" style="display:none" wire:ignore.self>
  18. <hr size="1">
  19. <div class="row g-3">
  20. <div class="col-md-2">
  21. <div class="row">
  22. <div class="col-md-12" style="margin-bottom:10px;">
  23. <b>Periodo</b>
  24. </div>
  25. <div class="col-12 mb-2">
  26. <input id="dateFrom" type="date" class="form-control filterFrom" name="txtFrom">
  27. </div>
  28. <div class="col-12">
  29. <input id="dateTo" type="date" class="form-control filterTo" name="txtTo">
  30. </div>
  31. <div class="col-6 mt-2">
  32. <button class="btn--ui lightGrey todayButton" style="width:100%"
  33. onclick="setToday('{{date("Y-m-d")}}')">OGGI</button>
  34. </div>
  35. <div class="col-6 mt-2">
  36. <button class="btn--ui lightGrey yesterdayButton" style="width:100%"
  37. onclick="setYesterday('{{date("Y-m-d", strtotime("-1 days"))}}')">IERI</button>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="col-md-2">
  42. <div class="row">
  43. <div class="col-md-12" style="margin-bottom:10px;">
  44. <b>Stato</b>
  45. </div>
  46. <div class="col-12">
  47. <select class="form-select filterStatus">
  48. <option value="">--Seleziona--
  49. <option value="1">Attiva
  50. <option value="99">Annullata
  51. </select>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="col-md-3">
  56. <div class="row">
  57. <div class="col-md-12" style="margin-bottom:10px;">
  58. <b>Cerca Utente</b>
  59. </div>
  60. <div class="col-12">
  61. <select class="form-select filterMember" wire:model="filteredMemberId">
  62. <option value="">--Seleziona Utente--</option>
  63. @foreach($members as $member)
  64. <option value="{{ $member->id }}">{{ $member->last_name }} {{ $member->first_name }}
  65. </option>
  66. @endforeach
  67. </select>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row g-3">
  73. <div class="col-md-12" style="text-align:right">
  74. <button class="btn--ui_outline light" onclick="reset()">RESET</button>
  75. <button class="btn--ui" onclick="loadDataTable()">FILTRA</button>
  76. </div>
  77. </div>
  78. <hr size="1">
  79. </div>
  80. <section id="resume-table">
  81. <div class="compare--chart_wrapper d-none"></div>
  82. <h3>{{$detail}}</h3><br>
  83. <table class="table tablesaw tableHead tablesaw-stack table--lista_ricevute" id="tablesaw-350" width="100%">
  84. <thead>
  85. <tr>
  86. <th scope="col"></th>
  87. <th scope="col">Data scadenza</th>
  88. <th scope="col">Rata</th>
  89. <th scope="col">Competenza</th>
  90. <th scope="col">Prezzo</th>
  91. <th scope="col">Stato pagamento</th>
  92. <th scope="col">...</th>
  93. </tr>
  94. </thead>
  95. <tbody id="checkall-target">
  96. @foreach($records as $record)
  97. <tr>
  98. <td></td>
  99. <td>{{date("d/m/Y", strtotime($record->date))}}</td>
  100. <td>{{$record->course_subscription ? $record->course_subscription->name : 'Iscrizione'}}</td>
  101. <td>
  102. @if(sizeof(json_decode($record->months)) > 1)
  103. {{getMonthName(json_decode($record->months)[0])}} - {{getMonthName(json_decode($record->months)[sizeof(json_decode($record->months)) - 1])}}
  104. @else
  105. @if(sizeof(json_decode($record->months)) > 0)
  106. {{getMonthName(json_decode($record->months)[0])}}
  107. @endif
  108. @endif
  109. </td>
  110. <td>{{formatPrice($record->price)}}</td>
  111. <td>
  112. <span class="tablesaw-cell-content">
  113. <span class="badge tessera-badge {{$record->status == 0 ? 'due' : ($record->status == 1 ? 'active' : 'suspended')}}">{{$record->status == 0 ? 'Da pagare' : ($record->status == 1 ? 'Pagato' : 'Sospeso')}}</span>
  114. </span>
  115. </td>
  116. <td>
  117. @if($record->status == 1)
  118. <button type="button" class="btn u"
  119. onclick="document.location.href='/in?id={{$record->record_id}}'" data-bs-toggle="popover"
  120. data-bs-trigger="hover focus" data-bs-placement="bottom"
  121. data-bs-content="Visualizza ricevuta"><i class="fa-regular fa-eye"></i></button>
  122. @endif
  123. @if($record->status == 0)
  124. <a class="btn u" href="/in?new=1&memberId={{$record->member_id}}&causalId={{!$record->is_subscription ? $record->member_course->course->causal_id : ''}}&subCausalId={{$record->is_subscription ? $record->member_course->course->sub_causal_id : ''}}&createSubscription={{$record->is_subscription ? '1' : ''}}&months={{implode("|", json_decode($record->months))}}&price={{!$record->is_subscription ? $record->price : ''}}&subscription_price={{$record->is_subscription ? $record->price : ''}}&courseId={{$record->member_course_id}}&rateId={{$record->id}}" data-bs-toggle="popover"
  125. data-bs-trigger="hover focus" data-bs-placement="bottom"
  126. data-bs-content="Crea entrata"><i class="fa-regular fa-file-lines"></i></a>
  127. <a class="btn u" onclick="confirmDelete({{$record->id}})" data-bs-toggle="popover"
  128. data-bs-trigger="hover focus" data-bs-placement="bottom"
  129. data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
  130. @endif
  131. </td>
  132. </tr>
  133. @endforeach
  134. </tbody>
  135. </table>
  136. </section>
  137. </div>
  138. @push('scripts')
  139. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  140. <style>
  141. .select2-container--default .select2-selection--single {
  142. background-color: #E9F0F5;
  143. border: 0.0625rem solid #DFE5EB;
  144. font-size: 0.75rem;
  145. }
  146. .select2-selection {
  147. height: 38px !important;
  148. }
  149. .select2-selection__rendered {
  150. padding-top: 3px;
  151. }
  152. .select2 {
  153. width: 100% !important;
  154. }
  155. </style>
  156. <script src="https://code.jquery.com/jquery-2.2.4.min.js"
  157. integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  158. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  159. @endpush
  160. @push('scripts')
  161. <link href="/css/datatables.css" rel="stylesheet" />
  162. <script src="https://code.jquery.com/jquery-2.2.4.min.js"
  163. integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  164. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  165. <style>
  166. .select2-container--default .select2-selection--single {
  167. background-color: #E9F0F5;
  168. border: 0.0625rem solid #DFE5EB;
  169. font-size: 0.75rem;
  170. }
  171. .select2-selection {
  172. height: 38px !important;
  173. }
  174. .select2-selection__rendered {
  175. padding-top: 3px;
  176. }
  177. .select2 {
  178. width: 100% !important;
  179. }
  180. .select2-selection--multiple {
  181. overflow: hidden !important;
  182. height: auto !important;
  183. }
  184. .select2-container {
  185. box-sizing: border-box;
  186. display: inline-block;
  187. margin: 0;
  188. position: relative;
  189. vertical-align: middle;
  190. }
  191. .select2-container .select2-selection--single {
  192. box-sizing: border-box;
  193. cursor: pointer;
  194. display: block;
  195. height: 38px;
  196. user-select: none;
  197. -webkit-user-select: none;
  198. }
  199. .select2-container .select2-selection--single .select2-selection__rendered {
  200. display: block;
  201. padding-left: 8px;
  202. padding-right: 20px;
  203. overflow: hidden;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. }
  207. .select2-selection__choice__display {
  208. color: #000000 !important;
  209. }
  210. </style>
  211. <script src="https://code.jquery.com/jquery-2.2.4.min.js"
  212. integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  213. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  214. <script src="/assets/js/datatables.js"></script>
  215. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  216. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  217. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  218. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  219. @endpush
  220. @push('scripts')
  221. <script>
  222. function confirmDelete(id)
  223. {
  224. if (confirm('Confermi di voler eliminare la rata?'))
  225. {
  226. @this.delete(id);
  227. }
  228. }
  229. $(document).ready(function() {
  230. loadDataTable();
  231. } );
  232. Livewire.on('load-data-table', () => {
  233. loadDataTable();
  234. });
  235. function loadDataTable(){
  236. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  237. $('#tablesaw-350').DataTable().destroy();
  238. }
  239. $('#tablesaw-350').DataTable({
  240. thead: {
  241. 'th': {'background-color': 'blue'}
  242. },
  243. layout: {
  244. topStart : null,
  245. topEnd : null,
  246. top1A: {
  247. buttons: [
  248. {
  249. extend: 'collection',
  250. text: 'ESPORTA',
  251. buttons: [
  252. {
  253. extend: 'excelHtml5',
  254. title: 'Metodi di pagamento',
  255. exportOptions: {
  256. columns: ":not(':last')"
  257. }
  258. },
  259. {
  260. extend: 'pdfHtml5',
  261. title: 'Metodi di pagamento',
  262. exportOptions: {
  263. columns: ":not(':last')"
  264. }
  265. },
  266. {
  267. extend: 'print',
  268. text: 'Stampa',
  269. title: 'Metodi di pagamento',
  270. exportOptions: {
  271. columns: ":not(':last')"
  272. }
  273. }
  274. ],
  275. dropup: true
  276. }
  277. ]
  278. },
  279. top1B : {
  280. pageLength: {
  281. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  282. }
  283. },
  284. top1C :'search',
  285. },
  286. pagingType: 'numbers',
  287. "language": {
  288. "url": "/assets/js/Italian.json"
  289. },
  290. "fnInitComplete": function (oSettings, json) {
  291. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  292. $(".dt-search").append(html);
  293. }
  294. });
  295. $('#tablesaw-350 thead tr th').addClass('col');
  296. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  297. $(document).ready(function() {
  298. $(document).on("click",".addData",function() {
  299. $(".title--section_addButton").trigger("click")
  300. });
  301. } );
  302. }
  303. </script>
  304. @endpush