<?php
$hor = mysqli_query($bdd,"SELECT * FROM ".$prefix."_horaires ORDER BY num_creneau");
$hor_nb = mysqli_num_rows($hor);
$plageH = array();
$interH = array();
$cren_colors = mysqli_fetch_assoc(mysqli_query($bdd,"SELECT valeur FROM ".$prefix."_parametres WHERE param_nom = 'edt_crencolors'"));
foreach($hor as $hor_info) {
	$plageH[] = substr($hor_info['debut'],0,5);
	$plageHend[] = substr($hor_info['fin'],0,5);
	$plageDebut[] = $hor_info['debut'];
	$plageFin[] = $hor_info['fin'];
	$plage_horid[] = $hor_info['hor_id'];
	$plage_horname[] = $hor_info['hor_name'];
	$plage_nom[] = $hor_info['hor_name'];
	$plage_demijour[] = substr($hor_info['hor_name'],0,1);
	$hinter=strtotime($hor_info['fin'])-strtotime($hor_info['debut']);
	$num_creneau[] = $hor_info['num_creneau'];
	$heighthor[] = ($hinter/60)*0.85;	
}
foreach($daysOfWeek as $key => $val) {
	$key = strtoupper(substr($key,0,1)).substr($key,1,2);
	foreach($hor as $hor_info) {
		if($freq_gestion_jourscren['valeur']==0) {
			$plage_open[$key][] = substr($hor_info['hor_freq'],2,1);
		}
		else {
			$plage_open[$key][] = @intval(substr($hor_info['hor_freq'], strpos($hor_info['hor_freq'], $key) + strlen($key), 3));
		}
	}
}
?>
