1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public function calculer($nbrPrestations,$tab,$request)
{
for($i=0; $i<$nbrPrestations; $i++)
{
$tab[0][$i] = $request->get('petitDej'.$i);
$tab[1][$i] = $request->get('nuite'.$i);
$tab[2][$i] = $request->get('petitDej'.$i);
$tab[3][$i] = $request->get('dej'.$i);
$tab[4][$i] = $request->get('diner'.$i);
$tab[$i][5] = 0;
$tab[$i][5] = $tab[$i][0] + $tab[$i][1] + $tab[$i][2] + $tab[$i][3] + $tab[$i][4] ; /* Total de chaque prestation */
$tab[$nbrPrestations][0] += $tab[$i][0]; /* Total des petit déj */
$tab[$nbrPrestations][1] += $tab[$i][1]; /* Total des nuité */
$tab[$nbrPrestations][2] += $tab[$i][2]; /* Total des déj */
$tab[$nbrPrestations][3] += $tab[$i][3]; /* Total des diner */
$tab[$nbrPrestations][4] += $tab[$i][4]; /* Total des autres */
}
/* Total Global */
$tab[$nbrPrestation][5] = $tab[$nbrPrestation][0] + $tab[$nbrPrestation][1] + $tab[$nbrPrestation][2]
+ $tab[$nbrPrestation][3] + $tab[$nbrPrestation][4];
return $tab;
} |
Partager