<?php include_once('../../config.php') ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Sisplan Web | Itens de Estoque de Materiais</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.255.7.1">

    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../dist/css/custom.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../dist/css/PesquisaVariosSelect2.css?versao=3.255.7.1">
    <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.255.7.1">
    <!-- Toastr -->
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.255.7.1">
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.255.7.1" />
    <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../plugins/select2/css/select2.min.css?versao=3.255.7.1">
    <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.255.7.1">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="../plugins/overlayScrollbars/css/OverlayScrollbars.min.css?versao=3.255.7.1">


</head>
<style>
    #msform {
        text-align: start;
        position: relative;
    }

    .card {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }

    .card-header {
        box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
    }

    .card-body {
        margin-left: 0px !important;
        padding-left: 1.25rem !important;
        padding-top: 0px;
        padding-bottom: 0px;
        padding-right: 1.25rem !important;
    }

    .header-content-page .title-page,
    .title-content-page .title,
    .title-page {
        font-size: 20px;
        line-height: normal;
        font-weight: 500;
        color: #343a40;
        margin: 0;
        font-family: Roboto, Arial, sans-serif;
    }

    .form-group {
        margin-bottom: 0.2rem;
    }

    .border-Field {
        border: 1px groove #ddd !important;
        padding: 0 1.4em 0.5em 1.4em !important;
        -webkit-box-shadow: 0px 0px 0px 0px #000;
        box-shadow: 0px 0px 0px 0px #000;
        border-radius: 8px;
    }

    .border-Field .textoBorda {
        font-size: 1.2em !important;
        text-align: left !important;
        width: auto;
        padding: 0 10px;
        border-bottom: none;
    }

    .marginTop {
        margin-top: 8px;
    }

    .table.dataTable tbody td {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .table.dataTable thead th {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    #modal-manutencaoconsumos .modal-dialog {
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        height: 100vh !important;
        padding: 4% !important;
    }

    #modal-manutencaoconsumos .modal-dialog {
        max-width: none !important;
        margin: 0 !important;
        height: 100vh !important;
        padding-top: 1% !important;
    }

    #modal-manutencaoconsumos .modal-content {
        max-height: none !important;
        max-width: none !important;
        height: 95vh !important;
        padding: 0 !important;
    }

    #modal-manutencaoconsumos {
        padding-right: 0 !important;
    }

    .bordaProduto {
        padding: 7px;
        border: solid #e0e4e6;
        border-radius: 4px;
        border-width: 2px;
        margin-top: 5px;
    }

    .label-tamanho {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

    .content-wrapper {
        margin-left: 0px !important;
    }

    .main-header,
    .main-sidebar {
        display: none;
    }
</style>


<body class="hold-transition sidebar-mini layout-fixed">
    <main class="wrapper">

        <?php
        include_once('../../menu.php');
        ?>

        <div class="content-wrapper">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6">
                            <h3 class="col-mb=2">Itens de Estoque de Materiais</h3>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <div class="card" style="height:auto;">
                                <div class="card-header">
                                    <div class="row col-12 pl-0">
                                        <h1 id="titleMaterial" class="pl-0 ml-0"></h1>
                                    </div>
                                    <div class="row mt-2">
                                        <fieldset class="form border-Field p-0 d-block d-md-flex">
                                            <legend class="textoBorda pb-0 mb-0">Opções</legend>
                                            <div class="icheck-primary mr-2">
                                                <input type="checkbox" id="checkSomenteCEstoque" checked name="somenteCEstoque" />
                                                <label for="checkSomenteCEstoque">
                                                    Somente com Estoque
                                                </label>
                                            </div>
                                            <div class="icheck-primary d-none">
                                                <input type="checkbox" id="checkEstoqueMaxEMin" name="estoqueMaxEMin" />
                                                <label for="checkEstoqueMaxEMin">
                                                    Estoque Máx. e Mín.
                                                </label>
                                            </div>
                                            <div class="icheck-primary ml-2 d-none">
                                                <input type="checkbox" id="checkConsiderarDepositos" name="considerarDepositos" />
                                                <label for="checkConsiderarDepositos">
                                                    Considerar Depósitos
                                                </label>
                                            </div>
                                            <div class="icheck-primary ml-2">
                                                <input type="checkbox" id="checkEtiquetaTag" name="etiquetaTag" />
                                                <label for="checkEtiquetaTag">
                                                    Etiqueta TAG
                                                </label>
                                            </div>
                                        </fieldset>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-3 col-3 mt-4 pl-0" id="DepositoTour">
                                            <label data-error="wrong" data-success="right" for="txtDeposito">Depósito: *</label>
                                            <div class="input-group">
                                                <!-- <input type="text" autocomplete="off" class="input-default focus form-control" id="txtDeposito" name="txtDeposito" class="form-control" placeholder="Depósito"> -->
                                                <select class="js-example-programmatic js-states form-control" id="txtDeposito" name="txtDeposito" multiple="multiple"> </select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnDeposito" name="btnDeposito" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaDeposito" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-3 col-3 mt-4" id="CorTour">
                                            <label data-error="wrong" data-success="right" for="txtCor">Cor: *</label>
                                            <div class="input-group">
                                                <!-- <input type="text" autocomplete="off" class="input-default focus form-control" id="txtCor" name="txtCor" class="form-control" placeholder="Cor"> -->
                                                <select class="js-example-programmatic js-states form-control" id="txtCor" name="txtCor" multiple="multiple"> </select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnCor" name="btnCor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaCor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-3 col-3 mt-4" id="QualidadeTour">
                                            <label data-error="wrong" data-success="right" for="txtQualidade">Qualidade: *</label>
                                            <div class="input-group">
                                                <!-- <input type="text" autocomplete="off" class="input-default focus form-control" id="txtQualidade" name="txtQualidade" class="form-control" placeholder="Qualidade"> -->
                                                <select class="js-example-programmatic js-states form-control" id="txtQualidade" name="txtQualidade" multiple="multiple"> </select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnQualidade" name="btnQualidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaQualidade" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-3 col-3 mt-4" id="LoteTour">
                                            <label data-error="wrong" data-success="right" for="txtLote">Lote: *</label>
                                            <div class="input-group">
                                                <!-- <input type="text" autocomplete="off" class="input-default focus form-control" id="txtLote" name="txtLote" class="form-control" placeholder="Lote"> -->
                                                <select class="js-example-programmatic js-states form-control" id="txtLote" name="txtLote" multiple="multiple"> </select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnLote" name="btnLote" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaLote" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row mt-2">
                                        <div class="d-flex align-items-center">
                                            <button type="button" id="btnConsultar" class="btn btn-primary btn-sisp">Consultar</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <fieldset>
                                <div class="card-body" style="padding-left: 0rem!important; padding-right: 0rem!important;">
                                    <form id="msform" name="msform">
                                        <div class="card card-body" style="padding-top: 10px;">
                                            <div class="row">
                                                <div class="col-sm-12 table-responsive table-selecttable-lg">
                                                    <table id="tabelaItensMat" class="table table-sm table-select table-hover" width="100%">
                                                        <thead>
                                                        </thead>
                                                        <tbody>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-12 d-flex justify-content-between mt-3">
                                            <div class="col-4">
                                                <button type="button" id="btnGerarBarras" class="btn btn-danger btn-sisp">Gerar Barras</button>
                                                <button type="button" id="btnGerarEAN13" class="btn btn-dark btn-sisp text-white">Gerar EAN13</button>
                                                <button type="button" id="btnImpBarras" class="btn btn-secondary btn-sisp">Imprimir Barras</button>
                                            </div>
                                            <div class="col-4" style="flex-basis: fit-content;">
                                                <button type="button" id="btnVoltar" class="btn btn-secondary btn-sisp">Voltar</button>
                                                <button type="button" id="btnGravar" class="btn btn-primary btn-sisp">Gravar</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside><!-- /.control-sidebar -->
        <?php
        include_once('../../modais.php');
        ?>
    </main>

    <script src="../plugins/jquery/jquery.min.js?versao=3.255.7.1"></script>
    <script src="../dist/js/jquery.maskMoney.min.js?versao=3.255.7.1"></script>
    <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.255.7.1"></script>
    <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.255.7.1"></script>
    <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.255.7.1"></script>
    <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.255.7.1"></script>
    <script src="../plugins/toastr/toastr.min.js?versao=3.255.7.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.255.7.1"></script>
    <script src="../dist/js/adminlte.min.js?versao=3.255.7.1"></script>
    <script src="../dist/js/requisicoes.js?versao=3.255.7.1"></script>
    <script src="../dist/js/loadingoverlay.min.js?versao=3.255.7.1"></script>
    <script src="../dist/js/valida_cpf_cnpj.js?versao=3.255.7.1"></script>
    <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.255.7.1"></script>
    <script src="../dist/js/dataTables.keyTable.js?versao=3.255.7.1"></script>
    <script src="../dist/js/sisplan.js?versao=3.255.7.1"></script>
    <script src="../utils/funcoes.js?versao=3.255.7.1"></script>
    <script src="../utils/cookies.js?versao=3.255.7.1"></script>
    <script src="../dist/js/driver.min.js?versao=3.255.7.1"></script>
    <script src="../plugins/select2/js/select2.full.min.js?versao=3.255.7.1"></script>
    <script type="text/javascript" src="../config.js?versao=3.255.7.1"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.3/jquery.scrollTo.min.js"></script>
    <script>
        $(document).ready(async function() {
            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

            let usuario = getCookie('usuario');
            let empresa = getCookie('empresa');

            $('#btnVoltar').on('click', function(event) {
                event.preventDefault();
                window.history.back();
            });


            sArquivo = `${BASE_URI}/pages/matitensest/matitensest.js?versao=3.255.7.1`;
            const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');

            const temAcesso = await temAcessoTela('MATITENSEST');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            await insereJavaScriptPagina(sArquivo);

            habilitaCamposObrigatoriosTela(nomeTela);
        });
    </script>
</body>

</html>