From bae0054b77af27e7cf9134e2f75804fc21536685 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Sat, 15 Nov 2014 02:21:12 +0100 Subject: [PATCH] several warning displayed : "A non well formed numeric value encountered in adminstuds.php" remove all displayed warning by splitting day and hour in $current variable --- adminstuds.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index 7369316..1af9393 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -838,45 +838,43 @@ if (substr($dsondage->format, 0, 1)=="D") { for ($i = 0; $i < count($toutsujet); $i++) { // Current date - $current = $toutsujet[$i]; - + $current = $toutsujet[$i];//format date@hour. ex : 2020292820@10:00 + $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 .= ''.strftime("%B",$current).' '.strftime("%Y", $current).''; + $tr_months .= ''.strftime("%B",$horoCur[0]).' '.strftime("%Y", $horoCur[0]).''; $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 .= ''.strftime($date_format['txt_day'],$current).''; + $tr_days .= ''.strftime($date_format['txt_day'],$horoCur[0]).''; $colspan_day=1; } // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if (strpos($current,'@') !== false) { - $hour = substr($current, strpos($current, '@')-count($current)+2); - - if ($hour != "") { - $tr_hours .= ''.$hour.''; - $radio_title[$i] .= ' - '.$hour; + if ($horoCur[1] !== "") { + $tr_hours .= ''.$horoCur[1].''; + $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; - } else { - $tr_hours .= ''; - } } else { $tr_hours .= ''; }