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

<?= $this->section('content'); ?>
<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-header">
                <h4><?= $boxTitle ?></h4>
            </div>
            <div class="card-body">

                <?= view("themes/_commonPartialsBs/_alertBoxes") ?>

                <div class="card accordion-item active mb-5">
                    <h4 class="accordion-header px-4 py-3">
                        <?= lang("Logistica.nuevoEnvio") ?>
                    </h4>

                    <div id="accordionNuevoEnvioTip" class="accordion-collapse collapse show">
                        <div class="accordion-body px-4 py-3">

                            <div class="row">

                                <div class="mb-1 col-sm-4">
                                    <label for="buscadorPedidos" class="form-label">
                                        <?= lang("Logistica.buscadorPedidosTitle") ?>
                                    </label>
                                    <input id="buscadorPedidos" name="buscador_pedidos" tabindex="1" maxlength="50"
                                        class="form-control" value="">
                                </div>

                            </div>
                        </div>
                    </div>
                </div>


                <div class="card accordion-item active">
                    <h4 class="accordion-header px-4 py-3">
                        <?= lang("Logistica.listadoEnvios") ?>
                    </h4>

                    <div id="accordionListadoEnviosTip" class="accordion-collapse collapse show">
                        <div class="accordion-body px-4 py-3">

                            <div class="row">
                                <table id="tableOfEnvios" class="table table-striped table-hover w-100">
                                    <thead>
                                        <tr>
                                            <th><?= lang('Logistica.idEnvio') ?? 'ID Envío' ?></th>
                                            <th><?= lang('Logistica.numeroPedidos') ?? 'Nº Pedidos' ?></th>
                                            <th><?= lang('Logistica.numeroLineas') ?? 'Nº Líneas' ?></th>
                                            <th><?= lang('Logistica.att') ?? 'Att' ?></th>
                                            <th><?= lang('Logistica.direccion') ?? 'Dirección' ?></th>
                                            <th><?= lang('Logistica.ciudad') ?? 'Ciudad' ?></th>
                                            <th><?= lang('Logistica.pais') ?? 'País' ?></th>
                                            <th><?= lang('Logistica.cp') ?? 'CP' ?></th>
                                            <th><?= lang('Logistica.email') ?? 'Email' ?></th>
                                            <th><?= lang('Logistica.telefono') ?? 'Teléfono' ?></th>
                                            <th><?= lang('Logistica.finalizado') ?? 'Finalizado' ?></th>
                                            <th><?= lang('Logistica.acciones') ?? 'Acciones' ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>


                            </div>
                        </div>
                    </div>
                </div>

                <div class="mt-3">
                    <button type="button" class="btn btn-secondary" id="btnImprimirEtiquetas"
                        onclick="window.location.href='<?= route_to('LogisticaPanel') ?>'">
                        <?= lang('Logistica.backToPanel') ?>
                    </button>
                </div>
            </div>

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


<?= $this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
<?= $this->endSection() ?>

<?= $this->section('additionalExternalJs') ?>
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
<script type="module" src="<?= site_url("assets/js/safekat/pages/logistica/envio.js") ?>"></script>
<?= $this->endSection() ?>