| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587 |
- <div class="col">
- <div class="row h-100">
- <div class="col card--ui" id="card--dashboard">
- <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>Corso</b>
- </div>
- <div class="col-12" >
- <select class="form-select filterCourse" wire:model="filterCourse" onchange="destroyDataTable()" 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" wire:model="filterLevel" onchange="destroyDataTable()" 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" wire:model="filterFrequency" onchange="destroyDataTable()" 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" wire:model="filterType" onchange="destroyDataTable()" 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" wire:model="filterDuration" onchange="destroyDataTable()" 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" wire:click.prevent="disableSearch()" onclick="destroyDataTable()">CANCELLA</button>
- <button class="btn--ui" onclick="searchAction()">FILTRA</button>
- </div>
- </div>
- <hr size="1">
- </div>
- <section id="resume-table">
- <div class="compare--chart_wrapper d-none"></div>
- <table class="table tablesaw tablesaw-stack pagamento--corsi" id="tablesaw-350">
- <thead>
- <tr>
- <th scope="col">Cognome</th>
- <th scope="col">Nome</th>
- <th scope="col">Iscrizione</th>
- @foreach($months as $m)
- <th scope="col"> {{$m}}</th>
- @endforeach
- </tr>
- </thead>
- <tbody id="checkall-target">
- @foreach($records as $record)
- <tr>
- @php
- list($id, $first_name, $last_name) = explode("§", $record[0]);
- @endphp
- <td><a href="/members?member_detail={{$id}}">{{$last_name}}</a></td>
- <td><a href="/members?member_detail={{$id}}">{{$first_name}}</a></td>
- @php
- list($subscribed, $subPrice) = explode("§", $record[15]);
- @endphp
- <td><a class="{{$subscribed ? 'green' : 'orange'}}" wire:click="newSubscription({{$record[13]}}, {{$id}}, {{$record[14]}})" style="cursor: pointer;"><small>{{formatPrice($subPrice)}}</small></a></td>
- @for($x=1; $x<=12; $x++)
- <td>
- @php
- list($color, $price) = explode("§", $record[$x]);
- @endphp
- @if($color == 'orange')
- <a class="{{$color}}" wire:click="newPayment({{$record[13]}}, {{$x}}, {{$id}}, {{$record[14]}})" style="cursor: pointer;"><small>{{formatPrice($price)}}</small></a>
- @else
- <a class="{{$color}}"><small>{{formatPrice($price)}}</small></a>
- @endif
- </td>
- @endfor
- </tr>
- @endforeach
- </tbody>
- <tfoot id="checkall-target">
- <tr>
- <th colspan="2"></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </tfoot>
- </table>
- </section>
- </div>
- @push('scripts')
- <!-- <style>
- a.grey
- {
- display: flex;
- margin-right:10px;
- float:left;
- height: 2.5rem !important;
- width:50px;
- align-items: center;
- justify-content: center;
- color: #006099;
- background-color: #d3dce1 !important;
- padding: 0 1.25rem;
- font-size: 0.875rem;
- font-family: greycliff-cf, sans-serif;
- border-radius: 1.875rem !important;
- -webkit-border-radius: 1.875rem !important;
- -moz-border-radius: 1.875rem !important;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- border: none;
- }
- a.blue
- {
- display: flex;
- margin-right:10px;
- float:left;
- height: 2.5rem !important;
- width:50px;
- align-items: center;
- justify-content: center;
- color: #fff;
- background-color: #006099 !important;
- padding: 0 1.25rem;
- font-size: 0.875rem;
- font-family: greycliff-cf, sans-serif;
- border-radius: 1.875rem !important;
- -webkit-border-radius: 1.875rem !important;
- -moz-border-radius: 1.875rem !important;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- border: none;
- }
- a.yellow
- {
- display: flex;
- margin-right:10px;
- float:left;
- height: 2.5rem !important;
- width:50px;
- align-items: center;
- justify-content: center;
- color: #fff;
- background-color: #ffe238;
- padding: 0 1.25rem;
- font-size: 0.875rem;
- font-family: greycliff-cf, sans-serif;
- border-radius: 1.875rem !important;
- -webkit-border-radius: 1.875rem !important;
- -moz-border-radius: 1.875rem !important;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- border: none;
- }
- a.orange
- {
- display: flex;
- margin-right:10px;
- float:left;
- height: 2.5rem !important;
- width:50px;
- align-items: center;
- justify-content: center;
- color: #fff;
- background-color: #FF7E38;
- padding: 0 1.25rem;
- font-size: 0.875rem;
- font-family: greycliff-cf, sans-serif;
- border-radius: 1.875rem !important;
- -webkit-border-radius: 1.875rem !important;
- -moz-border-radius: 1.875rem !important;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- border: none;
- }
- a.green
- {
- display: flex;
- margin-right:10px;
- float:left;
- height: 2.5rem !important;
- width:50px;
- align-items: center;
- justify-content: center;
- color: #fff;
- background-color: green;
- padding: 0 1.25rem;
- font-size: 0.875rem;
- font-family: greycliff-cf, sans-serif;
- border-radius: 1.875rem !important;
- -webkit-border-radius: 1.875rem !important;
- -moz-border-radius: 1.875rem !important;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- border: none;
- }
- </style> -->
- @endpush
- @push('scripts')
- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
- <style>
- .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;
- }
- </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>
- .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;
- }
- </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>
- $(document).ready(function() {
- loadDataTable();
- } );
- $('.filterCourse').select2();
- $('.filterCourse').on('change', function (e) {
- var data = $('.filterCourse').select2("val");
- if (data == null) data = [];
- @this.set('filterCourse', data);
- //@this.search();
- });
- $('.filterLevel').select2();
- $('.filterLevel').on('change', function (e) {
- var data = $('.filterLevel').select2("val");
- if (data == null) data = [];
- @this.set('filterLevel', data);
- //@this.search();
- });
- $('.filterFrequency').select2();
- $('.filterFrequency').on('change', function (e) {
- var data = $('.filterFrequency').select2("val");
- if (data == null) data = [];
- @this.set('filterFrequency', data);
- //@this.search();
- });
- $('.filterType').select2();
- $('.filterType').on('change', function (e) {
- var data = $('.filterType').select2("val");
- if (data == null) data = [];
- @this.set('filterType', data);
- //@this.search();
- });
- $('.filterDuration').select2();
- $('.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', () => {
- $('.filterCourse').select2();
- $('.filterLevel').select2();
- $('.filterFrequency').select2();
- $('.filterType').select2();
- $('.filterDuration').select2();
- 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();
- }
- function loadDataTable(){
- $('#tablesaw-350').DataTable({
- scrollX: true,
- thead: {
- 'th': {'background-color': 'blue'}
- },
- layout: {
- topStart : null,
- topEnd : null,
- top1A: {
- buttons: [
- {
- extend: 'collection',
- text: 'Esporta',
- buttons: [
- {
- extend: 'excelHtml5',
- title: 'Pagamento corsi',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'pdfHtml5',
- title: 'Pagamento corsi',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'print',
- text: 'Stampa',
- title: 'Pagamento corsi',
- exportOptions: {
- columns: ":not(':last')"
- }
- }
- ],
- dropup: true
- }
- ]
- },
- top1B : {
- pageLength: {
- menu: [[10, 25, 50, 100, 100000], [10, 25, 50, 100, "Tutti"]]
- }
- },
- top1C :'search',
- },
- order: [[0, 'asc'], [1, '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();
- @php
- $xx = 2;
- $str = '';
- $str .= "<a class=green><small>" . (isset($totalIsc["Y"]) ? formatPrice($totalIsc["Y"]) : 0) . "</small></a><br>";
- $str .= "<a class=orange><small>" . (isset($totalIsc["N"]) ? formatPrice($totalIsc["N"]) : 0) . "</small></a><br>";
- $str .= "<a class=yellow><small>0</small></a><br>";
- print "api.column(2).footer().innerHTML = '" . $str . "';";
- $str = "";
- foreach($totals as $z => $t)
- {
- if ($z == 1) $xx = 7;
- if ($z == 2) $xx = 8;
- if ($z == 3) $xx = 9;
- if ($z == 4) $xx = 10;
- if ($z == 5) $xx = 11;
- if ($z == 6) $xx = 12;
- if ($z == 7) $xx = 13;
- if ($z == 8) $xx = 14;
- if ($z == 9) $xx = 3;
- if ($z == 10) $xx = 4;
- if ($z == 11) $xx = 5;
- if ($z == 12) $xx = 6;
- $str = '';
- foreach($t as $x => $c)
- {
- $y = $x == 'yellow' ? $c : formatPrice($c);
- $str .= "<a class=" . $x . "><small>" . $y . "</small></a><br>";
- }
- print "api.column(" . $xx . ").footer().innerHTML = '" . $str . "';";
- $xx += 1;
- }
- @endphp
- /*for(var i = 2; i<15; i++)
- {
- api.column(i).footer().innerHTML = "ciccio"; //"€ " + api.column(i).data().sum().toFixed(2);
- }*/
- }
- });
- $('#tablesaw-350 thead tr th').addClass('col');
- $('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
- 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 );
- } );
- }
- </script>
- @endpush
|