<?php
echo '<p name="noprint"><a href="javascript:;clearTimeout(timer);" style="color:black;text-decoration:none;" onmouseover="this.style.textDecoration=\'underline\';" onmouseout="this.style.textDecoration=\'none\';" onmousedown="toggleDiv(\'divclasse\');" onclick = "setTimeout(function() { window.location = window.location;
}, 240000);"><i class="fas fa-angle-double-right"></i> <b>'.FREQ_BUTTON2.'</b></a></p>';
echo '<div id="divclasse" style="display:none;">';

echo '<p><div class="box"><select name="classe" id="classe" value="" onchange="go()"><option></option>';

$liste_division = mysqli_query($bdd,"SELECT division FROM ".$prefix."_eleves WHERE categ = '1' GROUP BY division ORDER BY division ASC");
while($liste = mysqli_fetch_assoc($liste_division)) {
	echo '<option>'.$liste['division'].'</option>';
}
$liste_groupe = mysqli_query($bdd,"SELECT groupe_nom FROM ".$prefix."_groupes WHERE groupe_actif = 1 GROUP BY groupe_nom ORDER BY groupe_nom ASC");
while($listeg = mysqli_fetch_assoc($liste_groupe)) {
	echo '<option>'.$listeg['groupe_nom'].'</option>';
}
echo '</select></div></p>
<div id="checkopt" style="display:none;"><input name="checkAll" id="checkAll" class="bud" type="checkbox" onclick="full()" checked /><span name="noprint"><label for="checkAll">'.CHECKORNOT.'</label></span></div>';
echo '<script type=\'text/javascript\'>
$(\'#checkAll\').click(function() {

var elevs = $("#elev").find(\':checkbox\'); 
   if(this.checked){ 
	  elevs.prop(\'checked\', true); 
   } else{ 
	  elevs.prop(\'checked\', false);
   }          
});
</script></div>
<div id=\'divselect\' style=\'display:inline\'>

</div><br>';
// voir liste sélecteurs sur https://www.w3schools.com/jquery/jquery_ref_selectors.asp
echo '<script type="text/javascript" language="javascript">
	function nb() {
		checkall = document.getElementById(\'checkAll\');
		nbDynEle = $(\'input.elc:checked\').length;
		document.getElementById("NbEle").innerHTML = nbDynEle;
	}
</script>';
echo '<script type="text/javascript" language="javascript">
	function full() {
		checkall = document.getElementById(\'checkAll\');';
		echo 'if(checkall.checked) { 
			nbFull = document.getElementById("NbEle").getAttribute(\'name\');
			document.getElementById("NbEle").innerHTML = nbFull;
		}
		else {
			nbDynEle = 0;
			document.getElementById("NbEle").innerHTML = nbDynEle;
		}
	}
</script>';
?>