<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $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.nuevaEtiqueta") ?>
                    </h4>

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

                            <div class="row">
                                <div class="mb-1 col-sm-6">
                                    <label for="buscadorPedidos" class="form-label">
                                        <?= lang("Logistica.buscadorPedidosTitle2") ?>
                                    </label>
                                    <select id="buscadorPedidos" name="buscador_pedidos" tabindex="1" maxlength="50"
                                        class="form-control select2bs2">
                                    </select>
                                </div>
                            </div>

                            <div class="row select-direcciones d-none">
                                <div class="col-sm-6 px-3">
                                    <label for="selectDirecciones" class="form-label">
                                        <?= lang("Logistica.selectDirecciones") ?>
                                    </label>
                                    <select id="selectDirecciones" name="select_direcciones" tabindex="1" maxlength="50"
                                        class="form-control select2bs2" style="width: 100%;">
                                    </select>
                                </div>
                            </div>

                            <div class="row add-etiqueta d-none">
                                <div class="col-sm-2 px-3">
                                    <button id="btnAddEtiqueta" name="btn_add_etiqueta" tabindex="1"
                                        class="btn btn-primary mt-4 w-100">
                                        <?= lang("Logistica.add") ?>
                                        <ti class="ti ti-circle-plus"></ti>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


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

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

                            <div class="row">
                                <table id="tableOfEquiquetas" class="table table-striped table-hover w-100">
                                    <thead>
                                        <tr>
                                            <th style="max-width: 8%;"><?= lang('Logistica.id') ?? 'ID Envío' ?></th>
                                            <th style="max-width: 10%;"><?= lang('Logistica.numeroOts') ?? 'Nº OTs' ?></th>
                                            <th style="max-width: 8%;"><?= lang('Logistica.numeroCajas') ?? 'Nº Cajas' ?></th>
                                            <th><?= lang('Logistica.att') ?? 'Att' ?></th>
                                            <th><?= lang('Logistica.direccion') ?? 'Dirección' ?></th>
                                            <th style="max-width: 120px;"><?= lang('Logistica.acciones') ?? 'Acciones' ?></th>
                                        </tr>
                                        <tr>    
                                            <th><input type="text" class="form-control envio-filter" name="id"></th>
                                            <th><input type="text" class="form-control envio-filter-ots" name="ots"></th>
                                            <th></th>
                                            <th><input type="text" class="form-control envio-filter" name="att"></th>
                                            <th><input type="text" class="form-control envio-filter" name="direccion"></th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>


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

                <div class="mt-3">
                    <button type="button" class="btn btn-secondary" id="btnBackToPanel"
                        onclick="window.location.href='<?= route_to('LogisticaPanel') ?>'">
                        <?= lang('Logistica.backToPanel') ?>
                    </button>
                </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/impresionEtiquetas.js") ?>"></script>
    <?= $this->endSection() ?>