<?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 | Cadastro de Solicitações</title>
  <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.255.15.1">
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.255.15.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 rel="stylesheet" href="../dist/css/custom.css?versao=3.255.15.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.255.15.1">
  <link rel="stylesheet" href="../dist/css/PesquisaVariosSelect2.css?versao=3.255.15.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/dataTables.bootstrap4.min.css?versao=3.255.15.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.255.15.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.255.15.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.255.15.1">
  <link rel="stylesheet" href="../plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.255.15.1">
  <link rel="stylesheet" href="../plugins/select2/css/select2.min.css?versao=3.255.15.1">
  <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.255.15.1">
  <link rel="stylesheet" href="https://cdn.datatables.net/select/1.5.0/css/select.dataTables.min.css">

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

    .table.dataTable tr td,
    .table.dataTable tr td,
    .table.dataTable th {
      padding: 4px 12px;
    }

    .pagination {
      display: flex;
      justify-content: end;
    }
  </style>

</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <main class="wrapper">
    <?php
    include_once('../../../menu.php');
    ?>
    <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 col-12">
        <div class="row mt-0">
          <div class="col-12 p-0 mb-2">
            <div class="card p-0 mb-0">
              <div class="card-header d-flex p-0 ml-4 align-items-start" style="border: none!important;box-shadow:none!important; gap: 10px;">
                <div class="flex flex-column">
                  <div class="flex my-2">
                    <h2 class="mb-0 flex">
                      <strong>Itens Compra Liberados</strong>
                    </h2>
                  </div>
                </div>
              </div>
            </div>
            <div class="form-row col-12">
              <div class="flex flex-column col-12">
                <div class="table-responsive col-12">
                  <table id="tabelaItens" class="table table-select table-hover" width="100%">
                    <thead>
                    </thead>
                    <tbody>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <div class="flex justify-content-end form-group px-4 col-12" style="gap: 8px">
            <button type="button" class="btn btn-danger btn-sisp" id="btnEnviar" style="max-height: 38px">Enviar</button>
            <button type="button" class="btn btn-secondary btn-sisp" id="btnVoltar" style="max-height: 38px">Voltar</button>
          </div>
        </div>
      </div>
    </div>
  </main>

  <?php
  include_once('../../../../../modais.php');
  include_once('../modal_manutencao.php');
  include_once('../modal_informacoes_item.php');
  ?>
  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>

  <script src="../plugins/jquery/jquery.min.js?versao=3.255.15.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.255.15.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.255.15.1"></script>
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.255.15.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.255.15.1"></script>
  <script src="../dist/js/adminlte.min.js?versao=3.255.15.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.255.15.1"></script>
  <script src="../utils/funcoes.js?versao=3.255.15.1"></script>
  <script src="../utils/cookies.js?versao=3.255.15.1"></script>
  <script src="../dist/js/requisicoes.js?versao=3.255.15.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.255.15.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.255.15.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.255.15.1"></script>
  <script type="text/javascript" src="../dist/js/sum().js?versao=3.255.15.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.255.15.1"></script>
  <script src="../plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.255.15.1"></script>
  <script src="../plugins/select2/js/select2.full.min.js?versao=3.255.15.1"></script>
  <script src="../dist/js/dataTables.keyTable2.js?versao=3.255.15.1"></script>
  <script src="https://cdn.datatables.net/select/1.5.0/js/dataTables.select.min.js"></script>
  <script src="../pages/central_compras/cadastro_central_compras/compra/modal_manutencao.js?versao=3.255.15.1" defer></script>
  <script src="../pages/central_compras/cadastro_central_compras/modal_informacoes_item.js?versao=3.255.15.1" defer></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.255.15.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.255.15.1"></script>
  <script src="../pages/central_compras/cadastro_central_compras/utils.js?versao=3.255.15.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('BAIXA_CONSUMOS');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      sArquivo = `${BASE_URI}/pages/central_compras/cadastro_central_compras/compra/itens_liberados/itens_liberados.js?versao=3.255.15.1`;
      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');

      await insereJavaScriptPagina(sArquivo);

      habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>

</body>

</html>