<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | Usuário</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">

  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css">
  <link rel="stylesheet" href="../dist/css/custom.css">
  <link rel="stylesheet" href="../dist/css/sisplan.css">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">


</head>
<style>
  #msform {
    text-align: start;
    position: relative;
  }

  .card {
    box-shadow: none !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
  }

  .card-header {
    box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
  }


  .fa-angle-right,
  .fa-angle-down {
    color: #343a40;
  }

  .card-body {
    margin-left: 0px !important;
    padding-left: 1.25rem !important;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-right: 1.25rem !important;
  }

  .header-content-page .title-page,
  .title-content-page .title,
  .title-page {
    font-size: 20px;
    line-height: normal;
    font-weight: 500;
    color: #343a40;
    margin: 0;
    font-family: Roboto, Arial, sans-serif;
  }

  #DadosGerais>.card,
  #obs>.card {
    background: #f7f7f7;
  }
</style>


<body class="hold-transition sidebar-mini layout-fixed">

  <script type="text/javascript" src="../config.js"></script>
  <main 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">
              <h3 class="col-mb=2"></h3>
            </div>
            <div class="col-sm-6">
              <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="./index">Início</a></li>
                <li class="breadcrumb-item"><a href="../usuario">Usuário</a></li>
                <li class="breadcrumb-item active">Cadastro de Usuários</li>
              </ol>
            </div>
          </div>
          <div class="row">
            <div class="col-12">
              <div class="card" style="height:auto;">
                <div class="card-header bg-dark">
                  <div class="row flex">
                    <h4 class="text-white">Cadastro de Usuários </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>
                  <div class="card-body" style="padding-left: 0rem!important; padding-right: 0rem!important;">
                    <form id="msform" name="msform">
                      <div class="card card-header" role="tab" id="geral">
                        <a style="width:100%;" data-toggle="collapse" data-parent="#DadosGerais" href="#DadosGerais" aria-expanded="true" aria-controls="collapseOne1">
                          <div class="row">
                            <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                              <i class="fas fa-angle-down"></i>
                            </div>
                            <div class="col-11">
                              <h4 class="title-page">
                                Dados Gerais
                              </h4>
                            </div>
                          </div>
                        </a>
                      </div>
                      <div class="collapse show" id="DadosGerais">
                        <div class="card card-body" style="padding-top: 10px;">
                          <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="dados-tab">
                            <div class="row">
                              <div class="col-md-8 col-12">

                                <div class="form-row">
                                  <div class="form-group col-md-6 col-12" id="nomeInfoTour">
                                    <label for="txtNome">Nome *</label>
                                    <div class="relative">
                                      <input type="text" autocomplete="off" value="" class="input-default focus form-control validate" required="required" pattern="[0-9]+$" id="txtNome" name="txtNome">
                                    </div>
                                  </div>
                                </div>

                                <div class="form-row">
                                  <div class="form-group col-md-6 col-12">
                                    <label for="txtDescontoMax">Desconto Máximo Usuário</label>
                                    <div class="relative">
                                      <input type="text" class="input-default focus form-control validate" required="required" id="txtDescontoMax" name="txtDescontoMax">
                                    </div>
                                  </div>

                                  <div class="form-group col-md-6 col-12">
                                    <label for="txtTipo">Tipo Usuário</label>
                                    <div class="relative">
                                      <select id="txtTipo" class="input-default focus form-control validate" required="required" name="txtTipo">
                                        <option value="0" selected>Usuário</option>
                                        <option value="1">Supervisor</option>
                                        <option value="2">Master</option>
                                      </select>
                                    </div>
                                  </div>
                                </div>

                                <div class="form-row">
                                  <div class="col-md-12 col-12 form-group" id="IDDashWEBInfoTour">
                                    <label data-error="wrong" data-success="right" for="txtIDDashWEB">ID Dash WEB *</label>
                                    <div class="input-group">
                                      <input type="text" autocomplete="off" class="input-default focus form-control validate" required="required" id="txtIDDashWEB" name="txtIDDashWEB" class="form-control" placeholder="IDDashWEB" name="txtIDDashWEB">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btn-IDDashWEB" name="btn-IDDashWEB" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btn-limpa-IDDashWEB" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                </div>

                              </div>
                              <div class="col-md-4 col-12">
                                <img src="../usuario.jpeg" width="250">
                              </div>
                            </div>
                          </div>
                        </div>
                        <button type="button" id="btnVoltar" style="font-size:15px;" class="btn btn-success btn-sisp action-button-previous" data-dismiss="modal">Voltar</button>
                        <input id="btnGravar" type="submit" style="font-size:15px;" class="btn btn-danger btn-sisp action-button" value="Gravar">
                      </div>
                    </form>
                  </div>
                </fieldset>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
      <!-- Control sidebar content goes here -->
    </aside><!-- /.control-sidebar -->
    <?php
    include_once('../../../footer.php');
    ?>
    <?php include_once('../../../menu_fiscal.php'); ?>
  </main>

  <script src="../plugins/jquery/jquery.min.js"></script>
  <script src="../dist/js/jquery.maskMoney.min.js"></script>
  <script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js"></script>
  <script src="../plugins/sweetalert2/sweetalert2.min.js"></script>
  <script src="../plugins/toastr/toastr.min.js"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="../dist/js/adminlte.min.js"></script>
  <script src="../dist/js/requisicoes.js"></script>
  <script src="../dist/js/loadingoverlay.min.js"></script>
  <script src="../dist/js/valida_cpf_cnpj.js"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js"></script>
  <script src="../dist/js/dataTables.keyTable.js"></script>
  <script src="../dist/js/sisplan.js"></script>
  <script src="../utils/funcoes.js"></script>
  <script src="../utils/cookies.js"></script>
  <script src="../dist/js/driver.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;
      sArquivo = `${BASE_URI}/pages/usuario/cadastro_usuario/usuario.js`;
      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');

      const temAcesso = await temAcessoTela('PAGAR');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      await insereJavaScriptPagina(sArquivo);

      habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>
</body>

</html>