<?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 | Localização Estoque</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.263.26.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.263.26.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.263.26.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.263.26.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.263.26.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.263.26.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.263.26.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.263.26.1">
  <style>
    .radioStyle {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: 6px;
    }

    .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">Localização Estoque</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">Localização Estoque</li>
              </ol> -->
            </div>
          </div>
        </div>
        <div class="card container-fluid mt-3">
          <div class="row card-body" id="abaGeral">

            <div class="col-lg-4 form-group">
              <label data-error="wrong" data-success="right" for="txtCodigo">Código</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCodigo" name="txtCodigo" placeholder="Código">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Codigo" name="btn-Codigo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Codigo" name="btn-limpa-Codigo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-4 form-group">
              <label data-error="wrong" data-success="right" for="txtCor">Cor</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtCor" name="txtCor" placeholder="Cor">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Cor" name="btn-Cor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Cor" name="btn-limpa-Cor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-4 form-group">
              <label data-error="wrong" data-success="right" for="txtTamanho">Tamanho</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtTamanho" name="txtTamanho" placeholder="Tamanho">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Tamanho" name="btn-Tamanho" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Tamanho" name="btn-limpa-Tamanho" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-4 form-group">
              <label data-error="wrong" data-success="right" for="txtDeposito">Depósito</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtDeposito" name="txtDeposito" placeholder="Depósito">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-Deposito" name="btn-Deposito" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-Deposito" name="btn-limpa-Deposito" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>

            <div class="col-lg-4 form-group">
              <label data-error="wrong" data-success="right" for="txtBarra">Barra</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtBarra" name="txtBarra" placeholder="Barra">
              </div>
            </div>

            <div class="col-lg-2 form-group" style="margin-top: 27px;">
              <button class=" btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
            </div>

          </div>
          <div class="row" style="margin-top: -40px;">

            <div class="col-sm-6 table-responsive card-body" style="margin-top: 3px">
              <h5>Produtos</h5>
              <table id="tabelaProdutos" class="table table-sm table-select table-hover" width="100%">
                <thead>
                  <tr>
                    <th class="th-sm">Código
                    </th>
                    <th class="th-sm">Descrição
                    </th>
                    <th class="th-sm">Cor
                    </th>
                    <th class="th-sm">Tam
                    </th>
                    <th class="th-sm">Qual
                    </th>
                    <th class="th-sm">Foto
                    </th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>

            <div class="col-sm-6">
              <div class="row">
                <div class="col-sm-12 table-responsive card-body">
                  <h5>Locais
                    <input type="button" class="btn btn-sm btn-secondary ml-2" id="btnAdicionar" style="font-size: 50%;" value="Adicionar">
                  </h5>
                  <table id="tabelaLocais" class="table table-sm table-select table-hover" width="100%">
                    <thead>
                      <tr>
                        <th class="th-sm">Local
                        </th>
                        <th class="th-sm">Descrição
                        </th>
                        <th class="th-sm d-none">Ativo
                        </th>
                        <th class="th-sm">Remover
                        </th>
                      </tr>
                    </thead>
                    <tbody>
                    </tbody>
                  </table>
                </div>

                <div class="col-sm-12 table-responsive card-body">
                  <h5>Histórico</h5>
                  <table id="tabelaHistorico" class="table table-sm table-select table-hover" width="100%">
                    <thead>
                      <tr>
                        <th class="th-sm">Local
                        </th>
                        <th class="th-sm">Descrição
                        </th>
                        <th class="th-sm d-none">Ativo
                        </th>
                      </tr>
                    </thead>
                    <tbody>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>

            <div class="col-sm-12 d-flex justify-content-end mb-3">
              <button id="btnConfirmar" class="btn btn-danger btn-sisp">Confirmar</button>
            </div>

          </div>
        </div>
      </div>
      <!-- modal  -->
      <div id="modalAdicionar" 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">Adicionar Local</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-lg-12 form-group">
                  <label data-error="wrong" data-success="right" for="txtLocal">Local</label>
                  <div class="input-group">
                    <input type="text" class="input-default focus form-control" id="txtLocal" name="txtLocal" placeholder="Local">
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btn-Local" name="btn-Local" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btn-limpa-Local" name="btn-limpa-Local" 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="btnConfirmarAdicionar" style="background-color: #B22222; border-color: #B22222"> Adicionar</button>     
              </div>
            </div>
          </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>
  </div>
  <?php
  include_once('../../modais.php');
  ?>
  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>
  <script src="plugins/jquery/jquery.min.js?versao=3.263.26.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.263.26.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.263.26.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.263.26.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.263.26.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.263.26.1"></script>
  <script src="dist/js/sisplan.js?versao=3.263.26.1"></script>
  <script src="utils/funcoes.js?versao=3.263.26.1"></script>
  <script src="utils/cookies.js?versao=3.263.26.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.263.26.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.263.26.1"></script>
  <script src="dist/js/driver.min.js?versao=3.263.26.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.263.26.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.263.26.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.263.26.1"></script>
  <script type="text/javascript" src="config.js?versao=3.263.26.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('LOCALIZACAO_ESTOQUE');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

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

    });
  </script>
</body>

</html>