course_member_two.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. <th scope="col">Giorni</th>
  19. <th scope="col">Istruttore</th>
  20. <th scope="col">...</th>
  21. </tr>
  22. </thead>
  23. <tbody id="checkall-target">
  24. @foreach($records as $record)
  25. <tr>
  26. <td>{{$record->name}}</td>
  27. <td>{{$record->frequency->name ?? ""}}</td>
  28. <td>{{$record->level->name ?? ""}}</td>
  29. <td></td>
  30. <td></td>
  31. <td>{{$record->getins->name ?? ""}}</td>
  32. <td>
  33. <a href="/course_member?id={{$record->id}}" type="button" class="btn" >></button>
  34. </td>
  35. </tr>
  36. @endforeach
  37. </tbody>
  38. </table>
  39. </section>
  40. </div>
  41. @push('scripts')
  42. <link href="/css/datatables.css" rel="stylesheet" />
  43. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  44. <script src="/assets/js/datatables.js"></script>
  45. <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
  46. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
  47. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  48. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  49. @endpush
  50. @push('scripts')
  51. <script>
  52. $(document).ready(function() {
  53. loadDataTable();
  54. } );
  55. Livewire.on('load-data-table', () => {
  56. loadDataTable();
  57. });
  58. function loadDataTable(){
  59. if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
  60. $('#tablesaw-350').DataTable().destroy();
  61. }
  62. $('#tablesaw-350').DataTable({
  63. thead: {
  64. 'th': {'background-color': 'blue'}
  65. },
  66. layout: {
  67. topStart : null,
  68. topEnd : null,
  69. top1A: {
  70. buttons: [
  71. {
  72. extend: 'collection',
  73. text: 'ESPORTA',
  74. buttons: [
  75. {
  76. extend: 'excelHtml5',
  77. title: 'Durata corsi',
  78. exportOptions: {
  79. columns: ":not(':last')"
  80. }
  81. },
  82. {
  83. extend: 'pdfHtml5',
  84. title: 'Durata corsi',
  85. exportOptions: {
  86. columns: ":not(':last')"
  87. }
  88. },
  89. {
  90. extend: 'print',
  91. text: 'Stampa',
  92. title: 'Durata corsi',
  93. exportOptions: {
  94. columns: ":not(':last')"
  95. }
  96. }
  97. ],
  98. dropup: true
  99. }
  100. ]
  101. },
  102. top1B : {
  103. pageLength: {
  104. menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
  105. }
  106. },
  107. top1C :'search',
  108. },
  109. pagingType: 'numbers',
  110. "language": {
  111. "url": "/assets/js/Italian.json"
  112. },
  113. "fnInitComplete": function (oSettings, json) {
  114. var html = '&nbsp;<a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
  115. $(".dt-search").append(html);
  116. }
  117. });
  118. $('#tablesaw-350 thead tr th').addClass('col');
  119. $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
  120. $(document).ready(function() {
  121. $(document).on("click",".addData",function() {
  122. $(".title--section_addButton").trigger("click")
  123. });
  124. } );
  125. }
  126. </script>
  127. @endpush