<div class="container-fluid banner_cursos">
	<div class="row">
		<div class="col-md-12">
			<h1 class="text-center"><?php echo $traducao['banner_courses_title']; ?></h1>
		</div>
	</div>
</div>
<div class="container dr_coordenadores">
	<div class="row">
		<div class="col-md-2">
			&nbsp;
		</div>
		<div class="col-md-8">
			<?php
			$hoje = date("Y-m-d");
			$campo_nome = 'nome_'.$_GET['language'];
			$campo_descricao = 'descricao_'.$_GET['language'];
			$sql = $conecta->query("SELECT * FROM cursos WHERE data < '".$hoje."' ORDER BY data DESC");
			while ($consulta = $sql->fetch_assoc()){
			if($_GET['language'] == 'br'){
			$data_curso = date("d/m/Y", strtotime($consulta['data']));}
			else{
			$data_curso = $consulta['data'];}
			?>
			<div class="alert alert-secondary" role="alert">
			  <strong><i class="fas fa-calendar-alt"></i> <?php echo $data_curso; ?></strong>
			  &nbsp;&nbsp;&nbsp;<a data-toggle="modal" data-target=".detalhes-<?php echo $consulta['id']; ?>"><i class="fas fa-info-circle"></i></a><br>
			  <?php echo $consulta[$campo_nome]; ?>
			</div>
			
			<!-- Modal de Detalhes do Curso -->
			
			<div class="modal fade detalhes-<?php echo $consulta['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
			  <div class="modal-dialog modal-xl">
				<div class="modal-content">
				  <div class="modal-header">
					<h6 class="modal-title" id="exampleModalLabel"><i class="fas fa-calendar-alt"></i> <?php echo $data_curso; ?>  <?php echo $consulta[$campo_nome]; ?></h6>
					<button type="button" class="close" data-dismiss="modal" aria-label="Fechar">
					  <span aria-hidden="true">&times;</span>
					</button>
				  </div>
				  <div class="modal-body">
					<div class="row">
						<div class="col">
							<?php echo $consulta[$campo_descricao]; ?>
						</div>
					</div>
					<div class="row">
						<div class="col">
							&nbsp;
						</div>
					</div>
					<div class="row">
						<?php
						$sql1 = $conecta->query("SELECT * FROM fotos WHERE id_curso = '".$consulta['id']."' ORDER BY id ASC");
						while ($consulta1 = $sql1->fetch_assoc()){
						$legenda = 'legenda_'.$_GET['language'];
						?>
						<div class="col-6">
							<div style="background-image: url('/assets/imagens/<?php echo $consulta1['imagem']; ?>'); background-size: cover; background-position-y: center; height: 150px; padding: 15px 15px; border-radius: 5px;">
								&nbsp;
							</div>
							<p class="text-center" style="font-size: 10pt; color: #8a8a8a;"><?php echo $consulta1[$legenda]; ?></p><br>
						</div>
						<?php
						}
						?>
					</div>
				  </div>
				  <div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
				  </div>
				</div>
			  </div>
			</div>
			
			<?php
			}
			?>
		</div>
		<div class="col-md-2">
			&nbsp;
		</div>
	</div>
</div>