function Relatorio_Media_Anual($con, $ano)
{
    $select_periodo = $con->query("SELECT SUBSTRING(Nome, 1, 3) AS 'mes' FROM periodo");
    while ($exibe_periodo = $select_periodo->fetch_array()) {
        $per = $exibe_periodo['mes'] . $ano;
        echo "<style type='text/css'>html {cursor: wait;}</style>";
        $retorno_rel = Relatorio_Media($con, $per);
    }
    echo "<style type='text/css'>html {cursor: auto;}</style>";
}
	
</head>
<body>

	<header>
		<div>Controle de Qualidade - Sanvitron</div>
		<a href="../relatorio.php"><img src="../img/logo-san.png" alt="Sanvitron" width="70" height="64"></a>
	</header>

	<?php 
$periodo = $_POST['periodoGet'];
$ano = $_POST['anoGet'];
?>

	<section class="impressao">
		<?php 
if ($periodo == 'anual') {
    // checkbox habilitado recebe 'anual'
    Relatorio_Media_Anual($conexao, $ano);
} else {
    Relatorio_Media($conexao, $periodo);
}
?>
	</section>

	<?php 
FechaConexao($conexao);
?>

</body>
</html>