<?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 | Preço Terceiros</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="dist/css/custom.css?versao=3.258.28.1">
    <link rel="stylesheet" href="dist/css/dataTables.bootstrap4.min.css?versao=3.258.28.1" type="text/css" />
    <link rel="stylesheet" href="dist/css/driver.min.css?versao=3.258.28.1" type="text/css" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.258.28.1">
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.258.28.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.258.28.1">
    <link rel="stylesheet" href="dist/css/sisplan.newColorsButtons.css?versao=3.258.28.1" type="text/css" />
    <link rel="stylesheet" href="dist/css/sisplan.adjustDataTableButtons.css?versao=3.258.28.1" type="text/css" />
    <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.258.28.1" type="text/css">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.258.28.1">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.258.28.1">
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="shortcut icon" href="favicon.ico">
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <div class="content-wrapper">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6 flex">
                            <h1 class="m-0 text-dark">Preço Terceiros por Cor/Tam</h1>
                            <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                                <i class="fas fa-question-circle"></i></button>
                        </div>
                    </div>
                </div>
                <div class="container-fluid">
                    <div class="row card">
                        <div class="col-sm-12 d-flex justify-content-between" style="margin-top: 8px; padding-left: 20px; padding-right: 20px; z-index: 9999;">
                            <div class="d-flex align-items-center mt-2">
                                <button class="btn btn-sisp btnFiltros btn-sisp" id="btnFiltros"><i class="fas fa-filter"></i> Filtros</button>
                                <button class="btn btn-sisp btn-danger btn-sisp marginBtnH" id="btnIncluir" href="pages/fac_preco_cor_tam/fac_preco_cor_tam/create"><i class="fas fa-plus"></i> Incluir</button>
                                <button class="btn btn-sisp btn-secondary marginBtnH" id="btnImprimir"><i class="fas fa-print"></i> Imprimir</button>
                            </div>
                        </div>
                        <div class="col-sm-12 table-responsive card-body" style="margin-top: -15px; height: 50vh">
                            <table id="tabelaProdutos" class="table table-responsive-sm table-sm-sisp table-select table-hover" width="100%">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-sm-12 table-responsive card-body" style="margin-top: -15px; height: 40vh">
                            <h5>Setores</h5>
                            <table id="tabelaSetores" class="table table-responsive-sm table-sm-sisp table-select table-hover" width="100%">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
                <div class="modal-dialog modal-xl" role="document">
                    <div class="modal-content" id="modalBody">
                        <div class="modal-header">
                            <h4 class="modal-title">Filtros</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtProduto">Produto:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtProduto" name="txtProduto" multiple="multiple"></select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnProduto" name="btnProduto" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaProduto" name="btnLimpaProduto" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTabPreco">Tabela:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtTabPreco" name="txtTabPreco" multiple="multiple"></select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTabPreco" name="btnTabPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaTabPreco" name="btnLimpaTabPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtParte">Parte:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtParte" name="txtParte"></select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnParte" name="btnParte" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaParte" name="btnLimpaParte" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtSetor">Setor:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtSetor" name="txtSetor"></select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnSetor" name="btnSetor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaSetor" name="btnLimpaSetor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtCor">Cor:</label>
                                    <div class="input-group">
                                        <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" name="btnLimpaCor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTamanho">Tamanho:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtTamanho" name="txtTamanho" multiple="multiple"></select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTamanho" name="btnTamanho" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaTamanho" name="btnLimpaTamanho" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <div class="row">
                                <button class="btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
                                <button class="btn btn-danger btn-sisp marginBtnH" id="btnLimparFiltros"><span class="fas fa-trash"></span> Limpar Filtros</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div id="modal-filtros-alterar" class="modal" tabindex="-1" role="dialog">
                <div class="modal-dialog modal-xl" role="document">
                    <div class="modal-content" id="modalBody">
                        <div class="modal-header">
                            <h4 class="modal-title">Campos para Alteração</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <p class="text-center">É necessário informar estes campos para que seja possível abrir o cadastro do preço do produto.</p>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtProdutoAlt">Produto: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtProdutoAlt" name="txtProdutoAlt" placeholder="Produto">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnProdutoAlt" name="btnProdutoAlt" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaProdutoAlt" name="btnLimpaProdutoAlt" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTabPrecoAlt">Tabela: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtTabPrecoAlt" name="txtTabPrecoAlt" placeholder="Tabela">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnTabPrecoAlt" name="btnTabPrecoAlt" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaTabPrecoAlt" name="btnLimpaTabPrecoAlt" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtParteAlt">Parte: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtParteAlt" name="txtParteAlt" placeholder="Parte">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnParteAlt" name="btnParteAlt" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaParteAlt" name="btnLimpaParteAlt" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtSetorAlt">Setor: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtSetorAlt" name="txtSetorAlt" placeholder="Setor">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnSetorAlt" name="btnSetorAlt" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaSetorAlt" name="btnLimpaSetorAlt" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <div class="row">
                                <button class="btn btn-primary btn-sisp" id="btnAvancar"><span class="fas fa-arrow-right"></span> Avançar</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div id="modal-filtros-excluir" class="modal" tabindex="-1" role="dialog">
                <div class="modal-dialog modal-xl" role="document">
                    <div class="modal-content" id="modalBody">
                        <div class="modal-header">
                            <h4 class="modal-title"><i></i>Campos para Exclusão</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <p class="text-center">É necessário informar estes campos para realizar a exclusão do produto.</p>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtProdutoExc">Produto: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtProdutoExc" name="txtProdutoExc" placeholder="Produto">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnProdutoExc" name="btnProdutoExc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaProdutoExc" name="btnLimpaProdutoExc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTabPrecoExc">Tabela: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtTabPrecoExc" name="txtTabPrecoExc" placeholder="Tabela">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnTabPrecoExc" name="btnTabPrecoExc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaTabPrecoExc" name="btnLimpaTabPrecoExc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtParteExc">Parte: *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtParteExc" name="txtParteExc" placeholder="Parte">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnParteExc" name="btnParteExc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaParteExc" name="btnLimpaParteExc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-6 form-group">
                                    <label data-error="wrong" data-success="right" for="txtSetorExc">Setor:</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control controle-edicao" aria-describedby="produtoError" id="txtSetorExc" name="txtSetorExc" placeholder="Setor">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger controle-edicao" id="btnSetorExc" name="btnSetorExc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger controle-edicao" id="btnLimpaSetorExc" name="btnLimpaSetorExc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <div class="row">
                                <button class="btn btn-danger btn-sisp" id="btnExcluir"><span class="fas fa-trash"></span> Excluir</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php
    include_once('../../../modais.php');
    ?>
    <aside class="control-sidebar control-sidebar-dark">
    </aside>
    </div>
    <script src="plugins/jquery/jquery.min.js?versao=3.258.28.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.258.28.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.258.28.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.258.28.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.258.28.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.258.28.1"></script>
    <script src="dist/js/sisplan.js?versao=3.258.28.1"></script>
    <script src="utils/funcoes.js?versao=3.258.28.1"></script>
    <script src="utils/cookies.js?versao=3.258.28.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.258.28.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.258.28.1"></script>
    <script src="dist/js/driver.min.js?versao=3.258.28.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.258.28.1"></script>

    <script type="text/javascript" src="dist/js/sum().js?versao=3.258.28.1"></script>
    <script type="text/javascript" src="config.js?versao=3.258.28.1"></script>
    <script src="plugins/select2/js/select2.full.min.js?versao=3.258.28.1"></script>
    <script>
        $(document).ready(async function() {
            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

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

            ipInterno = IP_INTERNO;
            ipExterno = IP_EXTERNO;
            basicAuth = BASIC_AUTH;

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

            sArquivo = `${BASE_URI}/pages/fac_preco_cor_tam/acesso_fac_preco_cor_tam/acesso_fac_preco_cor_tam.js?versao=3.258.28.1`;
            insereJavaScriptPagina(sArquivo);
        });
    </script>
</body>

</html>