<!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> Historico || 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" href="/logout" type="submit" style=" position:absolute; right: 0;">Sair do Sistema</button>
          </li>
        </ul>
    </div>
    </div>
  </nav>
        
  <br><h1> Histórico das Matrículas </h1><br><br>
  
  <div class="mid-content">
    <div class="mid-left">
      <%for(var i=0; i<eventosSelecionados.length; i++) {%>
        <div class="card mb-3">
          <div class="row no-gutters">
            <div class="col-md-4">
              <p class = "card-title">Foto do evento:</p>
              <img src="/image/<%-eventosSelecionados[i].foto%>" class="card-img" alt="imagem evento">
            </div>
            <div class="col-md-8">
                <div class="card-body">
                  <h5 class="card-title"> Nome do evento: <%-eventosSelecionados[i].nome%></h5>
                  <small class="form-text text-muted">ID do evento: <%-eventosSelecionados[i].codigo%></small>
                  <div class="input-group mb-3 justify-content-end">
                    <div class="input-group-prepend" id="button-addon3">
                      <p class= "card-title"> Quantidade: </p><%-produtosSelecionados[i].quantidade%>
                      <p class= "card-text"> Valor Total: R$ <%-produtosSelecionados[i].totalDoEvento%>
                    </div>
                  </div>
                </div>
            </div>
          </div>
        </div>
        <%}%>
    </div>
    <div class="mid-right">
      <%if(valorTotalF==0){%>
        <div class="carrinhoVazio">Seu carrinho está vazio!</div>
      <%}else{%> 
        <div class="card mb-1">
          <div class="col-md-12">
            <div class="row no-gutters">
              <div class="card-body">
                <h5 class="card-title">Seu carrinho</h5>
                <p class="card-text"></p>
                <div class="input-group mb-2">
                  <div class="input-group-prepend">
                    <%if(temCarrinho>0){%> 
                      <button class="btn btn-primary" id="btnInserir" type="button">Finalizar</button>
                    <%}else{%>
                      <a href="/login" class="btn btn-primary" id="btnEdCarrinho" type="button">Cadastre-se para finalizar a sua compra!</a>
                    <%}%>
                    <button class="btn btn-secondary" id="btnAtualiza" type="button" disabled> Valor total: R$<%-valorTotalF%> </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      <%}%> 
    </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>
