<?= $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-->
<div class="row">
    <?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
    <div class="row text-center">
        <h4>Seleccione una máquina</h4>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="row text-start">
                <h4>Máquinas impresión</h4>
            </div>
            <div class="row" id="maquinas-impresion">
                <?php foreach ($maquinas["impresion"] as $key => $maquina): ?>
                    <div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
                        <a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
                            <span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
                                <?= $maquina["nombre"] ?>
                                <?php if ($maquina["countTareas"] > 0): ?>
                                    <span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
                                <?php endif; ?>
                            </span>
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="row text-start">
                <h4>Máquinas acabado</h4>
            </div>
            <div class="row" id="maquinas-acabado">
                <?php foreach ($maquinas["acabado"] as $key => $maquina): ?>
                    <div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
                        <a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
                            <span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
                                <?= $maquina["nombre"] ?>
                                <?php if ($maquina["countTareas"] > 0): ?>
                                    <span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
                                <?php endif; ?>
                            </span>
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="row text-start">
                <h4>Máquinas manipulado</h4>
            </div>
            <div class="row" id="maquinas-manipulado">
                <?php foreach ($maquinas["manipulado"] as $key => $maquina): ?>
                    <div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
                        <a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-<?= $maquina['countMaquinaTareas'] > 0 ? "danger" : "primary" ?> w-100">
                            <span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
                                <?= $maquina["nombre"] ?>
                                <?php if ($maquina["countTareas"] > 0): ?>
                                    <span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
                                <?php endif; ?>
                            </span>
                        </a>
                    </div>
                <?php endforeach; ?>
            </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/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>
<?= $this->endSection() ?>