HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/comfama.sports-crowd.com/resources/views/carnet/list.blade.php
@extends('modules.head') @section('contenido')
<style>
    /* Ensure that the demo table scrolls */
    /* th, */
    td {
        white-space: nowrap;
    }

    div.dataTables_wrapper {
        height: fit-content;
        margin: 0px 10px 0px 10px;
    }

    .dataTables_scrollBody {
        max-height: none !important;
    }
</style>
<div class="box-header">
    <a class="auxiliar-black" href="{{ route('carnet.create') }}">
        <button class="btn btnAdd pull-right">
            <i style="margin-right:5px;" class="fa fa-plus"></i>{{ __('messages.carnet.add') }}
        </button></a>
</div>

<!-- List dorsal-->
<div class="box">
    <div class="box-header with-border">
        <h3 class="box-title">{{ __('messages.carnet.list') }}</h3>
    </div>

    <!-- /.box-header -->
    <div class="box-body table-responsive ">
        <table id="example2" class="stripe row-border order-column" style="width:100%" role="grid" aria-describedby="example2_info">
            <thead>
                <tr role="row">
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.name') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.image') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.start_date') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.end_date') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.segmentation') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.font') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.carnet.color') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.tag.active') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">
                        {{ __('messages.tag.actions') }}
                    </th>
                </tr>
            </thead>
        </table>
    </div>
    <!-- /.box-body -->
</div>

<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/crud.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/carnet.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function() {
        _table = $('#example2').DataTable({
            responsive: true,
            processing: true,
            serverSide: true,
            "language": {
                url: 'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json'
            },
            scrollX: true,
            scrollCollapse: true,
            paging: true,
            fixedColumns: {
                left: 1,
                right: 2
            },
            ajax: "{{ route('carnet.table') }}",
            columns: [{
                    data: 'name',
                    name: 'name'
                },
                {
                    data: 'image',
                    name: 'image'
                },
                {
                    data: 'start_date',
                    name: 'start_date'
                },
                {
                    data: 'end_date',
                    name: 'end_date'
                },
                {
                    data: 'segmentation',
                    render: function(data, type, row) {
                        let tags = '';
                        if (row.segmentation) {
                            let list = row.segmentation.split(',');
                            let data = list.map(function(d) {
                                return '<li>' + d + '</li>';
                            });
                            tags = data.join('');
                        }
                        return tags;
                    },
                    name: 'tags.name',
                },
                {
                    data: 'font_type',
                    name: 'font_type'
                },
                {
                    data: 'font_color',
                    render: function(data, type, row, column) {
                        return '<div style="background-color: ' + row.font_color + '; color: white; padding: 5px; font-weight: bold; border-radius: 10px; text-align: center;"> color </div>';
                    },
                    name: 'font_color'
                },
                {
                    data: 'active',
                    name: 'active'
                },
                {
                    data: 'actions',
                    name: 'actions'
                }
            ]
        });

        // Paginacion
        $('#example2').on('page.dt', function() {
            window.actualPage = $('#example2').DataTable().page();
            localStorage.setItem("setPaginaActual", $('#example2').DataTable().page());
        });

        $('#example2').on('init.dt', function() {
            if (localStorage.getItem("setPaginaActual")) {
                let paginationCurrent = Number(localStorage.getItem("setPaginaActual", $('#example2').DataTable().page()));
                if (parseInt(localStorage.getItem("setPaginaActual")) != paginationCurrent)
                    $('#example2').DataTable().page(paginationCurrent).draw('page');
            }
        });

        var info = '<i class="fa  fa-info-circle"  id="btn-info-busqueda"></i><div class="dropdown-menu" id="menuBusqueda" style="left: 50%; padding: 5px; background-color: #f9fb8f;"><p data-toggle="modal">Busqueda por Nombre, Orden y Link</p></div>';
        $('#example2_filter').append(info);
        $('#btn-info-busqueda').on('click', function() {
            $('#menuBusqueda').toggle();
        });
    });

    // Paginacion inicial
    var URLactual = window.location.href;
    document.addEventListener('click', function(e) {
        if (e.target.closest('a')) {
            var href = e.target.closest('a').href || '';
            href = href.split('#')[0];
            if (URLactual != href) {
                localStorage.setItem("setPaginaActual", 0);
            }
        }
    }, false);
</script>
@endsection