
$mes = date('n');
if($_GET['mes']){
$mes = $_GET['mes'];
}
$ano = date('Y');
?>
Selecione o mês:
Janeiro
Fevereiro
Março
Abril
Maio
Junho
Julho
Agosto
Setembro
Outubro
Novembro
Dezembro
Selecione o ano:
$sql = "select *, date_format(dia, '%Y') as ano from agenda group by ano order by ano ";
$sql = mysql_query($sql);
while($a = mysql_fetch_object($sql)){
echo '
'.$a->ano.'';
}
?>
$sql1 = "select *,
date_format(dia, '%%d') as dia,
date_format(dia, '%%c') as mes
from agenda
where year(dia) = '%s'
and MONTH(dia) = '%s'
order by dia";
$sql1 = sprintf($sql1,$ano, $mes);
$sql1 = mysql_query($sql1);
$num = mysql_num_rows($sql1);
if($num == 0){
echo '
Nenhum compromisso encontrado
';
}
while ($news = mysql_fetch_object($sql1)){
echo '
'.$news->dia.'
'.$meses[$news->mes].'
';
echo '
'.$news->titulo.'
';
echo nl2br($news->descricao);
echo '
';
$sql3 = "select * from agendafoto where agenda_id =".$news->id;
$sql3 = mysql_query($sql3);
echo '
';
while($f = @mysql_fetch_object($sql3)){
echo '

';
}
echo '
';
echo '
';
echo '
';
}
?>