<?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 | Cor Compra</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.264.22.1">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.264.22.1">

    <!-- Google Font: Source Sans Pro -->
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <link rel="stylesheet" href="dist/css/custom.css?versao=3.264.22.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.264.22.1">
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.264.22.1">
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.264.22.1" />
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.264.22.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.264.22.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.264.22.1">
    <link rel="stylesheet" type="text/css" href="dist/css/sisplan.newColorsButtons.css?versao=3.264.22.1" />
    <style>
        #tabelaCorCompra td div button {
            padding: .0rem .5rem;
            margin-top: .1rem;
            margin-bottom: .2rem;
        }

        #tabelaCorCompra td {
            padding: 0 !important;
            padding-left: 10px !important;
        }

        #tabelaCorCompra tbody td,
        #tabelaCorCompra thead {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            padding: 0 !important;
            padding-left: 10px !important;
        }

        .form-check {
            margin-left: 8px;
            margin-bottom: 10px;
        }

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

        .border-Field {
            border: 1px solid var(--font-color) !important;
            padding: 0 0.5em 0 0.5rem !important;
            margin: 9px 0 0em 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
            border-radius: 3px !important;
        }

        .icheck-primary {
            margin-top: 0px !important;
        }

        .modal-header {
            padding: 0.5rem 1rem 0.1rem !important;
            align-items: center !important;
        }

        .modal-footer .btn {
            padding: 0.375rem 0.75rem !important;
        }

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

        .container {
            padding: 0px 4px !important;
        }

        .main-header,
        .main-sidebar,
        footer {
            display: none;
        }

        .col-md-1,
        .col-md-10,
        .col-md-11,
        .col-md-12,
        .col-md-2,
        .col-md-3,
        .col-md-4,
        .col-md-5,
        .col-md-6,
        .col-md-7,
        .col-md-8,
        .col-md-9 {
            padding-right: 7.5px;
            padding-left: 7.5px;
        }

        .row {
            align-items: flex-end !important;
        }
    </style>
