subscription_members.blade.php 6.4 KB

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