From c1c337142cf25821d37aa1bc7ff0273285da08ae Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur <Mr.Bricodage@gmail.com> Date: Sat, 15 Nov 2014 02:41:20 +0100 Subject: [PATCH] several warning displayed : A non well formed numeric value encountered in "studs.php" remove all displayed warning by splitting day and hour in $current variable --- studs.php | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/studs.php b/studs.php index 0d3ee937..82c6853b 100644 --- a/studs.php +++ b/studs.php @@ -333,44 +333,43 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") { // Current date $current = $toutsujet[$i]; + $horoCur = explode("@",$current); //horoCur[0] = date, horoCur[1] = hour + if (isset($toutsujet[$i+1])){ + $next = $toutsujet[$i+1]; + $horoNext = explode("@",$next); + } $border[$i] = false; - $radio_title[$i] = strftime($date_format['txt_short'],$current); + $radio_title[$i] = strftime($date_format['txt_short'],$horoCur[0]); // Months $td_headers[$i] = 'M'.($i+1-$colspan_month); - if (isset($toutsujet[$i+1]) && strftime("%B", $current) == strftime("%B", $toutsujet[$i+1]) && strftime("%Y", $current) == strftime("%Y", $toutsujet[$i+1])){ + if (isset($toutsujet[$i+1]) && strftime("%B", $horoCur[0]) == strftime("%B", $horoNext[0]) && strftime("%Y", $horoCur[0]) == strftime("%Y", $horoNext[0])){ $colspan_month++; } else { $border[$i] = true; - $tr_months .= '<th colspan="'.$colspan_month.'" class="bg-primary month" id="M'.($i+1-$colspan_month).'">'.strftime("%B",$current).' '.strftime("%Y", $current).'</th>'; + $tr_months .= '<th colspan="'.$colspan_month.'" class="bg-primary month" id="M'.($i+1-$colspan_month).'">'.strftime("%B",$horoCur[0]).' '.strftime("%Y", $horoCur[0]).'</th>'; $colspan_month=1; } // Days $td_headers[$i] .= ' D'.($i+1-$colspan_day); - if (isset($toutsujet[$i+1]) && strftime($date_format['txt_day'],$current)==strftime($date_format['txt_day'],$toutsujet[$i+1])&&strftime("%B",$current)==strftime("%B",$toutsujet[$i+1])){ + if (isset($toutsujet[$i+1]) && strftime($date_format['txt_day'],$horoCur[0])==strftime($date_format['txt_day'],$horoNext[0])&&strftime("%B",$horoCur[0])==strftime("%B",$horoNext[0])){ $colspan_day++; } else { $rbd = ($border[$i]) ? ' rbd' : ''; - $tr_days .= '<th colspan="'.$colspan_day.'" class="bg-primary day'.$rbd.'" id="D'.($i+1-$colspan_day).'">'.strftime($date_format['txt_day'],$current).'</th>'; + $tr_days .= '<th colspan="'.$colspan_day.'" class="bg-primary day'.$rbd.'" id="D'.($i+1-$colspan_day).'">'.strftime($date_format['txt_day'],$horoCur[0]).'</th>'; $colspan_day=1; } // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if (strpos($current,'@') !== false) { - $hour = substr($current, strpos($current, '@')-count($current)+2); - - if ($hour != "") { - $tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$hour.'">'.$hour.'</th>'; - $radio_title[$i] .= ' - '.$hour; + if ($horoCur[1] !== "") { + $tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>'; + $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; - } else { - $tr_hours .= '<th class="bg-info'.$rbd.'"></th>'; - } } else { $tr_hours .= '<th class="bg-info'.$rbd.'"></th>'; } -- GitLab