<?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 | Controle de Embarque</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.255.7.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.255.7.1">
  <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.255.7.1" />
  <link href='dist/css/bootstrap.min.css?versao=3.255.7.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.255.7.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.255.7.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.255.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.255.7.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.255.7.1">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.255.7.1">
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <style>
    .card-totais {
      margin-top: 2%;
    }

    #rodape {
      margin-left: 0;
      padding-top: 0;
    }

    #txtDados {
      padding-top: .7%;
      padding-left: .85%;
    }

    .input-group-append>a>i {
      margin-left: 0 !important;
      padding-left: 5px;
      padding-right: 5px;
    }

    .grupo_botao>button>i {
      margin-left: 0 !important;
      padding-left: 5px;
      padding-right: 5px;
    }

    .bg-light {
      background-color: #f8f9fa08 !important;
    }

    .focus:read-only:focus {
      border-color: #aa1212 !important;
    }

    .labelCheck {
      font-size: 110%;
      padding: 0.2%;
      margin-left: 1%;
    }

    .configCheck {
      -ms-transform: scale(1.5);
      -moz-transform: scale(1.5);
      -webkit-transform: scale(1.5);
      -o-transform: scale(1.5);
      transform: scale(1.5);
      padding: 10px;
    }

    .checkboxMoeda {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: .8%;
    }

    .bordaTab {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      margin-top: 9.6%;
    }

    .bordaRadio {
      border: 2px solid #e0e4e6;
      border-radius: 4px;
      height: 38px;
      padding-right: 50%;
    }


    #checkPrecoManual {
      margin-left: 10px;
    }

    #tourGeral {
      padding-bottom: 0 !important;
      margin-bottom: 0;
    }

    #tabelaEmbarque_length {
      display: none;
    }

    #tabelaEmbarque_filter {
      display: none;
    }

    #tabelaEmbarque_info {
      display: none;
    }

    #divTabelaConferencia .dataTables_scrollHeadInner table {
      width: 100% !important;
    }

    #divTabelaConferencia .dataTables_scrollHeadInner {
      width: 100% !important;
    }

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

</head>

