<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Eventos || SoftMais</title>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="/caminho/personalizacao.css">
    <link rel="stylesheet" type="text/css" href="/caminhoImagem1">
    <link rel="stylesheet" type="text/css" href="/caminhoImagem2">
    <link rel="stylesheet" type="text/css" href="/caminhoImagem3">
    <link rel="stylesheet" type="text/css" href="/caminhoImagem4">
    <link rel="stylesheet" type="text/css" href="/caminhoImagem5">
</head>
<body>
  <nav class="navbar navbar-expand-lg navbar-light bg-light-fluid" style="background-color:paleturquoise" >
    <div class="container-fluid">
      <a class="navbar-brand" href="https://github.com/lcunha957/ProjetoEventos">Projeto Eventos</a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
          <li class="nav-item">
            <a class="nav-link active" aria-current="page" href="#">Início</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/login">Login</a>
          </li>
            <li class="nav-item">
            <a class="nav-link" href= "/cadastrar">Cadastro</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href= "/eventos">Eventos</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href= "/historico">Histórico</a>
          </li>
          <li class= "nav-item">
            <button class="btn-sm btn-outline-primary" type="submit" href="/logout" style=" position:absolute; right: 0;">Sair do Sistema</button>
          </li>
        </ul>
    </div>
    </div>
  </nav>
        
  <br><h1> Lista de Eventos </h1><br><br>

  <script> 
    function funcaoAdicionadoAoCarrinho()
    {
      alert ("Parabéns por ter adquirido o nosso treinamento, ele foi adicionado ao carrinho");
    }
    </script>

  <div class="mid">
      <div class="row row-cols-2 row-cols-md-4  ">
        <%for(var i =0; i<eventos.length; i++) {%>
          <form action="/insertEventosHistorico" method="post">
            <div class="col mb-4">
            <div class="card">
              <p class = "card-title">Foto do evento:</p>
              <img src="/imagens/<%-eventos[i].foto%>" class="card-img-top">
              <div class="card-body">
                <h5><p class="card-title"> Nome do Evento: </p><%-eventos[i].nome_evento%></h5> 
                <small class="form-text text-muted">ID do evento: <%-eventos[i].id_evento%>
                  <input type="number" class="form-control" id="id_evento" name="id_evento" min="1" value="<%-eventos[i].id_evento%>" style="display: none;">
                </small>
                <p class="card-text"> Descrição do Evento: <%-eventos[i].descricao_evento%></p>
                <div class="card-footer">
                  <div class="input-group mb-3">
                    <div class="input-group-prepend" id="button-addon3">
                    <p class="card-text">Ingressos em estoque:<%-eventos[i].ingressos%></p>
                    <p class= "card-text"> Preço: R$ <%-eventos[i].preco%>
                    </div>
                    <p class= "card-title"> Quantidade: </p><input type="number" class="form-control" id="quantidadeing" name="quantidadeing" placeholder="Quantidade de eventos" min="1" required>
                    <button class="btn btn-primary" id="btnAddCarrinho" type="submit" onclick= "funcaoAdicionadoAoCarrinho;"> Matricular </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </form>
      <%}%>
    </div>
  </div>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</html>
