<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | Relatório de Aniversariante</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2310.10.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2310.10.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="dist/css/custom.css?versao=3.2310.10.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2310.10.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2310.10.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2310.10.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2310.10.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2310.10.1">

  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.2310.10.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2310.10.1">
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.227.29.2">
  <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.2310.10.1">
  <style>
    .table.dataTable thead th {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

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

</head>


<body class="hold-transition sidebar-mini layout-fixed">
  <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 flex">
              <h1 class="m-0 text-dark">Relatório de Aniversariante</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"><a href="./index">Início</a></li>
                <li class="breadcrumb-item active">Relatório de Aniversariante</li>
              </ol>
            </div>
          </div>
          <div class="row">
            <div class="col-12">
              <fieldset>
                <div class="row">
                  <div class="col-12">
                    <div class="buttons">
                      <button class="btn btn-success btn-sisp" id="btnFiltros" type="button"><span class="fas fa-filter"></span> Filtros</button>
                      <button id="btnImprimir" class="btn-sisp btn btn-danger"><i class="fas fa-print"></i> Imprimir</button>
                      <button id="btnWpp" class="btn-sisp btn btn-danger" style="background-color: #25D366; border-color: #25D366; position: relative; right: 2px;"><i class="fab fa-whatsapp"></i> WhatsApp</button>
                    </div>
                  </div>
                </div>
                <div class="card-body">
                  <div class="card">
                    <div class="col-sm-12 table-responsive card-body">
                      <table id="tabelaAniversario" class="table table-sm table-select table-hover" width="100%"></table>
                      <thead>
                        <tr></tr>
                      </thead>
                      <tbody>
                        <tr></tr>
                      </tbody>
                    </div>
                  </div>
                </div>
              </fieldset>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content" id="modalBody">
          <div class="modal-header">
            <h4 class="modal-title">Filtros</h4>
            <!-- <div class="mt-2">
              <label style="font-size: 120%" class="container escondeRadio">
                <input type="checkbox" checked id="cbEmpresa" name="tipoConsulta">
                <span class="checkmark"></span>
                Buscar somente da empresa logada</label>
            </div> -->
            <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="col-lg-12 col-12">
              <div class="form-group col-md-6 col-sm-12 col-lg-3 mb-1">
                <label data-error="wrong" data-success="right">Dia De/ Até: </label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtMesDe" name="txtMesDe" class="form-control">
                  <input type="text" class="input-default focus form-control" id="txtMesAte" name="txtMesAte" class="form-control">
                </div>
              </div>
              <div class="form-group col-md-3 col-sm-12 col-lg-3 mb-1 d-none">
                <label data-error="wrong" data-success="right" for="txtMes">Mês: </label>
                <div class="input-group">
                  <select name="txtMes" id="txtMes" class="input-default focus form-control">
                    <option value="">Selecione o mês</option>
                    <option value="1"> Janeiro </option>
                    <option value="2"> Fevereiro </option>
                    <option value="3"> Março </option>
                    <option value="4"> Abril </option>
                    <option value="5"> Maio </option>
                    <option value="6"> Junho </option>
                    <option value="7"> Julho </option>
                    <option value="8"> Agosto </option>
                    <option value="9"> Setembro </option>
                    <option value="10"> Outubro </option>
                    <option value="11"> Novembro </option>
                    <option value="12"> Dezembro </option>
                  </select>
                </div>
              </div>
              <div class="form-group col-md-12 col-sm-12 col-lg-9 mb-1">
                <label data-error="wrong" data-success="right" for="txtCliente">Cliente: </label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtCliente" name="txtCliente" class="form-control" placeholder="Cliente">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnCliente" name="btnCliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnLimpaCliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>
              <div class="form-group col-md-6 col-sm-6 col-lg-6 mb-1">
                <label data-error="wrong" data-success="right" for="dtCadastroDe">Cadastro De/ Até:</label>
                <div class="input-group">
                  <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtCadastroDe" name="dtCadastroDe" value='1200-01-01'>
                  <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtCadastroAte" name="dtCadastroAte" value='2500-12-31'>
                </div>
              </div>
              <div class="form-group col-md-6 col-sm-6 col-lg-6 mb-1">
                <label data-error="wrong" data-success="right" for="dtNascimentoDe">Nascimento De/ Até:</label>
                <div class="input-group">
                  <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtNascimentoDe" name="dtNascimentoDe" value='1200-01-01'>
                  <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtNascimentoAte" name="dtNascimentoAte" value='2500-12-31'>
                </div>
              </div>
              <div class="form-group col-md-6 col-sm-12 col-lg-6">
                <label data-error="wrong" data-success="right" for="txtUF">UF: </label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtUF" name="txtUF" class="form-control" placeholder="UF">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnUF" name="btnUF" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnLimpaUF" name="btnLimpaUF" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>
              <div class="col-md-6 col-sm-6 col-lg-3 p-1 mt-4 ml-2">
                <button class="btn btn-danger btn-sisp" type='button' id="btnSelecionarEmpresas">Selecionar Empresas</button>
              </div>
            </div>
          </div>
          <div class="modal-footer justify-content-start">
            <div class="row col-lg-12 col-12">
              <div class="col-md-6 col-sm-12 col-lg-6">
                <label data-error="wrong" data-success="right" for="txtOrdenacao">Ordenação: </label>
                <div class="input-group">
                  <select id="txtOrdenacao" class="input-default focus form-control">
                    <option value="">Selecione uma opção</option>
                    <option value="0">Código</option>
                    <option value="1">Descrição</option>
                    <option value="2">Data Nascimento</option>
                    <option value="3">Data Cadastro</option>
                  </select>
                </div>
              </div>
              <div class="col-md-6 col-sm-6 col-lg-6 d-flex justify-content-end align-items-end">
                <div class="d-flex">
                  <button class="btn btn-primary btn-sisp mr-2" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222">
                    <span class="fas fa-trash"></span> Limpar Filtros
                  </button>
                  <button id="btnConsultar" class="btn btn-primary btn-sisp" type="button">
                    <span class="fas fa-search"></span> Consultar
                  </button>
                </div>
              </div>
            </div>
          </div>
          <!-- <div class="form-group col-md-6 col-sm-6 col-lg-4">
            <label data-error="wrong" data-success="right" for="txtOrdenacao">Ordenação: </label>
            <div class="input-group">
              <select id="txtOrdenacao" class="input-default focus form-control">
                <option value="">Selecione uma opção</option>
                <option value="0">Código</option>
                <option value="1">Descrição</option>
                <option value="2">Data Nascimento</option>
                <option value="3">Data Cadastro</option>
              </select>
            </div>
          </div>
          <div class="modal-footer">
            <div class="row">
              <button class="btn btn-primary btn-sisp" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222"><span class="fas fa-trash"></span> Limpar Filtros</button>   
              <button id="btnConsultar" class='btn btn-primary btn-sisp' type='button'><span class="fas fa-search"></span> Consultar </button>
            </div>
          </div> -->
        </div>
      </div>
    </div>

    <aside class="control-sidebar control-sidebar-dark">

    </aside>
    <?php include_once('../../footer.php'); ?>
  </main>

  <script src="plugins/jquery/jquery.min.js?versao=promisse"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2310.10.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2310.10.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2310.10.1"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/5.0.6/jquery.inputmask.min.js"></script>
  <script src="dist/js/jquery.maskMoney.min.js?versao=3.2310.10.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.2310.10.1"></script>
  <script src="dist/js/sisplan.js?versao=3.2310.10.1"></script>
  <script src="utils/funcoes.js?versao=3.2310.10.1"></script>
  <script src="utils/cookies.js?versao=3.2310.10.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.2310.10.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.2310.10.1"></script>
  <script src="dist/js/driver.min.js?versao=3.2310.10.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.2310.10.1"></script>
  <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="config.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="plugins/jszip/jszip.min.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="plugins/pdfmake/pdfmake.min.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="plugins/pdfmake/vfs_fonts.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="plugins/datatables-buttons/js/dataTables.buttons.min.js?versao=3.2310.10.1"></script>
  <script type="text/javascript" src="plugins/datatables-buttons/js/buttons.html5.min.js?versao=3.2310.10.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('RELANIVERSARIO');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

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

    });
  </script>
</body>

</html>