<?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 | Liberação de Expedição</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.255.15.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.255.15.1">
  <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.255.15.1">
  <link rel="stylesheet" href="dist/css/sisplan.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">
  <style>
    .radioStyle {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: 7.25px;
      height: 136px;
    }

    .campoSel {
      display: inline-block;
      position: absolute;
      width: 22px;
      height: 22px;
      border: 1px solid #D3CFC8;
      border-radius: 0;
    }
  </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">Liberação de Expedição</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 class="icheck-primary">
                <input class="form-check-input" type="checkbox" id="checkImpresso">
                <label style="margin-left: 30px; margin-top: 10px;" class="form-check-label" for="checkImpresso">Impresso</label>
              </div>
            </div>
            <div class="col-sm-6">

            </div>
          </div>
        </div>
        <div class="card col-12 mt-3 container-fluid">
          <div class="row card-body d-flex justify-content-end" id="abaGeral">

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtPedido">Pedido:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" disabled id="txtPedido" name="txtPedido" placeholder="Pedido">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Pedido" name="btn-Pedido" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Pedido" name="btn-limpa-Pedido" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtStatus">Status:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtStatus" name="txtStatus" placeholder="Status">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Status" name="btn-Status" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Status" name="btn-limpa-Status" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtFuncionario">Funcionário:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtFuncionario" name="txtFuncionario" placeholder="Funcionário">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Funcionario" name="btn-Funcionario" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Funcionario" name="btn-limpa-Funcionario" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtTransportadora">Transportadora:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtTransportadora" name="txtTransportadora" placeholder="Transportadora">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Transportadora" name="btn-Transportadora" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Transportadora" name="btn-limpa-Transportadora" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtTpVenda">Tipo de Venda:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtTpVenda" name="txtTpVenda" placeholder="Tipo de Venda">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-TpVenda" name="btn-TpVenda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-TpVenda" name="btn-limpa-TpVenda" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-3 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="txtMoeda">Moeda:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtMoeda" name="txtMoeda" placeholder="Moeda">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Moeda" name="btn-Moeda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Moeda" name="btn-limpa-Moeda" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-4 mb-md-2 mb-1">
              <label for="dtEmiIni">Emissão De/Até:</label>
              <div class="input-group">
                <input type="date" class="input-default focus form-control validate" id="dtEmissaoDe" name="EmissaoDe">  
                <input type="date" class="input-default focus form-control validate" id="dtEmissaoAte" name="EmissaoAte">
              </div>
            </div>

            <div class="col"></div>

            <div class="col-lg col-12 mb-md-2 mb-1">
              <label data-error="wrong" data-success="right" for="selectQuantidade">Qtde:</label>
              <select id="selectQuantidade" class="input-default focus custom-select">
                <option value="1" selected>1</option>
                <option value="5">5</option>
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="30">30</option>
                <option value="40">40</option>
                <option value="50">50</option>
                <option value="75">75</option>
                <option value="100">100</option>
              </select>
            </div>

            <div class="row col-12 px-0 d-flex justify-content-between align-items-end">
              <div class="col-lg-3 col-md-4 col-12 mb-3 mb-md-0 pl-0">
                <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" title="Edição de ordenações">
                    <i class="fas fa-check"></i>
                  </button>
                </div>
              </div>

              <div class="col col-md-2 mr-3 mr-md-0 mb-2 mb-md-0">
                <button class="btn-block btn btn-primary btn-sisp" id="btnConsultar" style="padding: 9px 0 9px 0;"><span class="fas fa-search"></span> Consultar</button>
              </div>
            </div>

            <div class="col-sm-12 table-responsive card-body mt-2 mt-md-4" style="border-top: 2px solid;">
              <h5>Pedidos</h5>
              <table id="tabelaPedidos" class="table table-sm table-select table-hover" width="100%">
                <thead>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>

            <div class="col-sm-12 d-flex justify-content-end">
              <button id="btnImprimir" class="btn btn-danger btn-sisp">Imprimir</button>
            </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.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 src="plugins/select2/js/select2.full.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>
    $(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('LIBERACAO_EXPEDICAO');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

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

    });
  </script>
</body>

</html>