<body class="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">
              <h3 class="col-mb=2"></h3>
            </div>
            <div class="col-sm-6">
              <!-- <ol class="breadcrumb float-sm-right">
                
                <li class="breadcrumb-item"><a href="../embarque">Acesso Embarque</a></li>
                <li class="breadcrumb-item active">Controle de Embarque</li>
              </ol> -->
            </div>
          </div>
          <div class="row">
            <div class="col-12">
              <div class="card-header bg-dark">
                <div class="row flex">
                  <h4 class="text-white">Controle de Embarque</h4>
                  <button title="Tutorial" class="btn btn-info btn-sm ml-2" id="tutorial">
                    <i class="fas fa-question-circle"></i>
                  </button>
                </div>
              </div>
              <fieldset style="margin-top:-20px;">
                <div class="card-body" style="padding-left: 0rem!important; padding-right: 0rem!important; padding-bottom: 0">
                  <form id="msform" class="mt-0">
                    <div class="form-card" id="tourGeral">
                      <div class="card">
                        <div class="card-body pt-2">
                          <div class="row justify-contend-between">
                            <div class="col-lg-4 col-12 form-group">
                              <label data-error="wrong" data-success="right" for="txtNumero">Número *</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtNumero" name="txtNumero" placeholder="Número">
                              </div>
                            </div>

                            <div class="col-lg-2 col-12 radioGroup">
                              <label data-error="wrong" data-success="right">Situação</label>
                              <div class="form-check">
                                <input class="form-check-input" value="0" type="radio" name="radio" id="radioPendentes" checked>
                                <label class="form-check-label" for="radio">
                                  Pendente
                                </label>
                              </div>
                              <div class="form-check">
                                <input class="form-check-input" value="1" type="radio" name="radio" id="radioFechado">
                                <label class="form-check-label" for="radio">
                                  Fechado
                                </label>
                              </div>
                            </div>

                            <div class="col-lg-2 col-12 form-group ml-auto p-2">
                              <label data-error="wrong" data-success="right" for="dtCadastro">Data cadastro:</label>
                              <div class="input-group">
                                <input type="date" readonly disabled class="input-default focus form-control" id="dtCadastro" name="dtCadastro">
                              </div>
                            </div>

                            <div class="col-lg-5 mb-1 col-12 form-group" style="margin-top:-7px;">
                              <label data-error="wrong" data-success="right" for="txtNota">Nota</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtNota" name="txtNota" class="form-control" placeholder="Nota">
                                <div class="input-group-append">
                                  <button class="btn bg-danger" id="btn-Nota" name="btn-Nota" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                  <button class="btn bg-danger" id="btn-limpa-Nota" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                              </div>
                            </div>
                            <div class="container-fluid mt-2" id="divTabelaEmbarque">
                              <div class="row">
                                <div class="col-sm-12 table-responsive table-sm  campo table-select -0 pb-1 pt-0">
                                  <table id="tabelaEmbarque" class="table table-hover" width="100%">
                                    <thead>
                                      <tr>
                                        <th class="th-xl">FATURA</th>
                                        <th class="th-xl">SERIE</th>
                                        <th class="th-xl">CODCLI</th>
                                        <td class="th-xl">NOME</td>
                                        <th class="th-xl">CODTRANSP</th>
                                        <th class="th-xl">NOME_TRANSP</th>
                                        <th class="th-xl">CONFERIDO</th>
                                        <th class="th-xl">QTDE_CAIXAS</th>
                                        <th class="th-xl">PESO_BRUTO</th>
                                        <th class="th-xl">VALOR</th>
                                        <th class="th-xl">VOLUMES</th>
                                        <th class="th-xl">ENDERECO</th>
                                        <th class="th-xl">ESTADO</th>
                                        <th class="th-xl">CIDADE</th>
                                        <th class="th-xl">BAIRRO</th>
                                        <th class="th-xl">INSCRICAO</th>
                                        <th class="th-xl">UF</th>
                                        <th class="th-xl">CNPJ</th>
                                        <th class="th-xl">TELEFONE</th>
                                        <th class="th-xl">Ações</th>
                                      </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                  </table>
                                </div>
                              </div>
                            </div>
                            <div class="container-fluid mt-2">
                              <div id="divTabelaConferencia" class="row card mb-1 d-none">
                                <div class="col-sm-12 mt-1 justify-content-between">
                                  <div class="col-lg-3 col-3 form-group mb-0">
                                    <label data-error="wrong" data-success="right" class="ml-1" style="margin-top:-1rem;" for="txtNumCaixa">Conferência</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control ml-1" id="txtNumCaixa" name="txtNumCaixa" class="form-control" placeholder="Num. Caixa">
                                    </div>
                                  </div>
                                  <div class="col-sm-12 pt-0 pb-0 table-responsive" id="divTabelaConferencia">
                                    <table id="tabelaConferencia" class="table table-sm table-select table-hover" width="100%">
                                      <thead>
                                        <tr>
                                          <td class="th-xl">NOTAFISCAL</td>
                                          <td class="th-xl">CAIXA</td>
                                          <td class="th-xl">QTDE</td>
                                          <td class="th-xl">CONFERIDO</td>
                                        </tr>
                                      </thead>
                                      <tbody>
                                      </tbody>
                                    </table>
                                  </div>
                                </div>
                              </div>
                              <div class="col-sm-12 d-flex justify-content-between mb-3">
                                <div class="ml-2">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtTotalNotas">Notas</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtTotalNotas" name="txtTotalNotas">
                                </div>
                                <div class="ml-2">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtTotalVolumes">Volumes</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtTotalVolumes" name="txtTotalVolumes">
                                </div>
                                <div class="ml-2">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtPesoBruto">Peso Bruto</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtPesoBruto" name="txtPesoBruto">
                                </div>
                                <div class="ml-2">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorTotal">Valor</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtValorTotal" name="txtValorTotal">
                                </div>
                                <div class="ml-2 d-none" id="divCaixas">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtCaixa">Caixas</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtCaixa" name="txtCaixa">
                                </div>
                                <div class="ml-2 d-none" id="divCxConf">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtCxConf">Cx. Conf.</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtCxConf" name="txtCxConf">
                                </div>
                                <div class="ml-2 d-none" id="divSaldo">
                                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtSaldo">Saldo</label>
                                  <input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtSaldo" name="txtSaldo">
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="col-12">
                          <input type=" button" id="btnGravaEmbarque" name="next" class="next action-button mt-0" value="Gravar" style="text-align:center;" />
                          <input type="button" id="voltarAcesso" class="action-button-previous mt-0" value="Voltar" />
                        </div>
                      </div>
                    </div>
                  </form>
                </div>

              </fieldset>
            </div>
            </section>
          </div>
        </div>


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

        <aside class="control-sidebar control-sidebar-dark">
        </aside>
      </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.7.1"></script>
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.255.7.1"></script>
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.255.7.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.255.7.1"></script>

  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>

  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.255.7.1"></script>

  <script src="../dist/js/adminlte.min.js?versao=3.255.7.1"></script>

  <script src="../dist/js/requisicoes.js?versao=3.255.7.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.255.7.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.255.7.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.255.7.1"></script>
  <script src="../plugins/moment/moment.min.js?versao=3.255.7.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.255.7.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.255.7.1"></script>
  <script src="../dist/js/popper.min.js?versao=3.255.7.1"></script>
  <script src="../dist/js/tippy-bundle.umd.js?versao=3.255.7.1"></script>
  <script src="../utils/funcoes.js?versao=3.255.7.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.255.7.1"></script>
  <script src="../utils/cookies.js?versao=3.255.7.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.255.7.1"></script>
  <script src="../dist/js/dataTables.keyTable2.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.255.7.1"></script>
  <script type="text/javascript" src="../dist/js/sum().js?versao=3.255.7.1"></script>
  <script type="text/javascript">
    $(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('EMBARQUE');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

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

    });
  </script>
</body>

</html>