|
|
@@ -0,0 +1,1094 @@
|
|
|
+<div class="col card--ui" id="card--dashboard" style="padding-top: 0px !important;">
|
|
|
+
|
|
|
+ <header id="title--section" style="display:none !important" class="d-flex align-items-center justify-content-between">
|
|
|
+ <div class="title--section_name d-flex align-items-center justify-content-between">
|
|
|
+ <i class="ico--ui title_section utenti me-2"></i>
|
|
|
+ <h2 class="primary">Pagamento corsi</h2>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <div class="showFilter" style="display:none" wire:ignore.self>
|
|
|
+ <hr size="1">
|
|
|
+ <div class="row g-3">
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Anno</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12">
|
|
|
+ <select class="form-select filterYear" >
|
|
|
+ <option value="">--Seleziona--
|
|
|
+ @foreach($course_years as $c)
|
|
|
+ @php
|
|
|
+ $selected = '';
|
|
|
+ try
|
|
|
+ {
|
|
|
+ list($f, $t) = explode("-", $c);
|
|
|
+ if ($f == date("Y"))
|
|
|
+ $selected = 'selected';
|
|
|
+ } catch (Exception $e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ @endphp
|
|
|
+ <option value="{{$c}}" {{$selected}}>{{$c}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Corso</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12" >
|
|
|
+ <select class="form-select filterCourse" multiple="multiple">
|
|
|
+ @foreach($courses as $c)
|
|
|
+ <option value="{{$c}}">{{$c}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Livello</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12">
|
|
|
+ <select class="form-select filterLevel" multiple="multiple">
|
|
|
+ @foreach($course_levels as $c)
|
|
|
+ <option value="{{$c->id}}">{{$c->name}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Frequenza</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12">
|
|
|
+ <select class="form-select filterFrequency" multiple="multiple">
|
|
|
+ @foreach($course_frequencies as $c)
|
|
|
+ <option value="{{$c->id}}">{{$c->name}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Tipologia</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12">
|
|
|
+ <select class="form-select filterType" multiple="multiple">
|
|
|
+ @foreach($course_types as $c)
|
|
|
+ <option value="{{$c->id}}">{{$c->name}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12" style="margin-bottom:10px;">
|
|
|
+ <b>Durata</b>
|
|
|
+ </div>
|
|
|
+ <div class="col-12">
|
|
|
+ <select class="form-select filterDuration" multiple="multiple">
|
|
|
+ @foreach($course_durations as $c)
|
|
|
+ <option value="{{$c->id}}">{{$c->name}}
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="row g-3" style="margin-top:20px;">
|
|
|
+ <div class="col-md-12" style="text-align:right">
|
|
|
+ <button class="btn--ui_outline light" onclick="reset()">CANCELLA</button>
|
|
|
+ <button class="btn--ui" onclick="loadDataTable()">FILTRA</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <hr size="1">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row text-right">
|
|
|
+ <div class="col-md-12" style="text-align:right">
|
|
|
+ <button style="display:none; width:200px;" class="btn--ui btNewPayment" onclick="newPayment()">NUOVA ENTRATA</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <section id="resume-table" class="scrollTable">
|
|
|
+ <div class="compare--chart_wrapper d-none"></div>
|
|
|
+
|
|
|
+
|
|
|
+ <table class="table tablesaw tableHead tablesaw-stack pagamento--corsi display nowrap" id="tablesaw-350" width="100%">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th scope="col" class="sticky-col-header first-zero"></th>
|
|
|
+ <th scope="col" class="sticky-col-header first-col" style="background-color:#f6f8fa !important">Corso</th>
|
|
|
+ <th scope="col" class="sticky-col-header second-col">Cognome</th>
|
|
|
+ <th scope="col" class="sticky-col-header third-col">Nome</th>
|
|
|
+ <th scope="col">Iscrizione</th>
|
|
|
+ @foreach($months as $m)
|
|
|
+ <th scope="col"> {{$m}}</th>
|
|
|
+ @endforeach
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="checkall-target">
|
|
|
+
|
|
|
+
|
|
|
+ </tbody>
|
|
|
+ <tfoot id="checkall-target">
|
|
|
+ <tr>
|
|
|
+ <th class="sticky-col-header first-zero"></th>
|
|
|
+ <th class="sticky-col-header first-col"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ <th style="padding-left:5px !important;padding-right:5px !important;"></th>
|
|
|
+ </tr>
|
|
|
+ </tfoot>
|
|
|
+ </table>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </section>
|
|
|
+
|
|
|
+</div>
|
|
|
+
|
|
|
+@push('scripts')
|
|
|
+
|
|
|
+@endpush
|
|
|
+
|
|
|
+@push('scripts')
|
|
|
+ <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
|
|
+ <style>
|
|
|
+
|
|
|
+ .scrollTable {
|
|
|
+
|
|
|
+ padding: 15px;
|
|
|
+ /*max-width: 800px !important;*/
|
|
|
+ /*overflow-x: auto;
|
|
|
+ overflow-y: auto;
|
|
|
+ white-space: nowrap;*/
|
|
|
+ /*border: 1px solid #ddd;*/
|
|
|
+ }
|
|
|
+
|
|
|
+ ::-webkit-scrollbar-thumb {
|
|
|
+ background: #e4e4e4;
|
|
|
+ border-radius: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .select2-container--default .select2-selection--single{
|
|
|
+ background-color: #E9F0F5;
|
|
|
+ border: 0.0625rem solid #DFE5EB;
|
|
|
+ font-size: 0.75rem;
|
|
|
+ }
|
|
|
+ .select2-selection
|
|
|
+ {
|
|
|
+ height: 38px !important;
|
|
|
+ }
|
|
|
+ .select2-selection__rendered
|
|
|
+ {
|
|
|
+ padding-top:3px;
|
|
|
+ }
|
|
|
+ .select2 {
|
|
|
+ width:100% !important;
|
|
|
+ }
|
|
|
+ tfoot #checkall-target > tr > th
|
|
|
+ {
|
|
|
+ padding-right:5px !important;
|
|
|
+ }
|
|
|
+ /*.container-fluid
|
|
|
+ {
|
|
|
+ display: table-row !important;
|
|
|
+ }
|
|
|
+ .row.row.header--gestionale
|
|
|
+ {
|
|
|
+ padding-left:20px !important;
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+ </style>
|
|
|
+ <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
|
|
+@endpush
|
|
|
+
|
|
|
+@push('scripts')
|
|
|
+ <link href="/css/datatables.css" rel="stylesheet" />
|
|
|
+ <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
|
|
+
|
|
|
+
|
|
|
+ <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
|
|
+ <style>
|
|
|
+
|
|
|
+ #tablesaw-350_wrapper > div.justify-content-between
|
|
|
+ {
|
|
|
+ background-color: white;
|
|
|
+ position: sticky;
|
|
|
+ z-index: 100000;
|
|
|
+ padding-top:10px;
|
|
|
+ top: -15px;
|
|
|
+ left: 0px;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*.table-v-scroll > div, #checkall-target
|
|
|
+ {
|
|
|
+ overflow-x: auto !important;
|
|
|
+ overflow-y: hidden !important;
|
|
|
+ }*/
|
|
|
+
|
|
|
+ table.tableHead thead {
|
|
|
+ /* Important */
|
|
|
+ position: sticky;
|
|
|
+ z-index: 100;
|
|
|
+ top: 35px;
|
|
|
+ }
|
|
|
+
|
|
|
+ table thead {
|
|
|
+ /* Important */
|
|
|
+ position: sticky;
|
|
|
+ z-index: 100;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ .select2-container--default .select2-selection--single{
|
|
|
+ background-color: #E9F0F5;
|
|
|
+ border: 0.0625rem solid #DFE5EB;
|
|
|
+ font-size: 0.75rem;
|
|
|
+ }
|
|
|
+ .select2-selection
|
|
|
+ {
|
|
|
+ height: 38px !important;
|
|
|
+ }
|
|
|
+ .select2-selection__rendered
|
|
|
+ {
|
|
|
+ padding-top:3px;
|
|
|
+ }
|
|
|
+ .select2 {
|
|
|
+ width:100% !important;
|
|
|
+ }
|
|
|
+ .select2-selection--multiple{
|
|
|
+ overflow: hidden !important;
|
|
|
+ height: auto !important;
|
|
|
+ }
|
|
|
+ .select2-container {
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0;
|
|
|
+ position: relative;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ .select2-container .select2-selection--single {
|
|
|
+ box-sizing: border-box;
|
|
|
+ cursor: pointer;
|
|
|
+ display: block;
|
|
|
+ height: 38px;
|
|
|
+ user-select: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ }
|
|
|
+ .select2-container .select2-selection--single .select2-selection__rendered {
|
|
|
+ display: block;
|
|
|
+ padding-left: 8px;
|
|
|
+ padding-right: 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ .select2-selection__choice__display{
|
|
|
+ color:#000000 !important;
|
|
|
+ }
|
|
|
+ .sticky-col-header {
|
|
|
+ position: -webkit-sticky !important;
|
|
|
+ position: sticky !important;
|
|
|
+ background-color: '#f6f8fa' !important;
|
|
|
+ }
|
|
|
+ .sticky-col {
|
|
|
+ position: -webkit-sticky !important;
|
|
|
+ position: sticky !important;
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+ .first-zero {
|
|
|
+ width: 20px;
|
|
|
+ min-width: 20px;
|
|
|
+ max-width: 20px;
|
|
|
+ left: 0px;
|
|
|
+ z-index:99;
|
|
|
+ }
|
|
|
+ .first-col {
|
|
|
+ width: 100px;
|
|
|
+ min-width: 100px;
|
|
|
+ max-width: 100px;
|
|
|
+ left: 0px;
|
|
|
+ z-index:99;
|
|
|
+ }
|
|
|
+
|
|
|
+ .second-col {
|
|
|
+ width: 150px;
|
|
|
+ min-width: 150px;
|
|
|
+ max-width: 150px;
|
|
|
+ left: 100px;
|
|
|
+ z-index:99;
|
|
|
+ }
|
|
|
+ .third-col {
|
|
|
+ width: 150px;
|
|
|
+ min-width: 150px;
|
|
|
+ max-width: 150px;
|
|
|
+ left: 250px;
|
|
|
+ z-index:99;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
|
|
+ <script src="/assets/js/datatables.js"></script>
|
|
|
+ <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
|
|
|
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
|
|
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
|
|
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
|
|
+@endpush
|
|
|
+
|
|
|
+@push('scripts')
|
|
|
+ <script>
|
|
|
+
|
|
|
+ var totals = '';
|
|
|
+
|
|
|
+ $(document).ready(function() {
|
|
|
+ loadDataTable();
|
|
|
+ } );
|
|
|
+
|
|
|
+ $('.filterYear').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterYear').val('{{date("Y")-1}}-{{date("Y")}}').trigger("change");
|
|
|
+ $('.filterCourse').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ /*$('.filterCourse').on('change', function (e) {
|
|
|
+ var data = $('.filterCourse').select2("val");
|
|
|
+ if (data == null) data = [];
|
|
|
+ @this.set('filterCourse', data);
|
|
|
+ //@this.search();
|
|
|
+ });*/
|
|
|
+
|
|
|
+ $('.filterLevel').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ /*$('.filterLevel').on('change', function (e) {
|
|
|
+ var data = $('.filterLevel').select2("val");
|
|
|
+ if (data == null) data = [];
|
|
|
+ //@this.set('filterLevel', data);
|
|
|
+ //@this.search();
|
|
|
+ });*/
|
|
|
+
|
|
|
+ $('.filterFrequency').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ /*$('.filterFrequency').on('change', function (e) {
|
|
|
+ var data = $('.filterFrequency').select2("val");
|
|
|
+ if (data == null) data = [];
|
|
|
+ @this.set('filterFrequency', data);
|
|
|
+ //@this.search();
|
|
|
+ });*/
|
|
|
+
|
|
|
+ $('.filterType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ /*$('.filterType').on('change', function (e) {
|
|
|
+ var data = $('.filterType').select2("val");
|
|
|
+ if (data == null) data = [];
|
|
|
+ @this.set('filterType', data);
|
|
|
+ //@this.search();
|
|
|
+ });*/
|
|
|
+
|
|
|
+ $('.filterDuration').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ /*$('.filterDuration').on('change', function (e) {
|
|
|
+ var data = $('.filterDuration').select2("val");
|
|
|
+ if (data == null) data = [];
|
|
|
+ // @this.set('filterDuration', data);
|
|
|
+ //@this.search();
|
|
|
+ });*/
|
|
|
+
|
|
|
+ Livewire.on('load-data-table', () => {
|
|
|
+ $('.filterYear').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterCourse').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterLevel').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterFrequency').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterType').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ $('.filterDuration').select2({"language": {"noResults": function(){return "Nessun risultato";}}});
|
|
|
+ loadDataTable();
|
|
|
+ });
|
|
|
+
|
|
|
+ Livewire.on('destroy-data-table', () => {
|
|
|
+ $('#tablesaw-350').DataTable().destroy();
|
|
|
+ });
|
|
|
+
|
|
|
+ function destroyDataTable()
|
|
|
+ {
|
|
|
+ $('#tablesaw-350').DataTable().destroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ var isFilter = false;
|
|
|
+ $(document).ready(function() {
|
|
|
+ $(document).on("click",".showHideFilter",function() {
|
|
|
+ if (isFilter)
|
|
|
+ {
|
|
|
+ isFilter = false;
|
|
|
+ $(".showFilter").hide();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isFilter = true;
|
|
|
+ $(".showFilter").show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } );
|
|
|
+
|
|
|
+ function searchAction()
|
|
|
+ {
|
|
|
+ //destroyDataTable();
|
|
|
+ //@this.search();
|
|
|
+ }
|
|
|
+
|
|
|
+ @if(isset($_GET["showFilters"]))
|
|
|
+ var filterYear = localStorage.getItem("filterYearCourseList");
|
|
|
+ if (filterYear)
|
|
|
+ {
|
|
|
+ $('.filterYear').val(filterYear).trigger('change');
|
|
|
+ }
|
|
|
+ var filterCourse = localStorage.getItem("filterCourseCourseList");
|
|
|
+ if (filterCourse)
|
|
|
+ {
|
|
|
+ $('.filterCourse').val(filterCourse).trigger('change');
|
|
|
+ }
|
|
|
+ var filterLevel = localStorage.getItem("filterLevelCourseList");
|
|
|
+ if (filterLevel)
|
|
|
+ {
|
|
|
+ $('.filterLevel').val(filterLevel).trigger('change');
|
|
|
+ }
|
|
|
+ var filterFrequency = localStorage.getItem("filterFrequencyCourseList");
|
|
|
+ if (filterFrequency)
|
|
|
+ {
|
|
|
+ $('.filterFrequency').val(filterFrequency).trigger('change');
|
|
|
+ }
|
|
|
+ var filterDuration = localStorage.getItem("filterDurationCourseList");
|
|
|
+ if (filterDuration)
|
|
|
+ {
|
|
|
+ $('.filterDuration').val(filterDuration).trigger('change');
|
|
|
+ }
|
|
|
+ var filterType = localStorage.getItem("filterTypeCourseList");
|
|
|
+ if (filterType)
|
|
|
+ {
|
|
|
+ $('.filterType').val(filterType).trigger('change');
|
|
|
+ }
|
|
|
+ @endif
|
|
|
+
|
|
|
+ function reset()
|
|
|
+ {
|
|
|
+ $('.filterYear').val(null).trigger("change");
|
|
|
+ $('.filterCourse').val(null).trigger("change");
|
|
|
+ $('.filterLevel').val(null).trigger("change");
|
|
|
+ $('.filterFrequency').val(null).trigger("change");
|
|
|
+ $('.filterDuration').val(null).trigger("change");
|
|
|
+ $('.filterType').val(null).trigger("change");
|
|
|
+
|
|
|
+ destroyDataTable();
|
|
|
+
|
|
|
+ //localStorage.clear();
|
|
|
+
|
|
|
+ loadDataTable();
|
|
|
+ }
|
|
|
+
|
|
|
+ function loadDataTable(){
|
|
|
+
|
|
|
+ if ( $.fn.DataTable.isDataTable('#tablesaw-350') ) {
|
|
|
+ $('#tablesaw-350').DataTable().destroy();
|
|
|
+ }
|
|
|
+
|
|
|
+ var filterYear = $('.filterYear').val();
|
|
|
+ localStorage.setItem("filterYearCourseList", filterYear);
|
|
|
+
|
|
|
+ var filterCourse = $('.filterCourse').val();
|
|
|
+ localStorage.setItem("filterCourseCourseList", filterCourse);
|
|
|
+
|
|
|
+ var filterLevel = $('.filterLevel').val();
|
|
|
+ localStorage.setItem("filterLevelCourseList", filterLevel);
|
|
|
+
|
|
|
+ var filterDuration = $('.filterDuration').val();
|
|
|
+ localStorage.setItem("filterDurationCourseList", filterDuration);
|
|
|
+
|
|
|
+ var filterFrequency = $('.filterFrequency').val();
|
|
|
+ localStorage.setItem("filterFrequencyCourseList", filterFrequency);
|
|
|
+
|
|
|
+ var filterType = $('.filterType').val();
|
|
|
+ localStorage.setItem("filterTypeCourseList", filterType);
|
|
|
+
|
|
|
+ var output_table = $('#tablesaw-350').DataTable({
|
|
|
+ //scrollX: true,
|
|
|
+ //scrollY: true,
|
|
|
+ //scrollCollapse: true,
|
|
|
+ scrollY: '400px',
|
|
|
+ serverSide: true,
|
|
|
+ ajax: {
|
|
|
+ url : '/get_course_list?filterCourse=' + filterCourse + '&filterDuration=' + filterDuration + '&filterLevel=' + filterLevel + '&filterType=' + filterType + '&filterFrequency=' + filterFrequency + '&filterYear=' + filterYear,
|
|
|
+ dataSrc: function (json){
|
|
|
+ if(json.totals){
|
|
|
+ totals = json.totals;
|
|
|
+ }
|
|
|
+ return json.data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ thead: {
|
|
|
+ 'th': {'background-color': 'blue'}
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ data: 'column_18',
|
|
|
+ "orderable": false,
|
|
|
+ className: 'red',
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_19',
|
|
|
+ className: 'red',
|
|
|
+ className: 'sticky-col first-col'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_0',
|
|
|
+ className: 'red',
|
|
|
+ className: 'sticky-col second-col',
|
|
|
+ render: function (data, type, row){
|
|
|
+ var ret = '<a href="/members?member_detail=' + row["column_17"] + '&from=course_list">' + data + '</a>';
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_1',
|
|
|
+ className: 'sticky-col third-col',
|
|
|
+ render: function (data, type, row){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '<a href="/members?member_detail=' + row["column_17"] + '&from=course_list">' + data + '</a>';
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_2',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ className: 'ciccio',
|
|
|
+ render: function (data, type, row){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 0)
|
|
|
+ {
|
|
|
+ var ret = '<a style="width:100%;float:right; text-align:right; display:block; ' + (x[0] == 1 ? '' : 'cursor:pointer;') + '" class="' + (x[0] == 1 ? 'green' : 'orange') + ' sub_' + row["column_16"] + '" onclick="setSubscription(' + row["column_15"] + ', ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + (x[0] == 1 ? 'green' : 'orange') + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_3',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_1_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 1, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_4',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_2_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 2, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_5',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_3_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 3, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_6',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_4_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 4, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_7',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_5_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 5, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_8',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_6_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 6, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_9',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_7_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 7, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_10',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_8_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 8, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_11',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_9_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 9, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_12',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_10_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 10, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_13',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_11_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 11, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ data: 'column_14',
|
|
|
+ orderSequence: ['asc', 'desc'],
|
|
|
+ render: function (data, type, row, meta){
|
|
|
+ const x = data.split("§");
|
|
|
+ var ret = '';
|
|
|
+ if (x[0] == 'orange')
|
|
|
+ {
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block; cursor:pointer;" class="' + x[0] + ' lnk_' + row["column_16"] + '" id="lnk_' + row["column_15"] + '_12_' + row["column_17"] + '" onclick="setPayMonth(' + row["column_15"] + ', 12, ' + row["column_17"] + ', ' + row["column_16"] + ')" style="cursor: pointer;"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (x[0] != 'wgrey')
|
|
|
+ ret = '<a style="width:100%;float:right; text-align:right; display:block;" class="' + x[0] + '"><small>' + x[1] + '</small></a>';
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ layout: {
|
|
|
+ topStart : null,
|
|
|
+ topEnd : null,
|
|
|
+ top1A: {
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ extend: 'collection',
|
|
|
+ text: 'ESPORTA',
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ extend: 'excelHtml5',"action":newexportaction,
|
|
|
+ title: 'Pagamento corsi',
|
|
|
+ orientation: 'landscape',
|
|
|
+ exportOptions: {
|
|
|
+ columns: ":not(':last')"
|
|
|
+ },
|
|
|
+ footer:false,
|
|
|
+ customize: function(xlsx) {
|
|
|
+ var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
|
|
+ const letters = ["E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q"];
|
|
|
+
|
|
|
+ for(y=0; y<letters.length; y++)
|
|
|
+ {
|
|
|
+ z = y + 4;
|
|
|
+ var c = output_table.column(z).data().toArray();
|
|
|
+ //console.log(c);
|
|
|
+ for (var i = 0; i < c.length; i++)
|
|
|
+ {
|
|
|
+ var j = c[i].split("§");
|
|
|
+ if (j[0] == '0' || j[0] == 'orange')
|
|
|
+ {
|
|
|
+ $('row:nth-child('+(i+3)+') [r^="' + letters[y] + '"]', sheet).attr('s', '10');
|
|
|
+ //sheet.table.body[i+1][z].fillColor = 'orange';
|
|
|
+ }
|
|
|
+ if (j[0] == '1' || j[0] == 'green')
|
|
|
+ {
|
|
|
+ $('row:nth-child('+(i+3)+') [r^="' + letters[y] + '"]', sheet).attr('s', '40');
|
|
|
+ //doc.content[1].table.body[i+1][z].fillColor = 'green';
|
|
|
+ }
|
|
|
+ if (j[0] == 'yellow')
|
|
|
+ {
|
|
|
+ $('row:nth-child('+(i+3)+') [r^="' + letters[y] + '"]', sheet).attr('s', '20');
|
|
|
+ //doc.content[1].table.body[i+1][z].fillColor = 'blue';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ extend: 'pdfHtml5',"action":newexportaction,
|
|
|
+ title: 'Pagamento corsi',
|
|
|
+ orientation: 'landscape',
|
|
|
+ exportOptions: {
|
|
|
+ columns: ":not(':last')"
|
|
|
+ },
|
|
|
+ footer:false,
|
|
|
+ customize: function(doc) {
|
|
|
+ for(z=4; z<=16; z++)
|
|
|
+ {
|
|
|
+ var c = output_table.column(z).data().toArray();
|
|
|
+ for (var i = 0; i < c.length; i++)
|
|
|
+ {
|
|
|
+ var j = c[i].split("§");
|
|
|
+ if (j[0] == '0' || j[0] == 'orange')
|
|
|
+ {
|
|
|
+ doc.content[1].table.body[i+1][z].fillColor = 'orange';
|
|
|
+ }
|
|
|
+ if (j[0] == '1' || j[0] == 'green')
|
|
|
+ {
|
|
|
+ doc.content[1].table.body[i+1][z].fillColor = 'green';
|
|
|
+ }
|
|
|
+ if (j[0] == 'yellow')
|
|
|
+ {
|
|
|
+ doc.content[1].table.body[i+1][z].fillColor = 'blue';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }/*,
|
|
|
+ {
|
|
|
+ extend: 'print',"action":newexportaction,
|
|
|
+ text: 'Stampa',
|
|
|
+ title: 'Pagamento corsi',
|
|
|
+ exportOptions: {
|
|
|
+ columns: ":not(':last')"
|
|
|
+ },
|
|
|
+ footer:false
|
|
|
+ }*/
|
|
|
+ ],
|
|
|
+ dropup: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ top1B : {
|
|
|
+ pageLength: {
|
|
|
+ menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ top1C :'search',
|
|
|
+ },
|
|
|
+ order: [[2, 'asc'], [3, 'asc']],
|
|
|
+ pagingType: 'numbers',
|
|
|
+ "language": {
|
|
|
+ "url": "/assets/js/Italian.json"
|
|
|
+ },
|
|
|
+ "fnInitComplete": function (oSettings, json) {
|
|
|
+ var html = ' <a href="#" class="showHideFilter btn--ui"><i class="fa-solid fa-sliders"></i></a>';
|
|
|
+ $(".dt-search").append(html);
|
|
|
+ },
|
|
|
+ "footerCallback": function (row, data, start, end, display) {
|
|
|
+ let api = this.api();
|
|
|
+
|
|
|
+ api.column(0).footer().innerHTML = '';
|
|
|
+ api.column(1).footer().innerHTML = '';
|
|
|
+ api.column(2).footer().innerHTML = '';
|
|
|
+ api.column(3).footer().innerHTML = '';
|
|
|
+
|
|
|
+ for(var i=4; i<=15; i++)
|
|
|
+ {
|
|
|
+ api.column(i).footer().innerHTML = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (totals != '')
|
|
|
+ {
|
|
|
+
|
|
|
+ totals.split("_").forEach(function (item)
|
|
|
+ {
|
|
|
+ var x = item.split("§");
|
|
|
+ if (x[1] != undefined)
|
|
|
+ api.column(x[0]).footer().innerHTML = x[1];
|
|
|
+ else
|
|
|
+ api.column(x[0]).footer().innerHTML = '';
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }/*,
|
|
|
+ fixedColumns: {
|
|
|
+ start: 1,
|
|
|
+ end: 1
|
|
|
+ },
|
|
|
+ scrollX: true*/
|
|
|
+ });
|
|
|
+ $('#tablesaw-350 thead tr th').addClass('col');
|
|
|
+ $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
|
|
|
+ $('#tablesaw-350').on('draw.dt', function() {
|
|
|
+ $('[data-bs-toggle="popover"]').popover()
|
|
|
+ });
|
|
|
+
|
|
|
+ jQuery.fn.dataTable.Api.register( 'sum()', function ( ) {
|
|
|
+ return this.flatten().reduce( function ( a, b ) {
|
|
|
+ if ( typeof a === 'string') {
|
|
|
+ start = a.indexOf("€");
|
|
|
+ a = a.substr(start + 2).replace("</small></a>", "").replace(",",".") * 1;
|
|
|
+ }
|
|
|
+ if ( typeof b === 'string' && b.indexOf('green') > 0) {
|
|
|
+ start = b.indexOf("€");
|
|
|
+ b = b.substr(start + 2).replace("</small></a>", "").replace(",",".") * 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ b = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return a + b;
|
|
|
+ }, 0 );
|
|
|
+ } );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Livewire.on('setTotals', (tot) =>
|
|
|
+ {
|
|
|
+ totals = tot;
|
|
|
+ console.log(totals);
|
|
|
+ });
|
|
|
+
|
|
|
+ var subscription = false;
|
|
|
+ var months = [];
|
|
|
+ var selectedCourseId = 0;
|
|
|
+ var selectedMemberId = 0;
|
|
|
+ var selectedMemberCourseId = 0;
|
|
|
+ function setPayMonth(course_id, month, member_id, id)
|
|
|
+ {
|
|
|
+ if (selectedMemberId > 0 && selectedMemberId != member_id)
|
|
|
+ {
|
|
|
+ months = [];
|
|
|
+ subscription = false;
|
|
|
+ }
|
|
|
+ if (selectedMemberCourseId != id)
|
|
|
+ {
|
|
|
+ $(".sub_" + selectedMemberCourseId).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ $(".lnk_" + selectedMemberCourseId).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ }
|
|
|
+ selectedCourseId = course_id;
|
|
|
+ selectedMemberId = member_id;
|
|
|
+ selectedMemberCourseId = id;
|
|
|
+
|
|
|
+ if(!months.includes(month))
|
|
|
+ {
|
|
|
+ months.push(month);
|
|
|
+ $("#lnk_" + course_id + "_" + month + "_" + member_id).addClass("blue").addClass("selected").removeClass("orange");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ months.splice(months.indexOf(months), 1);
|
|
|
+ $("#lnk_" + course_id + "_" + month + "_" + member_id).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ }
|
|
|
+ if (months.length > 0)
|
|
|
+ {
|
|
|
+ $(".btNewPayment").show();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $(".btNewPayment").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function setSubscription(course_id, member_id, id)
|
|
|
+ {
|
|
|
+ if (selectedMemberCourseId != id)
|
|
|
+ {
|
|
|
+ $(".sub_" + selectedMemberCourseId).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ $(".lnk_" + selectedMemberCourseId).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ months = [];
|
|
|
+ subscription = false;
|
|
|
+ }
|
|
|
+ selectedCourseId = course_id;
|
|
|
+ selectedMemberId = member_id;
|
|
|
+ selectedMemberCourseId = id;
|
|
|
+ if (subscription)
|
|
|
+ {
|
|
|
+ $(".sub_" + selectedMemberCourseId).addClass("orange").removeClass("blue").removeClass("selected");
|
|
|
+ subscription = false;
|
|
|
+ $(".btNewPayment").hide();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $(".sub_" + selectedMemberCourseId).addClass("blue").addClass("selected").removeClass("orange");
|
|
|
+ subscription = true;
|
|
|
+ $(".btNewPayment").show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function newPayment()
|
|
|
+ {
|
|
|
+ @this.newPayment(selectedCourseId, months.toString(), selectedMemberId, selectedMemberCourseId, subscription);
|
|
|
+ }
|
|
|
+
|
|
|
+ $( document ).ready( function(){
|
|
|
+
|
|
|
+ setMaxWidth();
|
|
|
+ setMaxHeight();
|
|
|
+ $( window ).bind( "resize", setMaxWidth );
|
|
|
+ $( window ).bind( "resize", setMaxHeight );
|
|
|
+
|
|
|
+
|
|
|
+ function setMaxWidth() {
|
|
|
+ $("#resume-table").width( Math.round( $(window ).width() - size ) ) ;
|
|
|
+ $(".justify-content-between").css({"width": Math.round( $(window ).width() - size) + "px;"}); //.width( Math.round( $(window ).width() - size ) ) ;
|
|
|
+
|
|
|
+ }
|
|
|
+ function setMaxHeight() {
|
|
|
+ console.log('height:' + $(window ).height() + 'px !important');
|
|
|
+ $("div.row.h-100").attr('style', 'height:' + ($(window ).height() + 50) + 'px !important');
|
|
|
+ $("#resume-table").height( Math.round( $(window ).height() - 150 ) ) ;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ </script>
|
|
|
+@endpush
|
|
|
+
|