<?= $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');  ?>
<div id="ot-edit" data-id="<?= $modelId ?>">
    <div class="row">
        <div class="col-md-2 d-flex align-items-center justify-content-center">
            <div class="sk-wave sk-primary portada-loader">
                <div class="sk-wave-rect"></div>
                <div class="sk-wave-rect"></div>
                <div class="sk-wave-rect"></div>
                <div class="sk-wave-rect"></div>
                <div class="sk-wave-rect"></div>
            </div>

            <img class="rounded" id="portada-orden-trabajo" src="" width="100%" height="100%" hidden>
        </div>
        <div class="col-md-10">

            <div class="alert alert-info h-100" role="alert" id="alert-orden-trabajo">
                <div class="row">
                    <div class="col-md-10">
                        <div class="d-flex flex-row bd-highlight gap-2">
                            <div class="bd-highlight">
                                <h4>OT : </h4>
                            </div>
                            <div class="bd-highlight">
                                <h4><?= $ot->id ?></h4>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="d-flex flex-row bd-highlight justify-content-end">
                            <h4><?= $ot->progreso ?> %</h4>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-10">

                        <div class="d-flex flex-row bd-highlight gap-2">
                            <div class="bd-highlight">
                                <span><i class="tf-icons ti-md ti ti-building-factory-2"></i></span>
                            </div>
                            <div class="bd-highlight">
                                <h4><?= $presupuesto->titulo ?></h4>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="d-flex flex-row bd-highlight justify-content-end">
                            <button class="btn btn-sm btn-warning w-100">Presupuesto</button>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-10">
                        <div class="d-flex flex-row bd-highlight">
                            <div class="bd-highlight">
                                <span><i class="tf-icons ti-md ti ti-user"></i></span>
                            </div>
                            <div>
                                <h4><?= $cliente->nombre ?></h4>
                            </div>
                        </div>

                    </div>
                    <div class="col-md-2 ">
                        <div class="d-flex flex-row bd-highlight justify-content-end">
                            <button class="btn btn-sm btn-warning w-100">Pedido</button>
                        </div>
                    </div>
                </div>

            </div>
        </div><!--//.col -->

    </div><!--//.row -->
    <div class="row">
        <form id="ot-edit-form">
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otPortada") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otDates") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otDetails") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otProgress") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otTask") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otCosts") ?>
            </div>
            <div class="col-md-12">
                <?= view("themes/vuexy/form/produccion/ot/otComments") ?>
            </div>
        </form>
        <div class="col-md-12 mt-3">
            <div class="d-grip gap-2">
                <a type="button" class="btn btn-primary btn-block w-100 mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>"><?= @lang("Produccion.preview_pdf") ?></a>
                <button type="button" class="btn btn-primary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
                <button type="button" class="btn btn-secondary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>

            </div>
        </div>
    </div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalCommentTarea" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel1"><?= lang('Produccion.tarea') ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <label for="comment-tarea" class="form-label d-flex text-start w-100">Comentario &nbsp;<p id="comment-type"></p></label>
                <textarea name="comment" class="form-control" id="comment-tarea" rows="5" cols="5"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" id="btn-update-tarea-comment" class="btn btn-primary"><?= lang('Chat.modal.btn_send') ?></button>
                <button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
            </div>
        </div>
    </div>
    <?= $this->endSection() ?>

    <?= $this->section('css') ?>
    <link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/dropzone/dropzone.css") ?>" />
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.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/dropzone/dropzone.js") ?>"></script>
    <script src="<?= site_url("themes/vuexy/vendor/libs/bs-stepper/bs-stepper.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 src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
    <script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
    <script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
    <script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>

    <script type="module" src="<?= site_url('assets/js/safekat/pages/produccion/edit.js') ?>"></script>

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