</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">Cor Compra</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 class="col-sm-6">

                        </div><!-- /.col -->
                    </div><!-- /.row -->
                </div>
                <div class="container-fluid" id="tutorTabela">
                    <div class="row card">
                        <div class="col-sm-12 mt-3">
                            <button class="btn btn-success btn-sisp ml-2" id="btnFiltros"><span class="fas fa-search"></span> Filtros</button>
                            <button class="btn btn-danger btn-sisp" id="btnNovaCompra"><span class="fas fa-plus"></span> Incluir</button>
                            <button id="btnImprimir" class="btn-sisp btn btn-secondary"><i class="fas fa-print"></i> Imprimir</button>

                        </div>
                        <div class="col-sm-12 table-responsive card-body" id="divTabelaCorCompra">
                            <h5>Lista de Cor Compra</h5>
                            <table id="tabelaCorCompra" class="table table-sm 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 ml-1">
                                <div class="row col-12">
                                    <div class="col-lg-auto col-12">
                                        <fieldset class="form border-Field p-0">
                                            <legend class="textoBorda pb-0 mb-0">Tipo Item</legend>
                                            <div class="form-row justify-content-around">
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" checked="" id="rdTodosTipo" name="tipoItem"><label for="rdTodosTipo" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdMaterial" name="tipoItem"><label for="rdMaterial" class="container escondeRadio">Material</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdProduto" name="tipoItem"><label for="rdProduto" class="container escondeRadio">Produto</label></div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>

                                    <div class="col-lg-auto col-12">
                                        <fieldset class="form border-Field p-0">
                                            <legend class="textoBorda pb-0 mb-0">Fornecedor</legend>
                                            <div class="form-row justify-content-around">
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" checked="" id="rdTodosFornecedor" name="fornecedor"><label for="rdTodosFornecedor" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdFornecedorAtivo" name="fornecedor"><label for="rdFornecedorAtivo" class="container escondeRadio">Ativos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdFornecedorInativo" name="fornecedor"><label for="rdFornecedorInativo" class="container escondeRadio">Inativos</label></div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>

                                    <div class="col-lg-auto col-12">
                                        <fieldset class="form border-Field p-0">
                                            <legend class="textoBorda pb-0 mb-0">Produto</legend>
                                            <div class="form-row justify-content-around">
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" checked="" id="rdTodosProdutos" name="produto"><label for="rdTodosProdutos" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdProdutoAtivo" name="produto"><label for="rdProdutoAtivo" class="container escondeRadio">Ativos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdProdutoInativo" name="produto"><label for="rdProdutoInativo" class="container escondeRadio">Inativos</label></div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>
                                    <div class="col-lg-auto col-12">
                                        <fieldset class="form border-Field p-0">
                                            <legend class="textoBorda pb-0 mb-0">Material</legend>
                                            <div class="form-row justify-content-around">
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" checked="" id="rdTodosMateriais" name="material"><label for="rdTodosMateriais" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdMaterialAtivo" name="material"><label for="rdMaterialAtivo" class="container escondeRadio">Ativos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdMaterialInativo" name="material"><label for="rdMaterialInativo" class="container escondeRadio">Inativos</label></div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>
                                    <div class="col-lg-auto col-2 col-12">
                                        <fieldset class="form border-Field p-0">
                                            <legend class="textoBorda pb-0 mb-0" for="rdPadrao">Padrão</legend>
                                            <div>
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary mx-auto pl-1"><input type="checkbox" id="rdPadrao"><label for="rdPadrao"></label></div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>
                                </div>
                                <div class="row col-12 mb-3 mt-2">
                                    <div class="col-12 col-sm-6 col-md-6 col-lg-4  form-group">
                                        <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" for="dtEmissaoDe">Data de Atualização de/até: </label>
                                        <div class="relative" style="margin-top: 5px;">
                                            <div class="input-group">
                                                <input type="date" max="2500-12-31" class="input-default focus form-control mr-2" id="dtAttDe" value="1200-01-01" name="dtAttDe">
                                                <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtAttAte" value="2500-12-31" name="dtAttAte">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-12 col-sm-6 col-md-6 col-lg-4 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-12 col-sm-6 col-md-6 col-lg-4 form-group">
                                        <label data-error="wrong" data-success="right" for="txtMaterial">Material:</label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtMaterial" name="txtMaterial" multiple="multiple"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnMaterial" name="btnMaterial" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaMaterial" name="btnLimpaMaterial" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-6 col-md-6 col-lg-4 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-12 col-sm-6 col-md-6 col-lg-4 form-group">
                                        <label data-error="wrong" data-success="right" for="txtFornecedor">Fornecedor:</label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtFornecedor" name="txtFornecedor" multiple="multiple"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnFornecedor" name="btnFornecedor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaFornecedor" name="btnLimpaFornecedor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>

                                    <!-- <div class="col-12 col-sm-6 col-md-6 col-lg-4 form-group">
                                        <label data-error="wrong" data-success="right" for="txtRepresentante">Cor Fornecedor:</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control" aria-describedby="produtoError" id="txtCorFornecedor" name="txtCorFornecedor" class="form-control" placeholder="Cor Fornecedor">

                                        </div>
                                    </div> -->

                                    <div class="col-12 col-sm-6 col-md-6 col-lg-4 form-group">
                                        <label data-error="wrong" data-success="right" for="txtCodfornecedor">Cod. Fornecedor:</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control" id="txtCodfornecedor" name="txtCodfornecedor" class="form-control" placeholder="Código Fornecedor">
                                            <!-- <select class="js-example-programmatic js-states form-control" id="txtCodfornecedor" name="txtCodfornecedor" multiple="multiple"> </select> -->
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnCodfornecedor" name="btnCodfornecedor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaCodfornecedor" name="btnLimpaCodfornecedor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="modal-footer">
                            <div class="row">
                                <button class="btn btn-primary btn-sisp" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222"><span class="fas fa-trash"></span> Limpar Filtros</button>     
                                <button class="btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</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.264.22.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.264.22.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.264.22.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/sisplan.js?versao=3.264.22.1"></script>
    <script src="utils/funcoes.js?versao=3.264.22.1"></script>
    <script src="utils/cookies.js?versao=3.264.22.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.264.22.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/driver.min.js?versao=3.264.22.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/sum().js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="config.js?versao=3.264.22.1"></script>
    <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/apexcharts.js?versao=3.264.22.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('CORCOMPRA');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            sArquivo = `${BASE_URI}/pages/corcompra/acesso_corcompra/acesso_corcompra.js?versao=3.264.22.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>