Browse Source

modifiche action esportazione tabelle

ferrari 3 tháng trước cách đây
mục cha
commit
90a17b3c5b
30 tập tin đã thay đổi với 258 bổ sung91 xóa
  1. 4 0
      public/css/new_style.css
  2. 94 28
      resources/views/layouts/app.blade.php
  3. 5 1
      resources/views/livewire/bank.blade.php
  4. 5 1
      resources/views/livewire/card.blade.php
  5. 4 0
      resources/views/livewire/city.blade.php
  6. 5 2
      resources/views/livewire/course.blade.php
  7. 5 1
      resources/views/livewire/course_duration.blade.php
  8. 5 1
      resources/views/livewire/course_frequency.blade.php
  9. 5 1
      resources/views/livewire/course_level.blade.php
  10. 5 2
      resources/views/livewire/course_list_original.blade.php
  11. 7 3
      resources/views/livewire/course_member.blade.php
  12. 5 1
      resources/views/livewire/course_member_one.blade.php
  13. 5 1
      resources/views/livewire/course_member_two.blade.php
  14. 5 1
      resources/views/livewire/course_subscription.blade.php
  15. 5 1
      resources/views/livewire/course_type.blade.php
  16. 5 1
      resources/views/livewire/discipline.blade.php
  17. 4 0
      resources/views/livewire/email_comunications.blade.php
  18. 23 33
      resources/views/livewire/member.blade.php
  19. 4 0
      resources/views/livewire/nation.blade.php
  20. 5 1
      resources/views/livewire/payment_method.blade.php
  21. 4 0
      resources/views/livewire/province.blade.php
  22. 5 1
      resources/views/livewire/rate.blade.php
  23. 7 3
      resources/views/livewire/records_in.blade.php
  24. 8 3
      resources/views/livewire/records_out.blade.php
  25. 5 1
      resources/views/livewire/reminders.blade.php
  26. 5 1
      resources/views/livewire/sms_comunications.blade.php
  27. 4 0
      resources/views/livewire/sponsor.blade.php
  28. 5 1
      resources/views/livewire/supplier.blade.php
  29. 5 1
      resources/views/livewire/user.blade.php
  30. 5 1
      resources/views/livewire/vat.blade.php

+ 4 - 0
public/css/new_style.css

@@ -1088,3 +1088,7 @@ table#recipients-table td {
 .recipients .recipient span.recipient-name {
     font-weight: bold;
 }
+
+body div.dt-processing {
+    z-index: 1000;
+}

+ 94 - 28
resources/views/layouts/app.blade.php

