<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
<?= $this->section('content')?>

<div class="row">
    <div class="col-md-12">

        <div class="card card-info">
            <div class="card-header">
                <h3 class="card-title"><?= lang('Tickets.moduleTitle') ?></h3>
                <?= anchor(route_to('NewTicket'), lang('Basic.global.addNew') . ' ' . lang('Tickets.ticket'), ['class' => 'btn btn-primary float-end']); ?>
            </div><!--//.card-header -->
            <div class="card-body">
                <?= view('themes/_commonPartialsBs/_alertBoxes'); ?>

                <table id="tableOfTickets" class="table table-striped table-hover using-exportable-data-table"
                    style="width: 100%;">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th><?= lang('Tickets.tipo') ?></th>
                            <th><?= lang('Tickets.seccion') ?></th>
                            <th><?= lang('Tickets.estado') ?></th>
                            <?php if ($userType == 1) : ?>
                            <th><?= lang('Tickets.prioridad') ?></th>
                            <?php endif; ?>
                            <th><?= lang('Tickets.asunto') ?></th>
                            <?php if ($userType == 1) : ?>
                            <th><?= lang('Tickets.usuario') ?></th>
                            <th><?= lang('Tickets.asignarTo') ?></th>
                            <?php endif; ?>
                            <th><?= lang('Tickets.fechaCreacion') ?></th>
                            <th class="text-nowrap noFilter"><?= lang('Basic.global.Action') ?></th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div><!--//.card-body -->
            <div class="card-footer">

            </div><!--//.card-footer -->
        </div><!--//.card -->
    </div><!--//.col -->
</div><!--//.row -->

<?= $this->endSection() ?>

<?= $this->section('css') ?>
<link rel="stylesheet"
    href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.css') ?>" />
<?= $this->endSection() ?>


<?= $this->section('additionalExternalJs') ?>

<script>
    window.userType = <?= $userType ?>;
</script>

<script
    src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
<script
    src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>"
    crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.colVis.min.js") ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.js') ?>"></script>

<script type="module" src="<?= site_url('assets/js/safekat/pages/soporte/tickets.js') ?>"></script>
<?= $this->endSection() ?>
