<?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 | Amarração Fornecedor</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.2510.21.1">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2510.21.1">

    <!-- Google Font: Source Sans Pro -->
    <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.2510.21.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2510.21.1">
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2510.21.1" />
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2510.21.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2510.21.1" />
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.2510.21.1">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.2510.21.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2510.21.1">
    <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.2510.21.1">

    <style>
        .table.dataTable {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        .bordaCampos {
            border: solid #e0e4e6;
            border-radius: 4px;
            border-width: 2px;
            padding-top: 2%;
            padding-bottom: 0%;
        }

        .bordaCampos:first-child {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: center;
        }

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

        .border-Field {
            border: 1.0px solid var(--font-color) !important;
            padding: 0 1.0em 1.0em 1.0em !important;
            margin: 0 0 1.0em 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
            padding-bottom: 0px !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">Amarração Fornecedor</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="tabelaTipoForne">
                    <div class="card">
                        <div class="row">
                            <div class="col-sm-12 ml-3 mt-3">
                                <button class="btn btn-success btn-sisp" id="btnFiltros"><span class="fas fa-search"></span> Filtros</button>
                                <button class="btn btn-danger btn-sisp" id="btnNovoCadastro"><span class="fas fa-plus"></span> Incluir</button>
                            </div>
                            <div class="col-sm-12 table-responsive card-body">
                                <table id="tabelaAmarracaoFornecedor" class="table table-sm-sisp table-select table-hover" width="100%">
                                    <thead>
                                        <tr>
                                            <th class="th-sm">ID
                                            </th>
                                            <th class="th-sm">Cód. Mat
                                            </th>
                                            <th class="th-sm">Decrição
                                            </th>
                                            <th class="th-sm">UN
                                            </th>
                                            <th class="th-sm">Valor Aval.
                                            </th>
                                            <th class="th-sm">Fornecedor
                                            </th>
                                            <th class="th-sm">Desc. Fornecedor
                                            </th>
                                            <th class="th-sm">Cód. Fornecedor
                                            </th>
                                            <th class="th-sm">Desc. Fornec.
                                            </th>
                                            <th class="th-sm">Preço
                                            </th>
                                            <th class="th-sm">Tipo
                                            </th>
                                            <th class="th-sm">Grupo
                                            </th>
                                            <th class="th-sm">Desc. Grupo
                                            </th>
                                            <th class="th-sm">Dias Entrega
                                            </th>
                                            <th class="th-sm">Peso
                                            </th>
                                            <th class="th-sm">Data Atualiza
                                            </th>
                                            <th class="th-sm">Gramatura
                                            </th>
                                            <th class="th-sm">Largura
                                            </th>
                                            <th class="th-sm">Tela
                                            </th>
                                            <th class="th-sm">Cor
                                            </th>
                                            <th class="th-sm">Tamanho
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </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</legend>
                                            <div class="form-row justify-content-around">
                                                <div class="d-flex">
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTipoTodos" checked name="tipo"><label for="rdTipoTodos" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTipoMaterial" name="tipo"><label for="rdTipoMaterial" class="container escondeRadio">Material</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTipoProduto" name="tipo"><label for="rdTipoProduto" class="container escondeRadio">Produto</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTipoServico" name="tipo"><label for="rdTipoServico" class="container escondeRadio">Serviço</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">Tela</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="rdTelaTodos" name="tela"><label for="rdTelaTodos" class="container escondeRadio">Todos</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTelaManual" name="tela"><label for="rdTelaManual" class="container escondeRadio">Manual</label></div>
                                                    <div class="radio-group form-radio icheck-primary"><input type="radio" id="rdTelaNotas" name="tela"><label for="rdTelaNotas" class="container escondeRadio">Notas</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="dtAttDe">Data Atualiza 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 d-none" id="inputProduto">
                                        <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" id="inputMaterial">
                                        <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 d-none" id="inputServico">
                                        <label data-error="wrong" data-success="right" for="txtServico">Serviço: </label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtServico" name="txtServico" multiple="multiple">
                                            </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnServico" name="btnServico" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaServico" name="btnLimpaServico" 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="txtCodFornecedor">Código Fornecedor:</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default" id="txtCodFornecedor" name="txtCodFornecedor" placeholder="Código 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="txtGrupoMA">Grupo Material:</label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtGrupoMA" name="txtGrupoMA" multiple="multiple"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnGrupoMA" name="btnGrupoMA" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaGrupoMA" name="btnLimpaGrupoMA" 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.2510.21.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2510.21.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2510.21.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2510.21.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2510.21.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.2510.21.1"></script>
    <script src="dist/js/sisplan.js?versao=3.2510.21.1"></script>
    <script src="utils/funcoes.js?versao=3.2510.21.1"></script>
    <script src="utils/cookies.js?versao=3.2510.21.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.2510.21.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.2510.21.1"></script>
    <script src="dist/js/driver.min.js?versao=3.2510.21.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.2510.21.1"></script>
    <script src="plugins/select2/js/select2.full.min.js?versao=3.2510.21.1"></script>
    <script type="text/javascript" src="dist/js/sum().js?versao=3.2510.21.1"></script>
    <script type="text/javascript" src="config.js?versao=3.2510.21.1"></script>
    <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.2510.21.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('AMARRACAO_FORNECEDOR');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            sArquivo = `${BASE_URI}/pages/amarracao_fornecedor/acesso_amarracao_fornecedor/acesso_amarracao_fornecedor.js?versao=3.2510.21.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>