@@ -458,53 +458,119 @@
 
     <script>
         function newexportaction(e, dt, button, config, cb) {
-            var self = this;
-            var oldStart = dt.settings()[0]._iDisplayStart;
-
-            dt.one('preXhr', function (e, s, data) {
-                data.start = 0;
-                data.length = 10000;
-            });
-
-            dt.one('preDraw', function (e, settings) {
-                if (button[0].className.includes('buttons-copy')) {
+            const self = this;
+            const settings = dt.settings()[0];
+            const isServerSide = settings.oFeatures && settings.oFeatures.bServerSide;
+            const hasAjax = !!settings.ajax;
+
+            // --- CLIENT-SIDE ---
+            if (!isServerSide || !hasAjax) {
+                // Esporta tutte le righe lato client
+                const origExportOptions = config.exportOptions ? {...config.exportOptions} : {};
+                config.exportOptions = config.exportOptions || {};
+                config.exportOptions.modifier = {...(config.exportOptions.modifier || {}), page: 'all'};
+
+                // PDF: tabella full-width
+                // const isPdf = button[0].className.indexOf('buttons-pdf') >= 0;
+                // const origCustomize = config.customize;
+                // if (isPdf) {
+                //     config.customize = function(doc) {
+                //         const table = doc.content[1] && doc.content[1].table ? doc.content[1].table : null;
+                //         if (table && table.body && table.body[0]) {
+                //             table.widths = Array(table.body[0].length).fill('*');
+                //         }
+                //         if (typeof origCustomize === 'function') origCustomize(doc);
+                //     };
+                // }
+
+                const cls = button[0].className;
+                if (cls.includes('buttons-copy')) {
                     $.fn.dataTable.ext.buttons.copyHtml5.action.call(self, e, dt, button, config, cb);
-                } else if (button[0].className.includes('buttons-excel')) {
-                    ($.fn.dataTable.ext.buttons.excelHtml5.available(dt, config) 
+                } else if (cls.includes('buttons-excel')) {
+                    ($.fn.dataTable.ext.buttons.excelHtml5.available(dt, config)
                         ? $.fn.dataTable.ext.buttons.excelHtml5
                         : $.fn.dataTable.ext.buttons.excelFlash
                     ).action.call(self, e, dt, button, config, cb);
-                } else if (button[0].className.includes('buttons-csv')) {
+                } else if (cls.includes('buttons-csv')) {
                     ($.fn.dataTable.ext.buttons.csvHtml5.available(dt, config)
                         ? $.fn.dataTable.ext.buttons.csvHtml5
                         : $.fn.dataTable.ext.buttons.csvFlash
                     ).action.call(self, e, dt, button, config, cb);
-                } else if (button[0].className.includes('buttons-pdf')) {
+                } else if (cls.includes('buttons-pdf')) {
                     ($.fn.dataTable.ext.buttons.pdfHtml5.available(dt, config)
                         ? $.fn.dataTable.ext.buttons.pdfHtml5
                         : $.fn.dataTable.ext.buttons.pdfFlash
                     ).action.call(self, e, dt, button, config, cb);
-                } else if (button[0].className.includes('buttons-print')) {
+                } else if (cls.includes('buttons-print')) {
                     $.fn.dataTable.ext.buttons.print.action.call(self, e, dt, button, config, cb);
                 }
 
-                // Ripristina la paginazione
-                dt.one('preXhr', function (e, s, data) {
-                    settings._iDisplayStart = oldStart;
-                    data.start = oldStart;
-                    data.length = s._iDisplayLength;
-                });
+                // Ripristina config
+                config.exportOptions = origExportOptions;
+                // if (isPdf) config.customize = origCustomize;
 
-                // Reload con callback (DataTables 2.x)
-                dt.ajax.reload(() => {
-                    if (typeof cb === 'function') cb();
-                }, false);
+                if (typeof cb === 'function') cb();
+                return;
+            }
 
-                return false;
+            // --- SERVER-SIDE + AJAX: fetch completo poi export ---
+            const info = dt.page.info();
+            const oldStart = info.start;
+            const oldLength = info.length;
+            const targetLength = info.recordsTotal > 0 ? info.recordsTotal : 2147483647;
+
+            dt.one('preXhr', function (e2, s, data) {
+                data.start = 0;
+                data.length = targetLength;
+
+                dt.one('preDraw', function (e3, stg) {
+                    const cls = button[0].className;
+
+                    if (cls.includes('buttons-copy')) {
+                        $.fn.dataTable.ext.buttons.copyHtml5.action.call(self, e, dt, button, config, cb);
+                    } else if (cls.includes('buttons-excel')) {
+                        ($.fn.dataTable.ext.buttons.excelHtml5.available(dt, config)
+                            ? $.fn.dataTable.ext.buttons.excelHtml5
+                            : $.fn.dataTable.ext.buttons.excelFlash
+                        ).action.call(self, e, dt, button, config, cb);
+                    } else if (cls.includes('buttons-csv')) {
+                        ($.fn.dataTable.ext.buttons.csvHtml5.available(dt, config)
+                            ? $.fn.dataTable.ext.buttons.csvHtml5
+                            : $.fn.dataTable.ext.buttons.csvFlash
+                        ).action.call(self, e, dt, button, config, cb);
+                    } else if (cls.includes('buttons-pdf')) {
+                        // Full-width PDF
+                        // const origCustomize = config.customize;
+                        // config.customize = function(doc) {
+                        //     const t = doc.content[1] && doc.content[1].table ? doc.content[1].table : null;
+                        //     if (t && t.body && t.body[0]) t.widths = Array(t.body[0].length).fill('*');
+                        //     if (typeof origCustomize === 'function') origCustomize(doc);
+                        // };
+                        ($.fn.dataTable.ext.buttons.pdfHtml5.available(dt, config)
+                            ? $.fn.dataTable.ext.buttons.pdfHtml5
+                            : $.fn.dataTable.ext.buttons.pdfFlash
+                        ).action.call(self, e, dt, button, config, cb);
+                        // config.customize = origCustomize;
+                    } else if (cls.includes('buttons-print')) {
+                        $.fn.dataTable.ext.buttons.print.action.call(self, e, dt, button, config, cb);
+                    }
+
+                    dt.one('preXhr', function (e4, s2, data2) {
+                        data2.start = oldStart;
+                        data2.length = oldLength;
+                        stg._iDisplayStart = oldStart;
+                    });
+
+                    setTimeout(() => {
+                        dt.ajax.reload(() => { if (typeof cb === 'function') cb(); }, false);
+                    }, 0);
+
+                    return false;
+                });
             });
-            // Requery the server with the new one-time export settings
+
             dt.ajax.reload();
-        };
+            }
     </script>
 
     @stack('scripts')

+ 5 - 1
resources/views/livewire/bank.blade.php

@@ -172,6 +172,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -185,7 +186,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Banche',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -193,6 +195,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Banche',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -200,6 +203,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Banche',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/card.blade.php

@@ -234,6 +234,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 layout: {
                     topStart : null,
                     topEnd : null,
@@ -244,7 +245,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Tessere',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -252,6 +254,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Tessere',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -259,6 +262,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Tessere',
                                         exportOptions: {

+ 4 - 0
resources/views/livewire/city.blade.php

@@ -143,6 +143,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -151,6 +152,7 @@
                         buttons: [
                             {
                                 extend: 'excelHtml5',
+                                action: newexportaction,
                                 title: 'Comuni',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -158,6 +160,7 @@
                             },
                             {
                                 extend: 'pdfHtml5',
+                                action: newexportaction,
                                 title: 'Comuni',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -165,6 +168,7 @@
                             },
                             {
                                 extend: 'print',
+                                action: newexportaction,
                                 text: 'Stampa',
                                 title: 'Comuni',
                                 exportOptions: {

+ 5 - 2
resources/views/livewire/course.blade.php

@@ -515,7 +515,7 @@
             }
 
             $('#tablesaw-350').DataTable({
-
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -529,7 +529,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -537,6 +538,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -544,6 +546,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_duration.blade.php

@@ -139,6 +139,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -152,7 +153,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -160,6 +162,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -167,6 +170,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Durata corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_frequency.blade.php

@@ -126,6 +126,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -139,7 +140,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Frequenza corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -147,6 +149,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Frequenza corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -154,6 +157,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Frequenza corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_level.blade.php

@@ -126,6 +126,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -139,7 +140,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Livello corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -147,6 +149,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Livello corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -154,6 +157,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Livello corsi',
                                         exportOptions: {

+ 5 - 2
resources/views/livewire/course_list_original.blade.php

@@ -538,6 +538,7 @@
                 //scrollCollapse: true,
                 scrollY: '400px',
                 serverSide: true,
+                processing: true,
                 ajax: {
                     url : '/get_course_list?filterCourse=' + filterCourse + '&filterDuration=' + filterDuration + '&filterLevel=' + filterLevel + '&filterType=' + filterType + '&filterFrequency=' + filterFrequency + '&filterYear=' + filterYear,
                     dataSrc: function (json){
@@ -827,7 +828,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                        extend: 'excelHtml5',"action":newexportaction,
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Pagamento corsi',
                                         orientation: 'landscape',
                                         exportOptions: {
@@ -868,7 +870,8 @@
 
                                     },
                                     {
-                                        extend: 'pdfHtml5',"action":newexportaction,
+                                        extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Pagamento corsi',
                                         orientation: 'landscape',
                                         exportOptions: {

+ 7 - 3
resources/views/livewire/course_member.blade.php

@@ -634,6 +634,7 @@
 
             $('#tablesaw-350').DataTable({
                 serverSide: true,
+                processing: true,
                 ajax: {
                     url: '/get_course_members?filterCourse=' + filterCourse + '&filterDuration=' + filterDuration + '&filterLevel=' + filterLevel + '&filterType=' + filterType + '&filterFrequency=' + filterFrequency + '&filterDays=' + filterDays + '&filterHours=' + filterHours + '&filterStatus=' + filterStatus + '&filterSubscription=' + filterSubscription + '&filterYear=' + filterYear + '&filterCards=' + filterCards + '&filterCertificateScadenza=' + filterCertificateScadenza + '&filterCertificateType=' + filterCertificateType + '&fromYear=' + fromYear + '&toYear=' + toYear + '&fromFromYear=' + fromFromYear + '&toToYear=' + toToYear + filterFromPrevious,
                     /*dataSrc: function (json){
@@ -720,21 +721,24 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                        extend: 'excelHtml5', "action": newexportaction,
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Iscritti corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'pdfHtml5', "action": newexportaction,
+                                        extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Iscritti corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'print', "action": newexportaction,
+                                        extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Iscritti corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_member_one.blade.php

@@ -62,6 +62,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -75,7 +76,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -83,6 +85,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -90,6 +93,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Durata corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_member_two.blade.php

@@ -90,6 +90,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -103,7 +104,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -111,6 +113,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Durata corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -118,6 +121,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Durata corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_subscription.blade.php

@@ -161,6 +161,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -174,7 +175,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Iscritti corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -182,6 +184,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Iscritti corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -189,6 +192,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Iscritti corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/course_type.blade.php

@@ -126,6 +126,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -139,7 +140,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Tipologia corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -147,6 +149,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Tipologia corsi',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -154,6 +157,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Tipologia corsi',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/discipline.blade.php

@@ -126,6 +126,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -139,7 +140,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Discipline',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -147,6 +149,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Discipline',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -154,6 +157,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Discipline',
                                         exportOptions: {

+ 4 - 0
resources/views/livewire/email_comunications.blade.php

@@ -507,6 +507,7 @@
         }
 
         $('#tablesaw-350').DataTable({
+            processing: true,
             thead: {
                 'th': {'background-color': 'blue'}
             },
@@ -522,6 +523,7 @@
                             buttons: [
                                 {
                                     extend: 'excelHtml5',
+                                    action: newexportaction,
                                     title: 'Email',
                                     exportOptions: {
                                         columns: ":not(':last')"
@@ -529,6 +531,7 @@
                                 },
                                 {
                                     extend: 'pdfHtml5',
+                                    action: newexportaction,
                                     title: 'Email',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -536,6 +539,7 @@
                                     },
                                 {
                                     extend: 'print',
+                                    action: newexportaction,
                                     text: 'Stampa',
                                     title: 'Email',
                                     exportOptions: {

+ 23 - 33
resources/views/livewire/member.blade.php

@@ -2038,42 +2038,29 @@
 
 
         function loadDataTable() {
-            if ($.fn.DataTable.isDataTable('#tablesaw-350')) {
-                $('#tablesaw-350').DataTable().destroy();
+            const url = '/get_members?cards=' + $('.filterCards').val() + "&filterCategories=" + $('.filterCategories').val() + "&filterCertificateType=" + $('.filterCertificateType').val() + "&filterScadenza=" + $('.filterScadenza').val() + "&filterStatus=" + $('.filterStatus').val() + "&fromYear=" + $('input[name="txtFromYear"]').val() + "&toYear=" + $('input[name="txtToYear"]').val() + "&fromYearYear=" + $('input[name="txtFromYearYear"]').val() + "&toYearYear=" + $('input[name="txtToYearYear"]').val();
+
+            localStorage.setItem("filterCardsMember", $('.filterCards').val());
+            localStorage.setItem("filterCategoriesMember", $('.filterCategories').val());
+            localStorage.setItem("filterCertificateTypeMember", $('.filterCertificateType').val());
+            localStorage.setItem("filterScadenzaMember", $('.filterScadenza').val());
+            localStorage.setItem("filterStatusMember", $('.filterStatus').val());
+            localStorage.setItem("fromYearMember", $('input[name="txtFromYear"]').val());
+            localStorage.setItem("toYearMember", $('input[name="txtToYear"]').val());
+            localStorage.setItem("fromYearYearMember", $('input[name="txtFromYearYear"]').val());
+            localStorage.setItem("toYearYearMember", $('input[name="txtToYearYear"]').val());
+
+            if ($.fn.dataTable.isDataTable('#tablesaw-350')) {
+                $('#tablesaw-350').DataTable().ajax.url(url).load();
+                return;
             }
 
-            var fromYear = $('input[name="txtFromYear"]').val();
-            localStorage.setItem("fromYearMember", fromYear);
-
-            var toYear = $('input[name="txtToYear"]').val();
-            localStorage.setItem("toYearMember", toYear);
-
-            var fromYearYear = $('input[name="txtFromYearYear"]').val();
-            localStorage.setItem("fromYearYearMember", fromYearYear);
-
-            var toYearYear = $('input[name="txtToYearYear"]').val();
-            localStorage.setItem("toYearYearMember", toYearYear);
-
-            var filterCards = $('.filterCards').val();
-            localStorage.setItem("filterCardsMember", filterCards);
-
-            var filterStatus = $('.filterStatus').val();
-            localStorage.setItem("filterStatusMember", filterStatus);
-
-            var filterScadenza = $('.filterScadenza').val();
-            localStorage.setItem("filterScadenzaMember", filterScadenza);
-
-            var filterCertificateType = $('.filterCertificateType').val();
-            localStorage.setItem("filterCertificateTypeMember", filterCertificateType);
-
-            var filterCategories = $('.filterCategories').val();
-            localStorage.setItem("filterCategoriesMember", filterCategories)
-
             const pageLength = 10;
 
             const dataTable = $('#tablesaw-350').DataTable({
                 serverSide: true,
-                ajax: '/get_members?cards=' + filterCards + "&filterCategories=" + filterCategories + "&filterCertificateType=" + filterCertificateType + "&filterScadenza=" + filterScadenza + "&filterStatus=" + filterStatus + "&fromYear=" + fromYear + "&toYear=" + toYear + "&fromYearYear=" + fromYearYear + "&toYearYear=" + toYearYear,
+                processing: true,
+                ajax: url,
                 columns: [
                     {
                         data: "last_name",
@@ -2156,7 +2143,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                        extend: 'excelHtml5',"action":newexportaction,
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Utenti',
                                         exportOptions: {
                                             columns: ":not(':last')",
@@ -2164,7 +2152,8 @@
                                         }
                                     },
                                     {
-                                        extend: 'pdfHtml5',"action":newexportaction,
+                                        extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Utenti',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -2174,7 +2163,8 @@
                                         }
                                     },
                                     {
-                                        extend: 'print',"action":newexportaction,
+                                        extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Utenti',
                                         exportOptions: {

+ 4 - 0
resources/views/livewire/nation.blade.php

@@ -186,6 +186,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -194,6 +195,7 @@
                         buttons: [
                             {
                                 extend: 'excelHtml5',
+                                action: newexportaction,
                                 title: 'Nazioni',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -201,6 +203,7 @@
                             },
                             {
                                 extend: 'pdfHtml5',
+                                action: newexportaction,
                                 title: 'Nazioni',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -208,6 +211,7 @@
                             },
                             {
                                 extend: 'print',
+                                action: newexportaction,
                                 text: 'Stampa',
                                 title: 'Nazioni',
                                 exportOptions: {

+ 5 - 1
resources/views/livewire/payment_method.blade.php

@@ -218,6 +218,7 @@
             }
 
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -231,7 +232,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Metodi di pagamento',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -239,6 +241,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Metodi di pagamento',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -246,6 +249,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Metodi di pagamento',
                                         exportOptions: {

+ 4 - 0
resources/views/livewire/province.blade.php

@@ -175,6 +175,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -183,6 +184,7 @@
                         buttons: [
                             {
                                 extend: 'excelHtml5',
+                                action: newexportaction,
                                 title: 'Provincie',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -190,6 +192,7 @@
                             },
                             {
                                 extend: 'pdfHtml5',
+                                action: newexportaction,
                                 title: 'Provincie',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -197,6 +200,7 @@
                             },
                             {
                                 extend: 'print',
+                                action: newexportaction,
                                 text: 'Stampa',
                                 title: 'Provincie',
                                 exportOptions: {

+ 5 - 1
resources/views/livewire/rate.blade.php

@@ -388,6 +388,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -401,7 +402,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Metodi di pagamento',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -409,6 +411,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Metodi di pagamento',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -416,6 +419,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Metodi di pagamento',
                                         exportOptions: {

+ 7 - 3
resources/views/livewire/records_in.blade.php

@@ -1275,6 +1275,7 @@
                 scrollX: true,
                 scrollY: 800,*/
                 serverSide: true,
+                processing: true,
                 ajax: {
                     url : '/get_record_in?filterCommercial=' + filterCommercial + "&filterMember=" + filterMember + "&filterPaymentMethod=" + filterPaymentMethod + "&filterCausals=" + filterCausals + "&filterFrom=" + filterFrom + "&filterTo=" + filterTo,
                     dataSrc: function (json){
@@ -1362,21 +1363,24 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',"action":newexportaction,
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Entrate',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'pdfHtml5',"action":newexportaction,
+                                        extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Entrate',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'print',"action":newexportaction,
+                                        extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Entrate',
                                         exportOptions: {

+ 8 - 3
resources/views/livewire/records_out.blade.php

@@ -1810,6 +1810,8 @@
             localStorage.setItem("filterToRecordOut", filterTo);
 
             $('#tablesaw-350').DataTable({
+                serverSide: true,
+                processing: true,
                 ajax: {
                     url : "/get_record_out?filterSupplier=" + filterSupplier + "&filterPaymentMethod=" + filterPaymentMethod + "&filterCausals=" + filterCausals + "&filterFrom=" + filterFrom + "&filterTo=" + filterTo,
                     dataSrc: function (json){
@@ -1879,21 +1881,24 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                        extend: 'excelHtml5',"action":newexportaction,
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Uscite',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'pdfHtml5',"action":newexportaction,
+                                        extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Uscite',
                                         exportOptions: {
                                             columns: ":not(':last')"
                                         }
                                     },
                                     {
-                                        extend: 'print',"action":newexportaction,
+                                        extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Uscite',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/reminders.blade.php

@@ -247,6 +247,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -260,7 +261,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Scadenze',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -268,6 +270,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Scadenze',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -275,6 +278,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Scadenze',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/sms_comunications.blade.php

@@ -239,6 +239,7 @@
             }
 
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -252,7 +253,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Templates SMS',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -260,6 +262,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Templates SMS',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -267,6 +270,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Templates SMS',
                                         exportOptions: {

+ 4 - 0
resources/views/livewire/sponsor.blade.php

@@ -522,6 +522,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 fixedHeader: false,
                 thead: {
                 'th': {'background-color': 'blue'}
@@ -531,6 +532,7 @@
                         buttons: [
                             {
                                 extend: 'excelHtml5',
+                                action: newexportaction,
                                 title: 'Sponsor',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -538,6 +540,7 @@
                             },
                             {
                                 extend: 'pdfHtml5',
+                                action: newexportaction,
                                 title: 'Sponsor',
                                 exportOptions: {
                                     columns: ":not(':last')"
@@ -545,6 +548,7 @@
                             },
                             {
                                 extend: 'print',
+                                action: newexportaction,
                                 text: 'Stampa',
                                 title: 'Sponsor',
                                 exportOptions: {

+ 5 - 1
resources/views/livewire/supplier.blade.php

@@ -380,6 +380,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
                 $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -393,7 +394,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Fornitori',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -401,6 +403,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Fornitori',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -411,6 +414,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Fornitori',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/user.blade.php

@@ -246,6 +246,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -259,7 +260,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Utenti',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -267,6 +269,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Utenti',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -274,6 +277,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Utenti',
                                         exportOptions: {

+ 5 - 1
resources/views/livewire/vat.blade.php

@@ -138,6 +138,7 @@
                 $('#tablesaw-350').DataTable().destroy();
             }
             $('#tablesaw-350').DataTable({
+                processing: true,
                 thead: {
                 'th': {'background-color': 'blue'}
                 },
@@ -151,7 +152,8 @@
                                 text: 'ESPORTA',
                                 buttons: [
                                     {
-                                    extend: 'excelHtml5',
+                                        extend: 'excelHtml5',
+                                        action: newexportaction,
                                         title: 'Iva',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -159,6 +161,7 @@
                                     },
                                     {
                                         extend: 'pdfHtml5',
+                                        action: newexportaction,
                                         title: 'Iva',
                                         exportOptions: {
                                             columns: ":not(':last')"
@@ -166,6 +169,7 @@
                                     },
                                     {
                                         extend: 'print',
+                                        action: newexportaction,
                                         text: 'Stampa',
                                         title: 'Iva',
                                         exportOptions: {