<?php
$verif_divs = array();
$liste_division = mysqli_query($bdd,"SELECT division FROM ".$prefix."_eleves GROUP BY division ORDER BY division ASC");
foreach($liste_division as $liste) {
	array_push($verif_divs, strtolower($liste['division']));
}
require_once('db/proc/freq_stats_nivcolors.php');
if($nivs_info['valeur']=="PER") {
	$checknb=0;						
	foreach($verif_divs as $verif_div) {
		$pat= '/'.$verif_div.'^/';
		foreach($tabDebniveau as $ch) {							
			$bord='/^'.strtolower($ch).'/';
			if(preg_match($bord,strtolower($verif_div))) {								
				$checknb++;								
			}						
		}					
	}
	if($checknb!=count($verif_divs)) {
		echo DIVETAB_ERROR;
	}
}
else {
	foreach($verif_divs as $verif_div) {
		if(!in_array(substr($verif_div,0,1),$tabDebniveau)) {
			echo DIVETAB_ERROR;
			break;
		}
	}
}
?>