<?php
$visusigb = mysqli_fetch_assoc(mysqli_query($bdd,"SELECT * FROM ".$prefix."_parametres WHERE param_nom = 'freq_res_visusigb'"));
if($visusigb['valeur']=='1') {
	$retardverif = mysqli_query($bdd,"SELECT * FROM ".$prefix."_retards WHERE eleves_id = '".$eleve_id."'  ORDER BY niv_alerte DESC, retour_date ASC, titre ASC");
	if(mysqli_num_rows($retardverif)>0) {
		echo '<div style="clear:both;" class="scroll"><br>&nbsp; <br><h2>'.FREQC_RETAR14.FREQC_RETAR151.'</h2>';
		echo '<table id="tablesorter" class="tablesorter journaltable"><thead><tr><th>'.FREQC_RETAR3.'</th><th>'.FREQC_RETAR12.'</th><th>'.FREQC_RETAR13.'</th></tr></thead><tbody>';
		foreach($retardverif as $item) {
			echo '<tr><td>'.$item['titre'].'</td><td>'.date('d/m/Y', strtotime(str_replace("/","-",$item['retour_date']))).'</td><td>';
			if($item['niv_alerte']=='1') { echo FREQ_GEST3; }
			else if($item['niv_alerte']=='2') { echo FREQ_GEST4; }
			else if($item['niv_alerte']=='3') { echo FREQ_GEST5; }
			echo '</td></tr>';
		}
		echo '</tbody></table></div>';
	}
	$retardverif = mysqli_query($bdd,"SELECT * FROM ".$prefix."_sigbresas WHERE eleves_id = '".$eleve_id."'");
	if(mysqli_num_rows($retardverif)>0) {
		echo '<div class="scroll"><br>&nbsp; <br><h2>'.FREQC_RETAR15.FREQC_RETAR151.'</h2>';
		echo '<table id="tablesorter" class="tablesorter journaltable"><thead><tr><th>'.FREQC_RETAR3.'</th><th>'.FREQC_RETAR16.'</th><th>'.FREQC_RETAR11.'</th></tr></thead><tbody>';
		foreach($retardverif as $item) {
			echo '<tr><td>'.$item['titre'].'</td><td>'.date('d/m/Y', strtotime(str_replace("/","-",$item['date_statut']))).'</td><td>'.$item['statut'].'</td></tr>';
		}
		echo '</tbody></table></div></div></div>';
	}
}