<?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 Ocorrência</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.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.2512.9.1" />
  <link href='../dist/css/bootstrap.min.css?versao=3.2512.9.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.2512.9.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.2512.9.1">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.2512.9.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.2512.9.1">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <style>
    #progressbar li {
      list-style-type: none;
      font-size: 12px;
      width: 50%;
      float: left;
      position: relative
    }

    .border-Field .textoBorda {
      font-size: 1.1em !important;
      text-align: left !important;
      width: auto;
      padding: 0 10px;
      border-bottom: none;
    }

    .border-Field {
      border: 1px solid var(--font-color) !important;
      padding: 0 1.0em 0 1.0em !important;
      margin: 0 0 0 0 !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
    }
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <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">
      <section class="content">
        <div class="content-header">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6 flex">
              </div>
              <div class="col-sm-6">
                <!-- <ol class="breadcrumb float-sm-right">
                  
                  <li class="breadcrumb-item"><a href="../ocorrencia">Acesso Ocorrência</a></li>
                  <li class="breadcrumb-item active">Cadastro de Ocorrência</li>
                </ol> -->
              </div><!-- /.col -->
            </div><!-- /.row -->
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-10 text-center p-0 mt-3 mb-2">
              <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                  <h2>Cadastro de Ocorrência
                    <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>
                  </h2>
                </div>
                <div class="row">
                  <div class="col-md-12 mx-0">
                    <form id="msform">
                      <!-- progressbar -->
                      <ul id="progressbar">
                        <li class="active" id="account" style="font-size: 100%;"><strong>Geral</strong></li>
                        <li id="payment" style="font-size: 100%;"><strong>Configuração</strong></li>
                      </ul> <!-- fieldsets -->
                      <p>Preencha os dados e clique em avançar para realizar o cadastro da ocorrência</p>
                      <fieldset id="fieldset1">
                        <div class="form-card" id="formcard1">
                          <h2 class="fs-title">Dados Gerais</h2>
                          <div class="row">
                            <div class="form-group col-lg-4 col-md-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtId">Id</label>
                              <input type="number" readonly class="input-default focus form-control" id="txtId" name="txtId" class="form-control" placeholder="Id">
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtCodigo">Código</label>
                              <input type="text" class="input-default focus form-control" id="txtCodigo" name="txtCodigo" class="form-control" placeholder="Código" maxlength="3">
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label data-error="wrong" class="labelGeral" data-success="right" for="txtDescricao">Descrição</label>
                              <input type="text" class="input-default focus form-control" id="txtDescricao" name="txtDescricao" class="form-control" placeholder="Descrição">
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtBanco">Banco:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtBanco" name="txtBanco" placeholder="Banco">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnBanco" name="btnBanco" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaBanco" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtSituacao">Situação:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtSituacao" name="txtSituacao" placeholder="Situação">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnSituacao" name="btnSituacao" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaSituacao" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtCarteira">Carteira:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtCarteira" name="txtCarteira" placeholder="Carteira">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnCarteira" name="btnCarteira" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaCarteira" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtHistorico">Histórico:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtHistorico" name="txtHistorico" placeholder="Histórico">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnHistorico" name="btnHistorico" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaHistorico" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtClasse">Classe:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtClasse" name="txtClasse" placeholder="Classe">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnClasse" name="btnClasse" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaClasse" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <!-- <div class="form-group col-lg-4 col-md-12">
                              <label for="txtConta">Conta:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtConta" name="txtConta" placeholder="Conta">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnConta" name="btnConta" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaConta" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div> -->
                            <div class="form-group col-lg-4 col-md-12">
                              <label for="txtInstrucao">Instrução:</label>
                              <select class="drilldown-item form-control select2 select2-danger focus" style="border-color: #a9a9a9" data-dropdown-css-class="select2-danger" name="txtInstrucao" id="txtInstrucao">
                                <option class="drilldown-item" selected disabled value="">Selecione uma opção</option>
                                <option value="01">01 - Registro de titulos.</option>
                                <option value="02">02 - Solicitacao de Baixa.</option>
                                <option value="03">03 - Pedido de debito em conta.</option>
                                <option value="04">04 - Concessao de abatimento.</option>
                                <option value="05">05 - Cancel. de abatimento.</option>
                                <option value="06">06 - Alteracao de vcto. de titulo.</option>
                                <option value="07">07 - Alteracao do numero de controle do participante.</option>
                                <option value="08">08 - Alteracao do numero do titulo dado Pelo cedente.</option>
                                <option value="09">09 - Instrucao para protestar.</option>
                                <option value="10">10 - Instrucao para sustar protesto.</option>
                                <option value="11">11 - Instrucao para dispensar juros.</option>
                                <option value="12">12 - Alteracao de nome e endereco do sacado.</option>
                                <option value="13">13 - Alteração de juros mora.</option>
                                <option value="14">14 - Conceder desconto.</option>
                                <option value="15">15 - Nao conceder desconto.</option>
                                <option value="16">16 - Retificar desconto.</option>
                                <option value="17">17 - Alterar data para desconto.</option>
                                <option value="18">18 - Cobrar Multa.</option>
                                <option value="19">19 - Dispensar Multa.</option>
                                <option value="20">20 - Dispensar Indexador.</option>
                                <option value="21">21 - Dispensar Prazo Limite de Recebimento.</option>
                                <option value="22">22 - Alterar Prazo Limite de Recebimento.</option>
                                <option value="23">23 - Alterar Modalidade de Cobrança.</option>
                              </select>
                            </div>
                          </div>
                        </div>
                        <input type="button" name="avancar1" id="avancar1" class="btn-sisp next action-button" value="Avançar" />
                        <button type="button" name="voltar1" id="voltar1" style="font-size:15px;" class="btn-sisp action-button-previous" data-dismiss="modal">Voltar</button>
                      </fieldset>
                      <fieldset id="fieldset2">
                        <div class="form-card">
                          <h2 class="fs-title">Tipo do depósito</h2>
                          <div class="row">
                            <div class="form-group col-lg-4 col-md-12 col-sm-12">
                              <div class="col-lg-12 col-md-12 col-sm-12">
                                <fieldset class="form border-Field p-0">
                                  <legend class="textoBorda pb-0 mb-0">Tipo</legend>
                                  <div class="form-row d-flex justify-content-around">
                                    <label class="labelCheck"><input type="radio" checked id="rgEntrada" name="radioTipo" value="E"><span class="checkmark"></span> Entrada</label>
                                    <label class="labelCheck"><input type="radio" id="rgSaida" name="radioTipo" value="S"><span class="checkmark"></span> Saída</label>
                                  </div>
                                </fieldset>
                              </div>
                              <div class="col-lg-12 col-md-12 col-sm-12 mt-3">
                                <fieldset class="form border-Field p-0">
                                  <legend class="textoBorda pb-0 mb-0">Operação</legend>
                                  <div class="form-row d-flex justify-content-around">
                                    <label class="labelCheck"><input type="radio" checked id="rgCobranca" name="radioOperacao" value="C"><span class="checkmark"></span> Cobrança</label>
                                    <label class="labelCheck"><input type="radio" id="rgPagamento" name="radioOperacao" value="P"><span class="checkmark"></span> Pagamento</label>
                                  </div>
                                </fieldset>
                              </div>
                              <div class="col-lg-12 col-md-12 col-sm-12 mt-3">
                                <label for="cbAlterarBanco"><input type="checkbox" id="cbAlterarBanco">  Alterar Banco</label> <br>
                                <div class="input-group d-none" id="divAlterarBanco">
                                  <input type="text" class="input-default focus form-control validate" id="txtAlterarBanco" name="txtAlterarBanco" placeholder="Banco">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnAlterarBanco" name="btnAlterarBanco" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaAlterarBanco" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-8 col-md-12 col-sm-12">
                              <div class="col-12" id="tutOpcoes">
                                <fieldset class="form border-Field mb-0 pb-0">
                                  <legend class="textoBorda mb-0 pb-0">Opções</legend>
                                  <div id="tipoDep" class="row">
                                    <div class="col-sm-6 table-wrap my-2 pl-2">
                                      <div>
                                        <label for="cbBaixaDuplicata"><input type="checkbox" id="cbBaixaDuplicata"> Baixa Duplicata</label> <br>
                                        <label for="cbLancaFluxoCaixa"><input type="checkbox" id="cbLancaFluxoCaixa">  Lança Fluxo de Caixa</label> <br>
                                        <label for="cbCaptacaoFundos"><input type="checkbox" id="cbCaptacaoFundos">  Captação Fundos</label> <br>
                                        <label for="cbDespesasCartorio"><input type="checkbox" id="cbDespesasCartorio">  Despesas Cartório</label> <br>
                                        <label for="cbTituloRejeitado"><input type="checkbox" id="cbTituloRejeitado">  Título Rejeitado</label> <br>
                                        <label for="cbManterNrBanco"><input type="checkbox" id="cbManterNrBanco">  Manter Nr. Banco</label> <br>
                                        <label for="cbDespesasCobranca"><input type="checkbox" id="cbDespesasCobranca">  Despesas Cobrança (Tarifa)</label> <br>
                                        <label for="cbEstornoBanco"><input type="checkbox" id="cbEstornoBanco">  Estorno do Banco</label> <br>
                                      </div>
                                    </div>
                                    <div class="col-sm-6 table-wrap my-2">
                                      <div>
                                        <label for="cbManutencaoTitulo"><input type="checkbox" id="cbManutencaoTitulo">  Manutenção de Título (Tarifa)</label> <br>
                                        <label for="cbAlteracaoVencimento"><input type="checkbox" id="cbAlteracaoVencimento">  Alteração de Vencimento</label> <br>
                                        <label for="cbGravarHistorico"><input type="checkbox" id="cbGravarHistorico">  Gravar Histórico</label> <br>
                                        <label for="cbOcultarOcorrencia"><input type="checkbox" id="cbOcultarOcorrencia">  Ocultar Ocorrência Retorno Escritural</label> <br>
                                        <label for="cbJogarJuros"><input type="checkbox" id="cbJogarJuros">  Valor Pago Excedido - Jogar em Juros</label> <br>
                                        <label for="cbSaldoRestante"><input type="checkbox" id="cbSaldoRestante">  Valor Pago Excedido - Baixar Saldo Restante</label> <br>
                                        <label for="cbLimpaContaCorrente"><input type="checkbox" id="cbLimpaContaCorrente">  Limpa Conta Corrente</label> <br>
                                      </div>
                                    </div>
                                  </div>
                                </fieldset>
                              </div>
                            </div>
                          </div>
                        </div>
                        <input type="button" name="gravar" class="action-button" value="Gravar" id="btnGravar">
                        <input type="button" name="voltar2" class="previous action-button-previous" value="Voltar" id="voltar2" />
                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>

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

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
  </div>

  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.2512.9.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.2512.9.1"></script>

  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>

  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/requisicoes.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.2512.9.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.2512.9.1"></script>
  <script src="../utils/funcoes.js?versao=3.2512.9.1"></script>
  <script src="../utils/cookies.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.mask.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/dataTables.keyTable2.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.2512.9.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('ESCOCORRENCIA');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      const permissaoUsuarioLogado = await permissaoAcessos("ESCOCORRENCIA");

      if (permissaoUsuarioLogado.INCLUI == 'N') {
        await criaMensagemErro("Sem permissão para incluir!", () => {
          window.location.href = `${BASE_URI}/escocorrencia`
        });
        return;
      }

      const queryString = window.location.href;
      const parametros = queryString.split("/");
      const deposito = parametros[parametros.length - 1];

      $(window).on("beforeunload", function(e) {
        // e.preventDefault();
        e.stopPropagation();
        return undefined;
      });

      sArquivo = `${BASE_URI}/pages/escocorrencia/cadastro_escocorrencia/escocorrencia.js?versao=3.2512.9.1`;
      insereJavaScriptPagina(sArquivo);

      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
      habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>
</body>

</html>