<?php $__env->startSection('title'); ?>
Eventos
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-header'); ?>
Eventos
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<li class="active">
    Eventos
</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-xs-12">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs pull-right ui-sortable-handle">
                <li class="active"><a href="#events" data-toggle="tab">Próximos Eventos</a></li>
                <li><a href="#old-events" data-toggle="tab">Eventos Passados</a></li>
                <li class="pull-left header"><i class="fa fa-calendar"></i> Lista de Eventos</li>
            </ul>
            <div class="tab-content">
                <a href="<?php echo route('admin.events.create'); ?>" class="btn btn-sm btn-success margin-bottom-15">Adicionar Novo Evento</a>
                <div class="tab-pane active" id="events">
                    <table id="table-events" class="table table-bordered table-striped dataTable">
                        <thead>
                            <tr>
                                <th class="width-1">#</th>
                                <th>Título</th>
                                <th class="width-140px">Data</th>
                                <th>Local</th>
                                <th class="width-40px"></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
                <div class="tab-pane" id="old-events">
                   <table id="table-old-events" class="table table-bordered table-striped dataTable">
                        <thead>
                            <tr>
                                <th class="width-1">#</th>
                                <th>Título</th>
                                <th class="width-140px">Data</th>
                                <th>Local</th>
                                <th class="width-40px"></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script type="text/javascript">
    $(document).ready(function () {
        $('#table-events').dataTable({
            processing: true,
            "ajax": {
                url: "<?php echo route('admin.events.datatables'); ?>",
                type: "POST"
            },
            "autoWidth": false,
            "order": [[0, "desc"]],
            "columnDefs": [
                {"orderable": false, "targets": [-1]},
            ]
        });
    });
    
    $(document).ready(function () {
        $('#table-old-events').dataTable({
            processing: true,
            "ajax": {
                url: "<?php echo route('admin.events.datatables'); ?>",
                type: "POST",
                data: function (d) {
                    d.old = true
                }
            },
            "autoWidth": false,
            "order": [[0, "desc"]],
            "columnDefs": [
                {"orderable": false, "targets": [-1]},
            ]
        });
    });
</script>
<?php $__env->stopSection(); ?>