<?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 | Zera Estoque Material</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.265.7.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.265.7.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.265.7.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.265.7.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.265.7.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.265.7.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.265.7.1">
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.265.7.1">
  <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="https://cdn.datatables.net/select/1.6.0/css/select.dataTables.min.css">
  <style>
    .table.dataTable tbody td,
    .table.dataTable thead {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <?php
    include_once('../../menu.php');
    ?>
    <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">Zera Estoque Material</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">

            </div>
          </div>
        </div>
        <div class="card col-12 mt-5 container-fluid">
          <div class="row card-body d-flex justify-content-start" id="abaGeral">
            <div class="infFiltros row card-body d-flex justify-content-start">
              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtMovimento">Movimento</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" disabled id="txtMovimento" name="txtMovimento" placeholder="Movimento" disabled>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtTipoMov">Tipo Baixa*</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control validate" id="txtTipoMov" name="txtTipoMov" placeholder="Tipo Baixa">
                  <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="btnLimpaTipoMov" name="btnLimpaTipoMov" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtDeposito">Depósito</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtDeposito" name="txtDeposito" multiple="multiple" required>
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnDeposito" name="btnDeposito" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaDeposito" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtGrupo">Grupo</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtGrupo" name="txtGrupo" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnGrupo" name="btnGrupo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaGrupo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtSubgrupo">Subgrupo</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtSubgrupo" name="txtSubgrupo" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnSubgrupo" name="btnSubgrupo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaSubgrupo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtColecao">Coleção</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtColecao" name="txtColecao" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnColecao" name="btnColecao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaColecao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLinha">Linha</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtLinha" name="txtLinha" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnLinha" name="btnLinha" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaLinha" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtMaterial">Material</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtMaterial" name="txtMaterial" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnMaterial" name="btnMaterial" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaMaterial" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtCor">Cor</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtCor" name="txtCor" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnCor" name="btnCor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaCor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtQualidade">Qualidade</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtQualidade" name="txtQualidade" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnQualidade" name="btnQualidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaQualidade" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLote">Lote</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtLote" name="txtLote" placeholder="Lote">
                </div>
              </div>

              <div class="col-md-3 form-group flex justify-content-between align-items-end">
                <div class="icheck-primary flex align-items-end">
                  <input type="checkbox" class="form-check-input" id="cbEstoqueNegativo">
                  <label class="form-check-label" for="cbEstoqueNegativo">Estoque Negativo</label>
                </div>
                <button style="max-height: 38px" class=" btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
              </div>
            </div>
            <div class="icheck-primary col-12" style="margin-left: 27px;">
              <input class="form-check-input" type="checkbox" id="cbSelAll">
              <label class="form-check-label" for="cbSelAll">Selecionar Todos</label>
            </div>
            <div class="col-sm-12 table-responsive card-body">
              <table id="tabelaItens" class="table table-responsive-sm table-select table-hover" width="100%">
                <thead>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
          <div class="col-sm-12 justify-content-end d-flex card-body pt-0">
            <div class="col-lg-1 form-group">
              <label data-error="wrong" data-success="right" for="txtQuantidade">Quantidade</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control text-right" id="txtQuantidade" name="txtQuantidade" placeholder="Quantidade" disabled>
              </div>
            </div>
            <div class="col-auto form-group" style="padding-top: 28px">
              <button id="btnGravar" disabled class="btn btn-danger btn-sisp">Gravar</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.265.7.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.265.7.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.265.7.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.265.7.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.265.7.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.265.7.1"></script>
  <script src="dist/js/sisplan.js?versao=3.265.7.1"></script>
  <script src="utils/funcoes.js?versao=3.265.7.1"></script>
  <script src="utils/cookies.js?versao=3.265.7.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.265.7.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.265.7.1"></script>
  <script src="dist/js/driver.min.js?versao=3.265.7.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.265.7.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.265.7.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.265.7.1"></script>
  <script type="text/javascript" src="config.js?versao=3.265.7.1"></script>
  <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.265.7.1"></script>
  <script src="https://cdn.datatables.net/select/1.6.0/js/dataTables.select.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('ZERA_ESTOQUE_MATERIAL')
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI)
        return
      }

      sArquivo = `${BASE_URI}/pages/zera_estoque_material/zera_estoque_material.js?versao=3.265.7.1`
      insereJavaScriptPagina(sArquivo)

    })
  </script>
</body>

</html>