<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
<?= $this->section('content'); ?>
<!--Content Body-->
<?php

use CodeIgniter\I18n\Time;
?>
<div class="row" id="viewMaquinistaMaquinaTareas" data-id="<?= $maquinaEntity->id ?>">
    <div class="col-md-12">
        <div class="d-flex flex-row justify-content-end align-items-stretch mb-2 gap-2">
            <a type="button" href="<?= route_to('viewMaquinistaFichajeAutomatico', $maquinaEntity->id) ?>" id="btn-fichaje-automatico" class="btn btn-primary" aria-pressed="true"><span class="icon-base ti ti-wand ti-xs me-1"></span> <?= lang('Produccion.maquinista.fichaje_auto') ?></a>
            <a type="button" href="<?= route_to('viewMaquinistaTareaScan', $maquinaEntity->id) ?>" id="btn-tarea-scan" class="btn btn-primary" aria-pressed="true"><span class="icon-base ti ti-scan ti-xs me-1"></span><?= lang('Produccion.maquinista.scan') ?></a>
        </div>
        <div class="card">
            <div class="card-body">
                <div id="tareas-aplazadas" class="d-none">
                    <?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php", ["id" => "maquinista-tarea-aplazada-table"]) ?>
                </div>
                <div class="row mb-2 align-items-center">
                    <div class="col-md-6 col-xs-12 justify-content-start ">
                        <div class="d-flex flex-row justify-content-start align-items-stretch gap-2 h-100">
                            <button type="button" id="btn-tareas-hoy" class="btn btn-primary h-100 active" aria-pressed="true"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
                            <button type="button" id="btn-all-tareas" class="btn btn-primary h-100"><?= lang('Produccion.maquinista.tareas_all') ?></button>
                        </div>
                    </div>
                    <div class="col-md-6 col-xs-12 justify-content-end d-flex">
                        <span class="display-6" id="today-date"><?= Time::now()->format('d/m/Y') ?></span>
                    </div>
                </div>
                <?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php", ["id" => "maquinista-tarea-table"]) ?>
            </div>
        </div>
    </div>
</div>
<?= $this->endSection() ?>

<?= $this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />

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

<?= $this->section("additionalExternalJs") ?>
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewTareaList.js") ?>"></script>
<?= $this->endSection() ?>