Non proprio. Insomma non posso fare un calcolo quando formo l'array. devo sommarli così.
Vi posto il codice
Codice PHP:
foreach($pack->id_packages as $id_package){
//vedo se ci sto almeno un giorno in questo package
if($pack->GetDaysInPackage($id_package) > 0){
foreach($rm->GetRooms($id_package) as $id_room){
$reduction = new reductions();
$reduction->People($id_package, $id_room, $id_treatment['id_treatment'], $pack->GetDaysInPackage($id_package), $inquire);
}
}
}
$price_adults = $inquire->GetPriceAdults();
foreach($price_adults as $price){
$rm->GetInfo($price[room]);
$tr->GetInfo($price[treatment_type]);
echo "
Camera \"" . $rm->GetName() . "\" in trattamento \"" . $tr->GetName() . "\" ha un costo di " . $inquire->PrintPrice($price[price]) . " euro </p>";
}
Codice PHP:
foreach($treatments_type as $treatment_type){
++$a;
for($i = 1;$i<= $inquire->GetTotalPeople(); $i++){
//echo "
<u>(ROOM $id_room)</u>[b]Trattamento: $treatment_type [/b]</p>";
unset($this->id_reductions);
$this->SearchReduction($id_package, $id_room, $treatment_type, $i, $inquire->GetAgePerson($i));
$treatments = $rm->GetBasePrice($id_package, $id_room, $treatment_type);
foreach($this->id_reductions as $id_reduction){
if($id_reduction !== 'NO'){
$this->GetInfo($id_reduction);
$price_adults[$treatment_type][$id_room] += $this->CalculatePriceTreatment($treatments['base_price'], $this->GetPrice(), $this->GetOperator());
}else{
$price_adults[$treatment_type][$id_room] += $treatments['base_price'];
}
}
}
$price_adults[$treatment_type][$id_room] = $price_adults[$treatment_type][$id_room]/7 * $days;
$inquire->SetPriceAdults($id_room, $treatment_type, $price_adults[$treatment_type][$id_room]);
}
Spero riusciate a capirlo