<?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 | Demanda E-commerce</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/custom.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2512.9.1" />
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2512.9.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.1">
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2512.9.1" />
    <link href='dist/css/bootstrap.min.css?versao=3.2512.9.1'>
    <link rel="stylesheet" href="dist/css/custom.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/responsive.bootstrap.min.css?versao=3.2512.9.1">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="dist/css/cadastro.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2512.9.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2512.9.1">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <style>
        table td div button {
            padding: .0rem .5rem;
            margin-top: .1rem;
            margin-bottom: .2rem;
        }

        table td {
            padding: 0 !important;
            padding-left: 10px !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">Demanda E-commerce</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">
                            <!-- <ol class="breadcrumb float-sm-right">
                                
                                <li class="breadcrumb-item active">Unidade</li>
                            </ol> -->
                        </div><!-- /.col -->
                    </div><!-- /.row -->
                </div>
                <div class="container-fluid" id="tabelaDemandaForne">
                    <div class="row card">
                        <div class="col-sm-12 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="btnTransferir"><span class="fas fa-plus"></span> Transferir</button>
                        </div>
                        <div class="col-sm-12 table-responsive card-body">
                            <h5>Lista de Solicitações</h5>
                            <table id="tabelaDemanda" class="table table-sm table-select table-hover" width="100%">
                                <thead>
                                    <tr>
                                        <th class="th-sm">ID Demanda</th>
                                        <th class="th-sm">Codigo</th>
                                        <th class="th-sm">Descrição</th>
                                        <th class="th-sm">Foto</th>
                                        <th class="th-sm">Cor</th>
                                        <th class="th-sm">Desc. Cor</th>
                                        <th class="th-sm">Tam</th>
                                        <th class="th-sm">Qualidade</th>
                                        <th class="th-sm">Quantidade</th>
                                        <th class="th-sm">Status</th>
                                        <th class="th-sm">Depósito</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-body">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                <img src="" class="imagepreview" style="width: 100%;">
                            </div>
                        </div>
                    </div>
                </div>
                <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
                    <div class="modal-dialog modal-md" 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-12" id="UnidadeInfoTour">
                                        <label data-error="wrong" data-success="right" for="txtEmrpesa">Empresa </label>
                                        <div class="input-group">
                                            <input type="text" autocomplete="off" class="input-default focus form-control" id="txtEmrpesa" name="txtEmrpesa" class="form-control" placeholder="Empresa">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-empresa" name="btn-empresa" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpa-empresa" name="btn-limpa-empresa" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12" id="UnidadeInfoTour">
                                        <label data-error="wrong" data-success="right" for="txtUnidadeConsulta">Unidade </label>
                                        <div class="input-group">
                                            <input type="text" autocomplete="off" class="input-default focus form-control" id="txtUnidadeConsulta" name="txtUnidadeConsulta" class="form-control" placeholder="Unidade">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-Unidade" name="btn-Unidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpa-Unidade" name="btn-limpa-Unidade" 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="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 class="modal fade" id="modalNFE" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h4 id="modalNFE-titulo" class="modal-title">Faturar</h4>
                                <button type="button" class="close" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <div class="row">
                                    <div class="col-12">
                                        <label style="margin-bottom: .1rem!important;" data-error="wrong" data-success="right" for="txtClienteNFE">Cliente</label>
                                        <div class="input-group">
                                            <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtClienteNFE" name="txtClienteNFE" class="form-control" placeholder="Cliente">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-ClienteNFE" name="btn-ClienteNFE" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpa-ClienteNFE" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12" style="margin-top: 2%">
                                        <label style="margin-bottom: .1rem!important;" data-error="wrong" data-success="right" for="txtNaturezaNFE">Natureza</label>
                                        <div class="input-group">
                                            <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtNaturezaNFE" name="txtNaturezaNFE" class="form-control" placeholder="Natureza">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-NaturezaNFE" name="btn-NaturezaNFE" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpa-NaturezaNFE" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-12" style="margin-top: 2%">
                                        <label data-error="wrong" data-success="right" for="txtOperacaoNFE">Operação</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control" id="txtOperacaoNFE" name="txtOperacaoNFE" placeholder="Operação">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnOperacaoNFE" name="btnOperacaoNFE" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnAOperacaoNFE" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-12" style="margin-top: 2%">
                                        <label data-error="wrong" data-success="right" for="txtTabelaDePrecoNFE">Tabela de Preço</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control" id="txtTabelaDePrecoNFE" name="txtTabelaDePrecoNFE" placeholder="Tabela de Preço">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnTabelaDePrecoNFE" name="btnTabelaDePrecoNFE" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnLimpaTabelaDePrecoNFE" 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">
                                    <div class="col-sm-12">
                                        <button type="button" id="btn_confirmar_nfe" class="btn btn-danger"> Confirmar</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="modal-transferencia" 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">Atender Solicitações</h4>
                                <button type="button" class="close" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <div class="row">
                                    <div class="col-12" id="UnidadeInfoTour">
                                        <fieldset style="position: relative; opacity: 1;">
                                            <div class="form-card" id="formcard1">
                                                <div class="row">
                                                    <div class="col-lg-4  col-12 form-group">
                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtNumero">Número Transferência *</label>
                                                        <input type="text" class="input-default focus form-control" id="txtNumero" required="" aria-describedby="codError txtNumero-error" name="txtNumero" placeholder="Número Transferência" aria-invalid="false">
                                                        <input type="text" class="input-default focus form-control d-none" id="txtLancamento" required="" name="txtLancamento" aria-describedby="txtLancamento-error" data-chave="3046827" data-selecionado="true">
                                                        <span id="txtNumero-error" class="error invalid-feedback" style="display: none;"></span><span id="txtLancamento-error" class="error invalid-feedback" style="display: none;"></span>
                                                    </div>
                                                    <div class="col-lg-4 col-12 form-group">
                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtFuncionario">Funcionário *</label>
                                                        <div class="input-group">
                                                            <input type="text" class="input-default focus form-control validate ui-autocomplete-input" required="" id="txtFuncionario" name="txtFuncionario" placeholder="Funcionário" autocomplete="off" aria-describedby="txtFuncionario-error" aria-invalid="false" data-selecionado="true" data-chave="70416" data-desc="RICARDO FERREIRA COELHO">
                                                            <div class="input-group-append">
                                                                <button class="btn bg-danger" id="btnFuncionario" name="btnFuncionario" data-button="absolute" type="button">
                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                </button>
                                                                <button class="btn bg-danger" id="btnLimparFuncionario" type="button">
                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                </button>
                                                            </div>
                                                        </div>
                                                        <span id="txtFuncionario-error" class="error invalid-feedback" style="display: none;"></span>
                                                    </div>
                                                    <div class="col-lg-4 col-12 form-group">
                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtTipoMov">Tipo Movimento *</label>
                                                        <div class="input-group">
                                                            <input type="text" class="input-default focus form-control validate ui-autocomplete-input" required="" id="txtTipoMov" name="txtTipoMov" placeholder="Tipo Movimento" autocomplete="off" aria-invalid="false">
                                                            <div class="input-group-append">
                                                                <button class="btn bg-danger" id="btnTipoMov" name="btnTipoMov" data-button="absolute" type="button">
                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                </button>
                                                                <button class="btn bg-danger" id="btnLimparTipoMov" type="button">
                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                </button>
                                                            </div>
                                                        </div>
                                                        <span id="txtTipoMov-error" class="error invalid-feedback" style="display: none;"></span>
                                                    </div>
                                                    <div class="col-lg-4 col-12 form-group d-none">
                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtDeposito">Depósito *</label>
                                                        <div class="input-group">
                                                            <input type="text" class="input-default focus form-control validate ui-autocomplete-input" required="" id="txtDeposito" name="txtDeposito" placeholder="Depósito" autocomplete="off" aria-invalid="false">
                                                        </div>
                                                        <span id="txtTipoMov-error" class="error invalid-feedback" style="display: none;"></span>
                                                    </div>
                                                    <div class="col-lg-4 col-12 form-group">
                                                        <label data-error="wrong" data-success="right" for="txtBarraConferencia">Código de Barras</label>
                                                        <div class="input-group">
                                                            <input type="text" class="input-default focus form-control validate " id="txtBarraConferencia" name="txtBarraConferencia" placeholder="Código de Barras" autofocus>
                                                        </div>
                                                    </div>
                                                    <div class="col-lg-12 col-12 table-responsive card">
                                                        <table id="tabelaTransferencia" class="table table-sm table-select table-hover" style="width: 100%" width="100%">
                                                            <thead>
                                                                <tr>
                                                                    <th class="th-sm">Status</th>
                                                                    <th class="th-sm">ID Demanda</th>
                                                                    <th class="th-sm">Dep Emp.</th>
                                                                    <th class="th-sm">Codigo</th>
                                                                    <th class="th-sm">Descrição</th>
                                                                    <th class="th-sm">Foto</th>
                                                                    <th class="th-sm">Cor</th>
                                                                    <th class="th-sm">Desc. Cor</th>
                                                                    <th class="th-sm">Tam</th>
                                                                    <th class="th-sm">Qualidade</th>
                                                                    <th class="th-sm">Qtde. Solicitada</th>
                                                                    <th class="th-sm">Qtde. Estoque</th>
                                                                    <th class="th-sm">Qtde. Conf.</th>
                                                                    <th class="th-sm">Depósito</th>
                                                                    <th class="th-sm">Barra28</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <div class="row">
                                    <button class="btn btn-secondary btn-sisp" id="btnCancelar">Cancelar</button>
                                    <button class="btn btn-danger ml-2 btn-sisp" id="btnConfirmar">Confirmar</button>
                                    <!-- <button class="ml-2 btn btn-primary btn-sisp" id="btnConfirmar"><i class="fas fa-print"></i> Imprimir</button> -->
                                </div>
                            </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.2512.9.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2512.9.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/sisplan.js?versao=3.2512.9.1"></script>
    <script src="utils/funcoes.js?versao=3.2512.9.1"></script>
    <script src="utils/cookies.js?versao=3.2512.9.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.2512.9.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/driver.min.js?versao=3.2512.9.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.2512.9.1"></script>

    <script type="text/javascript" src="dist/js/sum().js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="config.js?versao=3.2512.9.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');

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

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

            sArquivo = `${BASE_URI}/pages/demanda_ecommerce/acesso_demanda_ecommerce/acesso_demanda_ecommerce.js?versao=3.2512.9.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>