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
This commit is contained in:
Bob Le Bricodeur 2014-11-15 02:21:12 +01:00
parent 8910c69495
commit bae0054b77

View File

@ -838,48 +838,46 @@ if (substr($dsondage->format, 0, 1)=="D") {
for ($i = 0; $i < count($toutsujet); $i++) { for ($i = 0; $i < count($toutsujet); $i++) {
// Current date // 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; $border[$i] = false;
$radio_title[$i] = strftime($date_format['txt_short'],$current); $radio_title[$i] = strftime($date_format['txt_short'],$horoCur[0]);
// Months // Months
$td_headers[$i] = 'M'.($i+1-$colspan_month); $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++; $colspan_month++;
} else { } else {
$border[$i] = true; $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; $colspan_month=1;
} }
// Days // Days
$td_headers[$i] .= ' D'.($i+1-$colspan_day); $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++; $colspan_day++;
} else { } else {
$rbd = ($border[$i]) ? ' rbd' : ''; $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; $colspan_day=1;
} }
// Hours // Hours
$rbd = ($border[$i]) ? ' rbd' : ''; $rbd = ($border[$i]) ? ' rbd' : '';
if (strpos($current,'@') !== false) { if ($horoCur[1] !== "") {
$hour = substr($current, strpos($current, '@')-count($current)+2); $tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>';
$radio_title[$i] .= ' - '.$horoCur[1];
if ($hour != "") {
$tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$hour.'">'.$hour.'</th>';
$radio_title[$i] .= ' - '.$hour;
$td_headers[$i] .= ' H'.$i; $td_headers[$i] .= ' H'.$i;
} else { } else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>'; $tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
} }
} else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
}
// Remove col // Remove col
$tr_add_remove_col .= (count($toutsujet) > 2 ) ? '<td headers="'.$td_headers[$i].'"><button type="submit" name="effacecolonne'.$i.'" class="btn btn-link btn-sm" title="' . _('Remove the column') . ' ' .$radio_title[$i]. '"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">'. _("Remove") .'</span></button></td>' : '<td role="presentation"></td>'; $tr_add_remove_col .= (count($toutsujet) > 2 ) ? '<td headers="'.$td_headers[$i].'"><button type="submit" name="effacecolonne'.$i.'" class="btn btn-link btn-sm" title="' . _('Remove the column') . ' ' .$radio_title[$i]. '"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">'. _("Remove") .'</span></button></td>' : '<td role="presentation"></td>';