course_member_two.blade.php 7.6 KB

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