course_member_two.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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">Corsi</h2>
  6. </div>
  7. </header>
  8. {{-- <a class="btn--ui lightGrey" href="/course_member_one"><i class="fa-solid fa-arrow-left"></i></a><br> --}}
  9. <section id="resume-table">
  10. <div class="compare--chart_wrapper d-none"></div>
  11. <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
  12. <thead>
  13. <tr>
  14. <th scope="col">Disciplina</th>
  15. <th scope="col">Nome</th>
  16. <th scope="col">Frequenza</th>
  17. <th scope="col">Livello</th>
  18. {{-- <th scope="col">Durata</th> --}}
  19. @if($_GET["type"] != "custom")
  20. <th scope="col">Giorni</th>
  21. @endif
  22. <th scope="col">Istruttore</th>
  23. <th scope="col">N° partecipanti</th>
  24. <th scope="col">...</th>
  25. </tr>
  26. </thead>
  27. <tbody id="checkall-target">
  28. @foreach($records as $record)
  29. <tr>
  30. <td>{{$record->discipline?->name ?? '-'}}</td>
  31. <td>{{$record->name}}</td>
  32. <td>{{$record->frequency->name ?? ""}}</td>
  33. <td>{{$record->level->name ?? ""}}</td>
  34. {{-- <td>{{date("d/m/Y", strtotime($record->date_from))}} - {{date("d/m/Y", strtotime($record->date_to))}} </td> --}}
  35. @if($_GET["type"] != "custom")
  36. <td>
  37. @if($record->when != null)
  38. @foreach(json_decode($record->when) as $xx => $x)
  39. @if($xx > 0)
  40. <br>
  41. @endif
  42. @foreach($x->day as $zz => $d)
  43. {{$zz > 0 ? '-' : ''}}{{$d}}
  44. @endforeach
  45. h {{$x->from}} - {{$x->to}}
  46. @endforeach
  47. @endif
  48. </td>
  49. @endif
  50. <td>{{$record->getins->name ?? ""}} {{$record->getins->cognome ?? ""}}</td>
  51. <td>{{$record->getCount()}}</td>
  52. <td>
  53. <a href="/course_member?id={{$record->id}}" type="button" class="btn" ><b> <i class="fa-solid fa-chevron-right"></i></b></button>
  54. </td>
  55. </tr>
  56. @endforeach
  57. </tbody>
  58. </table>
  59. </section>
  60. </div>
  61. @push('scripts')
  62. <link href="/css/datatables.css" rel="stylesheet" />
  63. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  64. <script src="/assets/js/datatables.js"></script>
  65. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  66. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  67. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  68. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  69. @endpush
  70. @push('scripts')
  71. <script>
  72. $(document).ready(function() {
  73. loadDataTable();
  74. } );
  75. Livewire.on('load-data-table', () => {
  76. loadDataTable();
  77. });
  78. function loadDataTable(){
  79. let date = new Date();
  80. let date_export = `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}_`;
  81. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  82. $('#tablesaw-350').DataTable().destroy();
  83. }
  84. $('#tablesaw-350').DataTable({
  85. processing: true,
  86. stateSave: true,
  87. thead: {
  88. 'th': {'background-color': 'blue'}
  89. },
  90. layout: {
  91. topStart : null,
  92. topEnd : null,
  93. top1A: {
  94. // buttons: [
  95. // {
  96. // extend: 'collection',
  97. // text: 'ESPORTA',
  98. buttons: [
  99. {
  100. extend: 'excelHtml5',
  101. text: '<i class="fa-solid fa-file-excel"></i>',
  102. action: newexportaction,
  103. title: date_export + 'Corsi',
  104. filename: date_export + 'Corsi',
  105. exportOptions: {
  106. columns: ":not(':last')"
  107. }
  108. },
  109. {
  110. extend: 'pdfHtml5',
  111. text: '<i class="fa-solid fa-file-pdf"></i>',
  112. action: newexportaction,
  113. title: date_export + 'Corsi',
  114. filename: date_export + 'Corsi',
  115. exportOptions: {
  116. columns: ":not(':last')"
  117. }
  118. },
  119. {
  120. extend: 'print',
  121. action: newexportaction,
  122. text: '<i class="fa-solid fa-print"></i>',
  123. title: date_export + 'Corsi',
  124. filename: date_export + 'Corsi',
  125. exportOptions: {
  126. columns: ":not(':last')"
  127. }
  128. }
  129. ],
  130. // dropup: true
  131. // }
  132. // ]
  133. },
  134. top1B : {
  135. pageLength: {
  136. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  137. }
  138. },
  139. top1C :'search',
  140. bottomEnd: {
  141. paging: {
  142. boundaryNumbers: false
  143. }
  144. }
  145. },
  146. pagingType: 'first_last_numbers',
  147. language: {
  148. "url": "/assets/js/Italian.json",
  149. paginate: {
  150. first: '<i class="fa-solid fa-angles-left"></i>',
  151. last: '<i class="fa-solid fa-angles-right"></i>',
  152. }
  153. },/*,
  154. "fnInitComplete": function (oSettings, json) {
  155. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  156. $(".dt-search").append(html);
  157. }*/
  158. });
  159. $('#tablesaw-350 thead tr th').addClass('col');
  160. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  161. $(document).ready(function() {
  162. $(document).on("click",".addData",function() {
  163. $(".title--section_addButton").trigger("click")
  164. });
  165. } );
  166. }
  167. </script>
  168. @endpush