idResidence : $row->idBatiment; if($row->isResidence){ $row->batiment = "Tout"; $totalLog = $ResidRowsTotal[$row->idResidence]->totalLogements; $totalLits = $ResidRowsTotal[$row->idResidence]->totalLits; $totalNuits = $ResidRowsTotal[$row->idResidence]->totalNuits; $totalNuitsParLit = $ResidRowsTotal[$row->idResidence]->totalNuitsParLit; }else{ $totalLog = $rowsTotal[$key]->totalLogements; $totalLits = $rowsTotal[$key]->totalLits; $totalNuits = $rowsTotal[$key]->totalNuits; $totalNuitsParLit = $rowsTotal[$key]->totalNuitsParLit; if(!empty($mois)){ foreach($mois as $m=>$val){ if(!empty($rowsParMois[$m]) && !empty($rowsParMois[$m][$key])){ $MTL = !empty($rowsParMoisArr[$row->idResidence][$m]['totalLog']) ? $rowsParMoisArr[$row->idResidence][$m]['totalLog'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalLog'] = $MTL + $rowsParMois[$m][$key]->totalLogements; $MTLI = !empty($rowsParMoisArr[$row->idResidence][$m]['totalLit']) ? $rowsParMoisArr[$row->idResidence][$m]['totalLit'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalLit'] = $MTLI + $rowsParMois[$m][$key]->totalLits; $MTN = !empty($rowsParMoisArr[$row->idResidence][$m]['totalNuits']) ? $rowsParMoisArr[$row->idResidence][$m]['totalNuits'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalNuits'] = $MTN + $rowsParMois[$m][$key]->totalNuits; $MTNL = !empty($rowsParMoisArr[$row->idResidence][$m]['totalNuitsParLit']) ? $rowsParMoisArr[$row->idResidence][$m]['totalNuitsParLit'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalNuitsParLit'] = $MTNL + $rowsParMois[$m][$key]->totalNuitsParLit; //total de tout les batiment par mois $MTNG = !empty($rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuits']) ? $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuits'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuits'] = $MTNG + $rowsTotalParMois[$m][$key]->totalNuits; $MTNLG = !empty($rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuitsParLit']) ? $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuitsParLit'] : 0; $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuitsParLit'] = $MTNLG + $rowsTotalParMois[$m][$key]->totalNuitsParLit; } } } } ?> $val):?> $val):?>
'.$row->residence ?> '.$row->batiment ?> totalNuits; if($row->isResidence){ $rowsParMois[$m][$key]->totalLogements = $rowsParMoisArr[$row->idResidence][$m]['totalLog']; $rowsParMois[$m][$key]->totalNuits = $rowsParMoisArr[$row->idResidence][$m]['totalNuits']; $totalNuits = $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuits']; } echo ''.round(($rowsParMois[$m][$key]->totalNuits * 100) / $totalNuits ,2).' %'; echo '
('.$rowsParMois[$m][$key]->totalLogements.' occupés / ' .$totalLog.' logements)'; echo '
('.$rowsParMois[$m][$key]->totalNuits.' nuités / '.$totalNuits.' nuits)'; } ?>
totalNuitsParLit; if($row->isResidence){ $rowsParMois[$m][$key]->totalLits = $rowsParMoisArr[$row->idResidence][$m]['totalLit']; $rowsParMois[$m][$key]->totalNuitsParLit = $rowsParMoisArr[$row->idResidence][$m]['totalNuitsParLit']; $totalNuitsParLit = $rowsParMoisArr[$row->idResidence][$m]['totalGlobalNuitsParLit']; } echo ''.round(($rowsParMois[$m][$key]->totalNuitsParLit * 100) / $totalNuitsParLit ,2).' %'; echo '
('.$rowsParMois[$m][$key]->totalLits.' occupés / '.$totalLits.' places)'; echo '
('.$rowsParMois[$m][$key]->totalNuitsParLit.' nuités / '.$totalNuitsParLit.' nuits)'; } ?>
isResidence)continue;//on ne prend pas la ligne global residence if($modeResidence){ $totalNuits = $rowsTotal[$row->idResidence]->totalNuits; $TO = round(($row->totalNuits * 100)/$totalNuits ,2); $data[] = [$row->residence , $TO]; }else{ $totalNuits = $rowsTotal[$row->idBatiment]->totalNuits; $TO = round(($row->totalNuits * 100)/$totalNuits ,2); $data[] = [$row->batiment , $TO]; } } // $i = 0; // $dataMois[$i][] = "Mois"; // if(!empty($mois)){ // foreach($rows as $row){ // if($row->isResidence)continue;//on ne prend pas la ligne global residence // $dataMois[$i][] = $row->batiment; // } // foreach($mois as $m=>$val){ // $i++; // $dataMois[$i][] = $m; // foreach($rows as $row){ // if($row->isResidence)continue;//on ne prend pas la ligne global residence // $key = $modeResidence ? $row->idResidence : $row->idBatiment; // //$totalLog = $rowsTotal[$key]->totalLogements; // $totalNuits = $rowsTotalParMois[$m][$key]->totalNuits; // $TO = round(($rowsParMoisChart[$m][$key]->totalNuits * 100)/$totalNuits ,2); // $dataMois[$i][] = $TO; // } // } // } ?>