|
@@ -185,7 +185,7 @@
|
|
|
|
|
|
|
|
@else
|
|
@else
|
|
|
|
|
|
|
|
- <div class="col-auto filterWrapper" id="filter--section" wire:ignore.self>
|
|
|
|
|
|
|
+ <div class="col-auto filterWrapper" id="filter--section" wire:ignore>
|
|
|
<aside>
|
|
<aside>
|
|
|
<header>
|
|
<header>
|
|
|
<h2>Filtra Utenti</h2>
|
|
<h2>Filtra Utenti</h2>
|
|
@@ -200,7 +200,7 @@
|
|
|
<div class="col-12">
|
|
<div class="col-12">
|
|
|
@foreach(getCards() as $card)
|
|
@foreach(getCards() as $card)
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" value="{{$card->id}}" wire:model="filterCard" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCard" type="checkbox" value="{{$card->id}}">
|
|
|
<label class="form-check-label ms-2" >{{$card->name}}</label>
|
|
<label class="form-check-label ms-2" >{{$card->name}}</label>
|
|
|
</div>
|
|
</div>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -215,21 +215,21 @@
|
|
|
<div class="filter--item_formElement row">
|
|
<div class="filter--item_formElement row">
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" wire:model="filterCertNormal" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCertificateNormal" type="checkbox">
|
|
|
<label class="form-check-label ms-2" >Normale</label>
|
|
<label class="form-check-label ms-2" >Normale</label>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" wire:model="filterCertInScadenza" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCertificateScadenza" type="checkbox" >
|
|
|
<label class="form-check-label ms-2" >In Scadenza</label>
|
|
<label class="form-check-label ms-2" >In Scadenza</label>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" wire:model="filterCertAgonistic" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCertificateAgonistico" type="checkbox" >
|
|
|
<label class="form-check-label ms-2" >Agonistico</label>
|
|
<label class="form-check-label ms-2" >Agonistico</label>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" wire:model="filterCertScaduto" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCertificateScaduti" type="checkbox" >
|
|
|
<label class="form-check-label ms-2" >Scaduti</label>
|
|
<label class="form-check-label ms-2" >Scaduti</label>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -245,7 +245,7 @@
|
|
|
<div class="col-6">
|
|
<div class="col-6">
|
|
|
@foreach(getCategories() as $category)
|
|
@foreach(getCategories() as $category)
|
|
|
<div class="form-check form-check-inline align-items-center">
|
|
<div class="form-check form-check-inline align-items-center">
|
|
|
- <input class="form-check-input" type="checkbox" value="{{$category->id}}" wire:model="filterCategory" onclick="destroyDataTable()">
|
|
|
|
|
|
|
+ <input class="form-check-input chkCategory" type="checkbox" value="{{$category->id}}" >
|
|
|
<label class="form-check-label ms-2" >{{$category->name}}</label>
|
|
<label class="form-check-label ms-2" >{{$category->name}}</label>
|
|
|
</div>
|
|
</div>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -262,7 +262,8 @@
|
|
|
|
|
|
|
|
<footer>
|
|
<footer>
|
|
|
<div class="filter--buttons d-flex align-items-center justify-content-between">
|
|
<div class="filter--buttons d-flex align-items-center justify-content-between">
|
|
|
- <button class="btn--ui small dark disable" wire:click.prevent="advancedSearchCancel()" onclick="destroyDataTable()">cancella</button><button class="btn--ui small white" onclick="destroyDataTable()" wire:click.prevent="advancedSearch()">filtra</button>
|
|
|
|
|
|
|
+ <button class="btn--ui small dark disable" wire:click.prevent="advancedSearchCancel()" onclick="destroyDataTable()">cancella</button>
|
|
|
|
|
+ <button class="btn--ui small white" onclick="loadDataTable()">filtra</button>
|
|
|
</div>
|
|
</div>
|
|
|
</footer>
|
|
</footer>
|
|
|
|
|
|
|
@@ -293,13 +294,13 @@
|
|
|
<button id="close-filter" onclick="pcsh2()"></button>
|
|
<button id="close-filter" onclick="pcsh2()"></button>
|
|
|
|
|
|
|
|
<section id="subheader" class="d-flex align-items-center justify-content-between">
|
|
<section id="subheader" class="d-flex align-items-center justify-content-between">
|
|
|
- <form action="" class="group--action d-flex align-items-center">
|
|
|
|
|
|
|
+ <!--<form action="" class="group--action d-flex align-items-center">
|
|
|
<select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="multipleAction">
|
|
<select class="form-select form-select-lg me-1" aria-label=".form-select-lg example" wire:model="multipleAction">
|
|
|
<option selected>Azione multipla</option>
|
|
<option selected>Azione multipla</option>
|
|
|
<option value="delete">Elimina</option>
|
|
<option value="delete">Elimina</option>
|
|
|
</select>
|
|
</select>
|
|
|
<button type="submit" class="btn--ui" wire:click.prevent="executeMultipleAction()">applica</button>
|
|
<button type="submit" class="btn--ui" wire:click.prevent="executeMultipleAction()">applica</button>
|
|
|
- </form>
|
|
|
|
|
|
|
+ </form>-->
|
|
|
|
|
|
|
|
@if(false)
|
|
@if(false)
|
|
|
<form action="" class="search--form d-flex align-items-center">
|
|
<form action="" class="search--form d-flex align-items-center">
|
|
@@ -324,8 +325,6 @@
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
<!--<th scope="col"><label><input class="table-check" type="checkbox" data-tablesaw-checkall=""></th>-->
|
|
<!--<th scope="col"><label><input class="table-check" type="checkbox" data-tablesaw-checkall=""></th>-->
|
|
|
- <th scope="col"><input class="table-check" type="checkbox" wire:model="checkedAll" wire:click="checkUncheckAll()"></th>
|
|
|
|
|
- <th scope="col">#</th>
|
|
|
|
|
<th scope="col">Codice</th>
|
|
<th scope="col">Codice</th>
|
|
|
<th scope="col">Cognome</th>
|
|
<th scope="col">Cognome</th>
|
|
|
<th scope="col">Nome</th>
|
|
<th scope="col">Nome</th>
|
|
@@ -338,6 +337,7 @@
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody id="checkall-target">
|
|
<tbody id="checkall-target">
|
|
|
|
|
+ @if(false)
|
|
|
@foreach($records as $idx => $record)
|
|
@foreach($records as $idx => $record)
|
|
|
<tr>
|
|
<tr>
|
|
|
<td> <label><input class="table-check" type="checkbox" wire:model="multipleIds" value="{{$record->id}}"><span class="sr-only d-inline-block d-lg-none ms-2 mobile-row-selector"> Seleziona riga</span></label></td>
|
|
<td> <label><input class="table-check" type="checkbox" wire:model="multipleIds" value="{{$record->id}}"><span class="sr-only d-inline-block d-lg-none ms-2 mobile-row-selector"> Seleziona riga</span></label></td>
|
|
@@ -350,43 +350,35 @@
|
|
|
<a href="tel:{{$record->phone}}">{{$record->phone}}</a>
|
|
<a href="tel:{{$record->phone}}">{{$record->phone}}</a>
|
|
|
@endif
|
|
@endif
|
|
|
</td>
|
|
</td>
|
|
|
- <td>{{$record->getAge() > 0 ? $record->getAge() : ''}} </td>
|
|
|
|
|
- @php
|
|
|
|
|
- $member_status = $record->getStatus();
|
|
|
|
|
- @endphp
|
|
|
|
|
|
|
+ <td>{{$record->age > 0 ? $record->age : ''}} </td>
|
|
|
|
|
+
|
|
|
<td>
|
|
<td>
|
|
|
- <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$member_status["status"] > 0 ? ($member_status["status"] == 2 ? 'active' : 'suspended') : 'due'}}">{{$member_status["status"] > 0 ? ($member_status["status"] == 2 ? 'Tesserato' : 'Sospeso') : 'Non tesserato'}}</span></span>
|
|
|
|
|
|
|
+ <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->state > 0 ? ($record->state == 2 ? 'active' : 'suspended') : 'due'}}">{{$record->state > 0 ? ($record->state == 2 ? 'Tesserato' : 'Sospeso') : 'Non tesserato'}}</span></span>
|
|
|
</td>
|
|
</td>
|
|
|
- @php
|
|
|
|
|
- $isSubscribed = $record->isActive();
|
|
|
|
|
- @endphp
|
|
|
|
|
<td>
|
|
<td>
|
|
|
- <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$isSubscribed["status"] > 0 ? ($isSubscribed["status"] == 2 ? 'active' : 'suspended') : ''}}">{{$isSubscribed["status"] > 0 ? ($isSubscribed["status"] == 2 ? 'Attivo' : 'Sospesa') : ''}}</span></span>
|
|
|
|
|
|
|
+ <span class="tablesaw-cell-content"><span class="badge tessera-badge {{$record->status > 0 ? ($record->status == 2 ? 'active' : 'suspended') : ''}}">{{$record->status > 0 ? ($record->status == 2 ? 'Attivo' : 'Sospesa') : ''}}</span></span>
|
|
|
<b class=" tablesaw-cell-label">Scadenza tessera</b>
|
|
<b class=" tablesaw-cell-label">Scadenza tessera</b>
|
|
|
<span class="tablesaw-cell-content d-flex align-items-center">
|
|
<span class="tablesaw-cell-content d-flex align-items-center">
|
|
|
- {{$isSubscribed["status"] ? 'Scadenza : ' : ($isSubscribed["date"] != '' ? 'Scaduto : ' : '')}} {{$isSubscribed["date"] != '' ? date("d/m/Y", strtotime($isSubscribed["date"])) : ''}}
|
|
|
|
|
|
|
+ {{$record->status ? 'Scadenza : ' : ($record->date != '' ? 'Scaduto : ' : '')}} {{$record->date != '' ? date("d/m/Y", strtotime($record->date)) : ''}}
|
|
|
</span>
|
|
</span>
|
|
|
</td>
|
|
</td>
|
|
|
- @php
|
|
|
|
|
- $has_certificate = $record->hasCertificate();
|
|
|
|
|
- @endphp
|
|
|
|
|
<td>
|
|
<td>
|
|
|
- @if($has_certificate["date"] != '')
|
|
|
|
|
|
|
+ @if($record->certificate != '')
|
|
|
<b class=" tablesaw-cell-label">Scadenza certificato</b>
|
|
<b class=" tablesaw-cell-label">Scadenza certificato</b>
|
|
|
<span class="tablesaw-cell-content d-flex align-items-center">
|
|
<span class="tablesaw-cell-content d-flex align-items-center">
|
|
|
- @if($has_certificate["date"] < date("Y-m-d"))
|
|
|
|
|
|
|
+ @if($record->certificate < date("Y-m-d"))
|
|
|
<i class="ico--ui check suspended me-2"></i>
|
|
<i class="ico--ui check suspended me-2"></i>
|
|
|
Scaduto :
|
|
Scaduto :
|
|
|
@endif
|
|
@endif
|
|
|
- @if($has_certificate["date"] >= date("Y-m-d") && $has_certificate["date"] < date("Y-m-d", strtotime("+1 month")))
|
|
|
|
|
|
|
+ @if($record->certificate >= date("Y-m-d") && $record->certificate < date("Y-m-d", strtotime("+1 month")))
|
|
|
<i class="ico--ui check due me-2"></i>
|
|
<i class="ico--ui check due me-2"></i>
|
|
|
In scadenza :
|
|
In scadenza :
|
|
|
@endif
|
|
@endif
|
|
|
- @if($has_certificate["date"] >= date("Y-m-d", strtotime("+1 month")))
|
|
|
|
|
|
|
+ @if($record->certificate >= date("Y-m-d", strtotime("+1 month")))
|
|
|
<i class="ico--ui check active me-2"></i>
|
|
<i class="ico--ui check active me-2"></i>
|
|
|
Scadenza :
|
|
Scadenza :
|
|
|
@endif
|
|
@endif
|
|
|
- {{$has_certificate["date"] != '' ? date("d/m/Y", strtotime($has_certificate["date"])) : ''}}
|
|
|
|
|
|
|
+ {{$record->certificate != '' ? date("d/m/Y", strtotime($record->certificate)) : ''}}
|
|
|
</span>
|
|
</span>
|
|
|
@endif
|
|
@endif
|
|
|
</td>
|
|
</td>
|
|
@@ -397,7 +389,7 @@
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
@endforeach
|
|
@endforeach
|
|
|
-
|
|
|
|
|
|
|
+ @endif
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
@@ -1525,6 +1517,17 @@
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
|
|
|
|
+ function editData(id)
|
|
|
|
|
+ {
|
|
|
|
|
+ @this.edit(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function deleteData(id)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (confirm('Sei sicuro?'))
|
|
|
|
|
+ @this.delete(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
loadDataTable();
|
|
loadDataTable();
|
|
|
} );
|
|
} );
|
|
@@ -1550,10 +1553,104 @@
|
|
|
$('#tablesaw-350').DataTable().destroy();
|
|
$('#tablesaw-350').DataTable().destroy();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Carico i filtri
|
|
|
|
|
+ var cards = "";
|
|
|
|
|
+ $('input:checkbox.chkCard').each(function () {
|
|
|
|
|
+ if (this.checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (cards != "") cards += ",";
|
|
|
|
|
+ cards += $(this).val();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var categories = "";
|
|
|
|
|
+ $('input:checkbox.chkCategory').each(function () {
|
|
|
|
|
+ if (this.checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (categories != "") categories += ",";
|
|
|
|
|
+ categories += $(this).val();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var chkCertificateNormal = $(".chkCertificateNormal").is(':checked') ? "1" : "";
|
|
|
|
|
+ var chkCertificateAgonistico = $(".chkCertificateAgonistico").is(':checked') ? "1" : "";
|
|
|
|
|
+ var chkCertificateScadenza = $(".chkCertificateScadenza").is(':checked') ? "1" : "";
|
|
|
|
|
+ var chkCertificateScaduti = $(".chkCertificateScaduti").is(':checked') ? "1" : "";
|
|
|
|
|
+
|
|
|
$('#tablesaw-350').DataTable({
|
|
$('#tablesaw-350').DataTable({
|
|
|
//destroy: true,
|
|
//destroy: true,
|
|
|
|
|
+ ajax: '/get_members?cards=' + cards + "&categories=" + categories + "&chkCertificateNormal=" + chkCertificateNormal + "&chkCertificateAgonistico=" + chkCertificateAgonistico + "&chkCertificateScadenza=" + chkCertificateScadenza + "&chkCertificateScaduti=" + chkCertificateScaduti,
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ { data: 'id' },
|
|
|
|
|
+ { data: "first_name" },
|
|
|
|
|
+ { data: "last_name"},
|
|
|
|
|
+ { data: "phone"},
|
|
|
|
|
+ { data: "age"},
|
|
|
|
|
+ {
|
|
|
|
|
+ data: "status",
|
|
|
|
|
+ render: function (data){
|
|
|
|
|
+ // Split class and text
|
|
|
|
|
+ const d = data.split("|");
|
|
|
|
|
+ var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
|
|
|
|
|
+ return ret;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ data: "state",
|
|
|
|
|
+ render: function (data){
|
|
|
|
|
+ // Split class and text
|
|
|
|
|
+ const d = data.split("|");
|
|
|
|
|
+ var ret = '<span class="tablesaw-cell-content"><span class="badge tessera-badge ' + d[0] + '">' + d[1] + '</span></span>';
|
|
|
|
|
+ ret += '<b class=" tablesaw-cell-label">Scadenza tessera</b>';
|
|
|
|
|
+ ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
|
|
|
|
|
+ d[2] + ' ' + d[3];
|
|
|
|
|
+ ret += '</span>';
|
|
|
|
|
+ return ret;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ data: "certificate",
|
|
|
|
|
+ render: function (data){
|
|
|
|
|
+ // Split class and text
|
|
|
|
|
+ var ret = '';
|
|
|
|
|
+ if (data != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ const d = data.split("|");
|
|
|
|
|
+
|
|
|
|
|
+ ret += '<b class=" tablesaw-cell-label">Scadenza certificato</b>';
|
|
|
|
|
+ ret += '<span class="tablesaw-cell-content d-flex align-items-center">';
|
|
|
|
|
+ if (d[0] == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ ret += '<i class="ico--ui check suspended me-2"></i>';
|
|
|
|
|
+ ret += 'Scaduto : ';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (d[0] == "1")
|
|
|
|
|
+ {
|
|
|
|
|
+ ret += '<i class="ico--ui check due me-2"></i>';
|
|
|
|
|
+ ret += 'In scadenza : ';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (d[0] == "2")
|
|
|
|
|
+ {
|
|
|
|
|
+ ret += '<i class="ico--ui check active me-2"></i>';
|
|
|
|
|
+ ret += 'Scadenza : ';
|
|
|
|
|
+ }
|
|
|
|
|
+ ret += d[1];
|
|
|
|
|
+ ret += '</span>';
|
|
|
|
|
+ }
|
|
|
|
|
+ return ret;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ data: "action",
|
|
|
|
|
+ render: function (data){
|
|
|
|
|
+ var ret = '<button type="button" class="btn btn-outline-primary btn-sm" onclick="editData(' + data + ')">Modifica</button> ';
|
|
|
|
|
+ ret += '<button type="button" class="btn btn-outline-danger btn-sm" onclick="deleteData(' + data + ')">Elimina</button>';
|
|
|
|
|
+ return ret;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
fixedHeader: false,
|
|
fixedHeader: false,
|
|
|
- order: [[3, 'asc'], [4, 'asc']],
|
|
|
|
|
|
|
+ order: [[1, 'asc'], [2, 'asc']],
|
|
|
thead: {
|
|
thead: {
|
|
|
'th': {'background-color': 'blue'}
|
|
'th': {'background-color': 'blue'}
|
|
|
},
|
|
},
|