| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <div class="col">
- <div class="row h-100">
- <div class="col-auto filterWrapper" id="filter--section" wire:ignore.self>
- <aside>
- <header>
- <h2>Filtra Ricevute</h2>
- </header>
- <form action="" id="filter--form" class="dark-form row">
- <div class="filter--item">
- <span class="filter--item_title">Stato</span>
- <div class="filter--item_formElement">
- <select class="form-select" wire:model="filterStatus" onchange="destroyDataTable()">
- <option value="">--Seleziona--
- <option value="1">Attiva
- <option value="99">Annullata
- </select>
- </div>
- </div>
- <div class="filter--item">
- <span class="filter--item_title">Periodo</span>
- <div class="filter--item_formElement">
- <input id="date" type="date" class="form-control" wire:model="filterFrom" style="background-color:white">
- </div>
- <div class="filter--item_formElement">
- <input id="date" type="date" class="form-control" wire:model="filterTo" style="background-color:white" >
- </div>
- </div>
- </form>
- <footer>
- <div class="filter--buttons d-flex align-items-center justify-content-between">
- <button class="btn--ui small dark disable" wire:click.prevent="disableSearch()" onclick="destroyDataTable()">cancella</button>
- <button class="btn--ui small white" wire:click.prevent="search()" onclick="destroyDataTable()">filtra</button>
- </div>
- </footer>
- </aside>
- </div>
- <div class="col card--ui" id="card--dashboard">
- <header id="title--section" 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">Ricevute</h2>
- </div>
- <div class="title--section_addButton" wire:click="add()" style="cursor: pointer;">
- <div class="card--ui card--ui_btnAddHeaderUser entrata d-flex justify-items-between">
- <header class="d-flex justify-content-between"><div class="card-title d-flex align-items-start"><h2>Aggiungi </h2></div><a href="#" wire:click="add()"><i class="ico--ui big add primary"></i></a></header>
- </div>
- </div>
- </header>
- <button id="open-filter" onclick="pcsh1()"></button>
- <button id="close-filter" onclick="pcsh2()"></button>
- <section id="resume-table">
- <div class="compare--chart_wrapper d-none"></div>
- <table class="table tablesaw tablesaw-stack" id="tablesaw-350">
- <thead>
- <tr>
- <th scope="col">Anno</th>
- <th scope="col">Numero</th>
- <th scope="col">Destinatario</th>
- <th scope="col">Stato</th>
- <th scope="col">Data</th>
- <th scope="col">...</th>
- </tr>
- </thead>
- <tbody id="checkall-target">
- @foreach($records as $record)
- <tr>
- <td>{{$record->year}}</td>
- <td>{{$record->number}}</td>
- <td>{{$record->type == 'IN' ? ($record->member->first_name . " " . $record->member->last_name) : 'Uscita'}}</td>
- <td>
- <span class="tablesaw-cell-content">
- <span class="badge tessera-badge {{$record->status == 1 ? 'active' : 'suspended'}}">{{$record->status == 1 ? 'Attivo' : 'Annullata'}}</span>
- </span>
- </td>
- <td>{{date("d/m/Y", strtotime($record->date))}}</td>
- <td>
- <button type="button" class="btn btn-outline-primary btn-sm" onclick="document.location.href='/in?id={{$record->record_id}}'">Dettaglio</button>
- <button type="button" class="btn btn-outline-primary btn-sm" wire:click="printReceipt({{ $record->id }})">Stampa</button>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </section>
- </div>
- @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>
- <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();
- } );
- Livewire.on('load-data-table', () => {
- setTimeout(function() {loadDataTable()}, 100);
- });
- Livewire.on('destroy-data-table', () => {
- $('#tablesaw-350').DataTable().destroy();
- });
- function destroyDataTable()
- {
- $('#tablesaw-350').DataTable().destroy();
- }
- function loadDataTable(){
- $('#tablesaw-350').DataTable({
- thead: {
- 'th': {'background-color': 'blue'}
- },
- layout: {
- topStart: {
- buttons: [
- {
- extend: 'excelHtml5',
- title: 'Ricevute',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'pdfHtml5',
- title: 'Ricevute',
- exportOptions: {
- columns: ":not(':last')"
- }
- },
- {
- extend: 'print',
- text: 'Stampa',
- title: 'Ricevute',
- exportOptions: {
- columns: ":not(':last')"
- }
- }
- ]
- }
- },
- order: [[0, 'desc'], [1, 'desc']],
- pagingType: 'numbers',
- "language": {
- "url": "/assets/js/Italian.json"
- }
- });
- $('#tablesaw-350 thead tr th').addClass('col');
- $('#tablesaw-350 thead tr th').css("background-color", "#EDF0F2");
- }
- </script>
- @endpush
|