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/qas.sports-crowd.com/resources/views/seasons/list.blade.php
@extends('modules.head') @section('contenido')
<div class="container_breadcrumbs">
    <h2>
        <a class="ruta" class="" href="{{ route('tournaments.index') }}">{{ __('messages.seasons.title_2') }}</a>
    </h2>
    @if(!in_array(Auth::user()->rol->id, [7,15]))
    <a class="auxiliar-black" href="{{ route('seasons.create', ['tournament_id' => $tournament_id]) }}">
        <button class="btn btnAdd pull-right">
            <i style="margin-right:5px;" class="fa fa-plus"></i>{{ __('messages.seasons.title_12') }}
        </button>
    </a>
    @endif
</div>

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

    <!-- /.box-header -->
    <div class="box-body table-responsive ">
        <table id="example2" class="table table-bordered table-hover dataTable" 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.seasons.title_3') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.seasons.title_4') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.seasons.title_17') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.seasons.title_2') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
                        {{ __('messages.seasons.title_6') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">
                        {{ __('messages.seasons.title_14') }}
                    </th>
                    <th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">
                        {{ __('messages.seasons.title_15') }}
                    </th>
                </tr>
            </thead>
        </table>
    </div>
    <!-- /.box-body -->
</div>

<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/seasons.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function() {
        var sort_col = $('#example2').find("th:contains(" + Lang.get("messages.seasons.title_14")+ ")")[0].cellIndex;
        var sort_col_2 = $('#example2').find("th:contains(" + Lang.get("messages.seasons.title_4")+ ")")[0].cellIndex;

        _table = $('#example2').DataTable({
            responsive: true,
            processing: true,
            serverSide: true,
            order: [
                [sort_col, 'desc'],
                [sort_col_2, 'desc']
            ],
            language: {
                url: window.DATATABLES_LANGUAGE_URL,
            },
            ajax: '{{ route("seasons.table", ["tournament_id" => $tournament_id]) }}',
            columns: [{
                    data: 'name',
                    name: 'name'
                },
                {
                    data: 'start',
                    name: 'start'
                },
                {
                    data: 'end',
                    name: 'end'
                },
                {
                    data: 'tournament.name',
                    name: 'tournament_id'
                },
                {
                    data: 'is_suscription',
                    name: 'is_suscription'
                },
                {
                    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');
            }
        });
    });

    // 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