<?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 | Integração Sigep</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2511.13.1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2511.13.1">
  <!--e1Google 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 rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2511.13.1" />

  <link href='dist/css/bootstrap.min.css?versao=3.2511.13.1'>
  <link rel="stylesheet" href="dist/css/custom.css?versao=3.2511.13.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2511.13.1">
  <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.2511.13.1">
  <link rel="stylesheet" type="text/css" href="dist/css/responsive.bootstrap.min.css?versao=3.2511.13.1">
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.2511.13.1">
  <link rel="stylesheet" href="dist/css/cadastro.css?versao=3.2511.13.1">
  <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.2511.13.1">

  <!-- Toastr -->
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2511.13.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2511.13.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2511.13.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="plugins/select2/css/select2.min.css?versao=3.2511.13.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2511.13.1">
  <style>
    .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 1.0em 0 1.0em !important;
      margin: 0 0 0 0 !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
      border-radius: 3px !important;
    }

    #progressbar li {
      width: 50%;
    }

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

    .rounded-none {
      border-radius: 0px;
    }

    .bordaProduto {
      padding: 10px;
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
    }
  </style>
</head>

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


    <div id="myModal" class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 id="myModalLabel" class="modal-title"></h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p id="myModalText"></p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>

    <div class="content-wrapper">
      <section class="content">
        <div class="content-header">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6 flex">
              </div>
              <div class="col-sm-6">
              </div>
            </div>
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-12 text-center p-0 mt-3 mb-2">
              <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                  <h2>Integração Sigep
                    <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>
                  </h2>
                </div>
                <div class="row">
                  <div class="col-md-12 mx-0">
                    <form id="msform">
                      <ul id="progressbar">
                        <li class="active" id="account" style="font-size: 100%;"><strong>Geral</strong></li>
                        <li id="confirm" style="font-size: 100%;"><strong>Finalização</strong></li>
                      </ul>
                      <fieldset class="abas" id="fieldsetAba1">
                        <div class="form-card">
                          <h2 class="fs-title">Dados Gerais</h2>
                          <div class="form-row col-xl-12 col-12" id="divFiltrosTutorial">
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" data-success="right" for="txtDataDe">Data: </label>
                              <div class="input-group" style="gap: 10px">
                                <input type="date" min="1200-01-01" max="2500-12-31" class="input-default focus form-control" id="txtDataDe" value="1200-01-01" name="txtDataDe" class="form-control">
                                <input type="date" min="1200-01-01" max="2500-12-31" class="input-default focus form-control" id="txtDataAte" value="2500-12-31" name="txtDataAte" class="form-control">
                              </div>
                            </div>
                            <div class="form-group col-lg-6 d-xl-none"></div>
                            <div class="form-group col-xl-2 col-lg-4 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="selectStatusEtiquetas">Etiquetas:</label>
                              <div class="input-group">
                                <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectStatusEtiquetas" aria-describedby="tipoError" class="custom-select focus">
                                  <option selected value="">Todas</option>
                                  <option value="S">Impressas</option>
                                  <option value="N">Não impressas</option>
                                </select>
                              </div>
                            </div>
                            <div class="form-group col-xl-2 col-lg-4 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="selectTipoNotas">Tipo das Notas:</label>
                              <div class="input-group">
                                <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectTipoNotas" aria-describedby="tipoError" class="custom-select focus">
                                  <option selected value="">Todos</option>
                                  <option value="S">Saída</option>
                                  <option value="E">Entrada</option>
                                </select>
                              </div>
                            </div>
                            <div class="form-group col-xl-2 col-lg-4 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="selectStatusNotas">Notas:</label>
                              <div class="input-group">
                                <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectStatusNotas" aria-describedby="tipoError" class="custom-select focus">
                                  <option selected value="">Todas</option>
                                  <option value="S">Geradas</option>
                                  <option value="N">Não geradas</option>
                                </select>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtCliente">Cliente:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtCliente" name="txtCliente" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnCliente" name="btnCliente" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaCliente" name="btnLimpaCliente" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtRepresentante">Representante:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtRepresentante" name="txtRepresentante" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnRepresentante" name="btnRepresentante" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaRepresentante" name="btnLimpaRepresentante" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtTipoPedido">Tipo de Pedido:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtTipoPedido" name="txtTipoPedido" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnTipoPedido" name="btnTipoPedido" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaTipoPedido" name="btnLimpaTipoPedido" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPedido">Pedido:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtPedido" name="txtPedido" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnPedido" name="btnPedido" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaPedido" name="btnLimpaPedido" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtFatura">Fatura:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtFatura" name="txtFatura" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnFatura" name="btnFatura" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaFatura" name="btnLimpaFatura" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtUf">UF:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtUf" name="txtUf" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnUf" name="btnUf" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaUf" name="btnLimpaUf" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtCidade">Cidade:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtCidade" name="txtCidade" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnCidade" name="btnCidade" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaCidade" name="btnLimpaCidade" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtTransportadora">Transportadora:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtTransportadora" name="txtTransportadora" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnTransportadora" name="btnTransportadora" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaTransportadora" name="btnLimpaTransportadora" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-6 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtHistorico">Histórico:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtHistorico" name="txtHistorico" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btnHistorico" name="btnHistorico" data-button="absolute" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger" id="btnLimpaHistorico" name="btnLimpaHistorico" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-xl-4 col-lg-12 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtObservacaoPedido">Observação Pedido:</label>
                              <input type="text" class="input-default focus form-control" id="txtObservacaoPedido" aria-describedby="classeError" name="txtObservacaoPedido" class="form-control" placeholder="Observação Pedido">
                            </div>
                            <div class="form-group col-xl-4 col-lg-12 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtChaveAcesso">Chave de Acesso:</label>
                              <input type="text" class="input-default focus form-control" id="txtChaveAcesso" aria-describedby="classeError" name="txtChaveAcesso" class="form-control" placeholder="Chave de Acesso">
                            </div>
                            <div class="form-group col-xl-4 col-lg-12 col-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtFormaEnvio">Forma de Envio:</label>
                              <input type="text" class="input-default focus form-control" id="txtFormaEnvio" aria-describedby="classeError" name="txtFormaEnvio" class="form-control" placeholder="Forma de Envio">
                            </div>
                          </div>
                          <div class="flex justify-content-end">
                            <button type="button" id="btnConsultar" class="btn btn-sisp btn-primary next" data-dismiss="modal">Consultar</button>
                          </div>
                        </div>
                      </fieldset>
                      <fieldset class="abas" id="fieldsetAba2">
                        <div class="form-card">
                          <div class="row my-2" style="gap: 10px" id="divResultadosTutorial">
                            <div class="flex bordaProduto col">
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="selectServico">Serviço:</label>
                                <div class="input-group">
                                  <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectServico" aria-describedby="tipoError" class="custom-select focus">
                                  </select>
                                  <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnGravarServicos" name="btnToken" data-button="absolute" type="button" title="Atualiza os serviços da tabela (SERV_SIGEP) utilizado pela integração.">
                                      <i class="m-0 p-0 fas fa-check-circle"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="selectServicosAdicionais">Serviços adicionais:</label>
                                <div class="input-group">
                                  <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectServicosAdicionais" aria-describedby="tipoError" class="custom-select focus">
                                  </select>
                                  <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnLimpaServicosAdicionais" name="btnLimpaServicosAdicionais" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <div class="flex bordaProduto col">
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="selectTipoObjeto">Tipo objeto:</label>
                                <div class="input-group">
                                  <select class="input-default focus form-control" data-dropdown-css-class="select2-danger" id="selectTipoObjeto" aria-describedby="tipoError" class="custom-select focus">
                                    <option value="1">1 - Envelope</option>
                                    <option value="2">2 - Pacote/Caixa</option>
                                    <option value="3">3 - Rolo/Cilindro</option>
                                  </select>
                                </div>
                              </div>
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtAltura">Altura:</label>
                                <input type="text" class="input-default focus form-control text-right duasCasasDecimaisQuantityFormat" id="txtAltura" aria-describedby="classeError" name="txtAltura" class="form-control" placeholder="0.00">
                              </div>
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtLargura">Largura:</label>
                                <input type="text" class="input-default focus form-control text-right duasCasasDecimaisQuantityFormat" id="txtLargura" aria-describedby="classeError" name="txtLargura" class="form-control" placeholder="0.00">
                              </div>
                              <div class="form-group col">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtComprimento">Comprimento:</label>
                                <input type="text" class="input-default focus form-control text-right duasCasasDecimaisQuantityFormat" id="txtComprimento" aria-describedby="classeError" name="txtComprimento" class="form-control" placeholder="0.00">
                              </div>
                            </div>
                            <div class="col">
                              <h4>Notas</h4>
                              <div class="table-responsive" style="max-height: 485px">
                                <table id="tabelaNotas" class="table table-sm table-select table-hover" width="100%">
                                  <thead>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                          <div class="row align-items-end" style="gap: 10px">
                            <button type="button" id="btnVoltar" class="btn btn-sisp btn-secondary previous" style="max-height: 38px">Voltar</button>
                            <div class="ml-auto">
                              <label for="txtOrdem">Opção de Relatório:</label>
                              <div class="relative d-flex align-items-center">
                                <select id="txtOrdem" class="input-default focus custom-select">
                                </select>
                                <button class="btn btn-sm btn-success ml-2 btnEdicaoRelatorio" type="button" title="Edição de ordenações">
                                  <i class="fas fa-check"></i>
                                </button>
                              </div>
                              <button type="button" id="btnImprimir" class="btn btn-sisp btn-secondary mt-2" style="max-height: 38px">Imprimir</button>
                              <button type="button" id="btnConfigurarRegra" class="btn btn-sisp btn-danger mt-2" style="max-height: 38px">Configurar Seguro</button>
                              <button type="button" id="btnGerarEtiqueta" class="btn btn-sisp btn-danger mt-2" style="max-height: 38px">Gerar Etiqueta</button>
                            </div>
                          </div>
                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>

  <div class="modal fade" id="modalConfigurarRegra" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="modalConfigurarRegra" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title" id="tituloDesdobra">Regra de seguro por UF</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="col-12 flex flex-wrap">
            <div class="col-xl-8 col-12 form-group">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtUfRegra">UF</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control inputRegra" disabled id="txtUfRegra" required aria-describedby="uError" name="txtUfRegra" class="form-control" placeholder="UF">
                <div class="input-group-append">
                  <button class="btn bg-danger create botaoRegra" id="btnUfRegra" disabled name="btnUfRegra" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger create botaoRegra" id="btnLimpaUfRegra" disabled type="button">
                    <i class="m-0 p-0 fas fa-trash"></i>
                  </button>
                </div>
              </div>
            </div>
            <div class="form-group col-xl-2 col-6">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorRegra">Valor:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputRegra" disabled id="txtValorRegra" aria-describedby="classeError" name="txtValorRegra" class="form-control" placeholder="0,00">
            </div>
            <div class="form-group col-xl-2 col-6">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtServicoRegra">Serviço:</label>
              <input type="text" class="input-default focus form-control inputRegra" maxlength="2" disabled id="txtServicoRegra" aria-describedby="classeError" name="txtServicoRegra" class="form-control" placeholder="00">
            </div>
            <div class="col-12 d-flex align-items-center mt-2 pt-1" style="gap: 10px">
              <button class="btn btn-primary btn-sisp" id="btnIncluirRegra" title="Clique para incluir um novo item">Incluir</button>
              <button class="btn btn-primary btn-sisp d-none" id="btnConfirmarRegra" title="Clique para confirmar uma inclusão/alteração">Confirmar</button>
              <button class="btn btn-danger btn-sisp d-none" id="btnDesistirRegra" title="Clique para desistir de uma inclusão/alteração">Desistir</button>
            </div>
          </div>
          <div class="col-12 table-responsive card-body">
            <table id="tabelaRegras" class="table table-sm table-select table-hover" width="100%">
              <thead>
              </thead>
              <tbody>
              </tbody>
            </table>
          </div>
        </div>
        <div class="modal-footer justify-content-start">
          <button class="btn btn-primary btn-sisp" id="btnGravarRegra">Gravar</button>
          <button class="btn btn-danger btn-sisp ml-auto" data-dismiss="modal" id="btnFecharRegra">Fechar</button>
        </div>
      </div>
    </div>
  </div>
  </div>

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

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
  </div>

  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js?versao=3.2511.13.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2511.13.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2511.13.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2511.13.1"></script>
  <script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.2511.13.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.2511.13.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2511.13.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.2511.13.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.2511.13.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.2511.13.1"></script>
  <script src="plugins/jquery-validation/jquery.validate.min.js?versao=3.2511.13.1"></script>
  <script src="dist/js/sisplan.js?versao=3.2511.13.1"></script>
  <script src="utils/funcoes.js?versao=3.2511.13.1"></script>
  <script src="utils/cookies.js?versao=3.2511.13.1"></script>
  <script src="dist/js/jquery.maskMoney.min.js?versao=3.2511.13.1"></script>
  <script src="dist/js/driver.min.js?versao=3.2511.13.1"></script>
  <script src="dist/js/dataTables.keyTable2.js?versao=3.2511.13.1"></script>
  <script type="text/javascript" src="config.js?versao=3.2511.13.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.2511.13.1"></script>
  <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.2511.13.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('INTEGRACAO_SIGEP');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      const permissaoUsuarioLogado = await permissaoAcessos("INTEGRACAO_SIGEP");

      if (permissaoUsuarioLogado.INCLUI == 'N') {
        await criaMensagemErro("Sem permissão para incluir!", () => {
          window.location.href = `${BASE_URI}/index`
        });
        return;
      }

      sArquivo = `${BASE_URI}/pages/integracao_sigep/integracao_sigep.js?versao=3.2511.13.1`;
      insereJavaScriptPagina(sArquivo);

      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
      habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>
</body>

</html>