<!DOCTYPE html>
<html lang="pt-br">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="<?php echo URL_BASE . 'src/styles/global.css'; ?>">
  <link rel="stylesheet" href="<?php echo URL_BASE . 'src/styles/styles.css'; ?>">

  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
  <title>Aua News em Portuguese</title>
</head>

<body>
<header>
  <nav class="navbar navbar-expand-lg bg-body-tertiary">
    <div class="container">
      <a class="navbar-brand me-5" href="<?php echo URL_BASE; ?>"><img src="<?php echo URL_BASE; ?>src/assets/images/logo_aua_news.png" alt="Aua News in Portuguese" style="width:250px;"></a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse justify-content-center" id="navbarNavDropdown">
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link<?php if($_GET['page'] == 'home'){echo ' active';} ?>" aria-current="page" href="<?php echo URL_BASE; ?>">Home</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="<?php echo URL_BASE; ?>sobre-nos">Sobre Nós</a>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle<?php if($_GET['page'] == 'edicoes'){echo ' active';} ?>" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
              Edições Anteriores
            </a>
            <ul class="dropdown-menu">
              <?php
			  $ano = 2015;
			  $ano_atual = date("Y");
			  while($ano <= $ano_atual){
			  $data_i = $ano.'-01-01';
			  $data_f = $ano.'-12-31';
			  $sql = $conecta->query("SELECT COUNT(id) AS verif FROM publicacoes WHERE edicao >= '$data_i' AND edicao <= '$data_f'");
			  while ($consulta = $sql->fetch_assoc()){
			  $verif = $consulta['verif'];}
			  if($verif > 0){
			  ?>
			  <li><a class="dropdown-item" href="<?php echo URL_BASE; ?>edicoes-anterioes/<?php echo $ano; ?>"><?php echo $ano; ?></a></li>
			  <?php
			  }
			  $ano = $ano + 1;
			  }
			  ?>
              
            </ul>
          </li>
          <li class="nav-item">
            <a class="nav-link<?php if($_GET['page'] == 'tradutores'){echo ' active';} ?>" href="<?php echo URL_BASE; ?>tradutores">Tradutores</a>
          </li>
          <!--<li class="nav-item">
            <a class="nav-link" href="#">Aua News</a>
          </li>-->
          <li class="nav-item">
            <a class="nav-link" href="https://www.auanet.org/membership/join-the-aua" target="_blank">Seja Membro do Aua</a>
          </li>
          <li class="nav-item">
            <a class="nav-link<?php if($_GET['page'] == 'contato'){echo ' active';} ?>" href="<?php echo URL_BASE; ?>contato">Contato</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>
</header>