<?php
$blocnotes = mysqli_query($bdd,"SELECT * FROM ".$prefix."_agenda WHERE SUBSTRING(options, 9, 1) = '1' 
AND (date1 >= '".date('Y-m-d')."' OR date2 >= '".date('Y-m-d')."') ORDER BY date1 ASC");
if(mysqli_num_rows($blocnotes)>0) {
	echo '<h2>'.EDTC_AGE15.'</h2>';
	foreach($blocnotes as $blocnote) {
		$date1 = DateTime::createFromFormat('Y-m-d', $blocnote['date1']);
		$date2 = DateTime::createFromFormat('Y-m-d', $blocnote['date2']);
		echo '<li>';
		if($blocnote['date2']!='0000-00-00') {
			echo FROM21.' '.$date1->format('d/m/Y').' '.TO2.' '.$date2->format('d/m/Y').DOTS.' ';
		}
		else {
			echo LE.' '.$date1->format('d/m/Y').DOTS.' ';
		}
		echo $blocnote['titre'];
		if($blocnote['texte']!='') { echo $blocnote['texte']; }
		echo '</li>';		
	}				
	echo '</td>';
}
?>