예제 #1
0
 $Cystein = calculate_micro_value($pm->{'Cystein'}, $cur_weight * $ideal_values_for_meal['Cystein'], $meal_portion, 0.1);
 $sum += $Cystein;
 $html .= '<tr><td>' . @round($pm->{'Cystein'}, 4) . '</td><td>' . $Cystein . '%</td></tr>';
 $Leucin = calculate_micro_value($pm->{'Leucin'}, $cur_weight * $ideal_values_for_meal['Leucin'], $meal_portion, 0.1);
 $sum += $Leucin;
 $html .= '<tr><td>' . @round($pm->{'Leucin'}, 4) . '</td><td>' . $Leucin . '%</td></tr>';
 $Lysin = calculate_micro_value($pm->{'Lysin'}, $cur_weight * $ideal_values_for_meal['Lysin'], $meal_portion, 0.1);
 $sum += $Lysin;
 $html .= '<tr><td>' . @round($pm->{'Lysin'}, 4) . '</td><td>' . $Lysin . '%</td></tr>';
 $Threonin = calculate_micro_value($pm->{'Threonin'}, $cur_weight * $ideal_values_for_meal['Threonin'], $meal_portion, 0.1);
 $sum += $Threonin;
 $html .= '<tr><td>' . @round($pm->{'Threonin'}, 4) . '</td><td>' . $Threonin . '%</td></tr>';
 $Tryptophan = calculate_micro_value($pm->{'Tryptophan'}, $cur_weight * $ideal_values_for_meal['Tryptophan'], $meal_portion, 0.1);
 $sum += $Tryptophan;
 $html .= '<tr><td>' . @round($pm->{'Tryptophan'}, 4) . '</td><td>' . $Tryptophan . '%</td></tr>';
 $Valin = calculate_micro_value($pm->{'Valin'}, $cur_weight * $ideal_values_for_meal['Valin'], $meal_portion, 0.1);
 $sum += $Valin;
 $html .= '<tr><td>' . @round($pm->{'Valin'}, 5) . '</td><td>' . $Valin . '%</td></tr>';
 // Add partial variance in total variance.
 $total_partial = 0;
 $partial_variance = 0;
 if (!empty($part_meals)) {
     if (array_key_exists($pm->id, $part_meals)) {
         $total_partial = $part_meals[$pm->id]->total_partial;
         $partial_variance = $total_partial * 4;
     }
 }
 if (!empty($part_nut_type_string) || !empty($part_tolarance_type_string)) {
     $sum = $sum + $partial_variance;
     $html .= '<tr><td>' . $total_partial . '</td><td>' . $partial_variance . '%</td></tr>';
 }
 //$Eisen = @round(abs($pm->{'Eisen [Fe]'} - $ideal_values_for_meal['Eisen [Fe]']) * 0.1, 5);
 $sum += $Eisen;
 $html .= '<tr><td>' . @round($pm->{'Eisen [Fe]'}, 4) . '</td><td>' . $Eisen . '%</td></tr>';
 $Fluor = calculate_micro_value($pm->{'Fluor [F]'}, $ideal_values_for_meal['Fluor [F]'], $meal_portion, 0.1);
 //$Fluor = @round(abs($pm->{'Fluor [F]'} - $ideal_values_for_meal['Fluor [F]']) * 0.1, 5);
 $sum += $Fluor;
 $html .= '<tr><td>' . @round($pm->{'Fluor [F]'}, 4) . '</td><td>' . $Fluor . '%</td></tr>';
 $Mangan = calculate_micro_value($pm->{'Mangan [Mn]'}, $ideal_values_for_meal['Mangan [Mn]'], $meal_portion, 0.1);
 //$Mangan = @round(abs($pm->{'Mangan [Mn]'} - $ideal_values_for_meal['Mangan [Mn]']) * 0.1, 5);
 $sum += $Mangan;
 $html .= '<tr><td>' . @round($pm->{'Mangan [Mn]'}, 4) . '</td><td>' . $Mangan . '%</td></tr>';
 $Jod = calculate_micro_value($pm->{'Jod [J]'}, $ideal_values_for_meal['Jod [J]'], $meal_portion, 0.1);
 //$Jod = @round(abs($pm->{'Jod [J]'} - $ideal_values_for_meal['Jod [J]']) * 0.1, 5);
 $sum += $Jod;
 $html .= '<tr><td>' . @round($pm->{'Jod [J]'}, 4) . '</td><td>' . $Jod . '%</td></tr>';
 $Zink = calculate_micro_value($pm->{'Zink [Zn]'}, $ideal_values_for_meal['Zink [Zn]'], $meal_portion, 0.1);
 //$Zink = @round(abs($pm->{'Zink [Zn]'} - $ideal_values_for_meal['Zink [Zn]']) * 0.1, 5);
 $sum += $Zink;
 $html .= '<tr><td>' . @round($pm->{'Zink [Zn]'}, 4) . '</td><td>' . $Zink . '%</td></tr>';
 $Cystein = @round(abs($pm->{'Cystein'} - $cur_weight * $ideal_values_for_meal['Cystein'] * $meal_portion) * 0.1, 5);
 $sum += $Cystein;
 $html .= '<tr><td>' . @round($pm->{'Cystein'}, 4) . '</td><td>' . $Cystein . '%</td></tr>';
 $Leucin = @round(abs($pm->{'Leucin'} - $cur_weight * $ideal_values_for_meal['Leucin'] * $meal_portion) * 0.1, 5);
 $sum += $Leucin;
 $html .= '<tr><td>' . @round($pm->{'Leucin'}, 4) . '</td><td>' . $Leucin . '%</td></tr>';
 $Lysin = @round(abs($pm->{'Lysin'} - $cur_weight * $ideal_values_for_meal['Lysin'] * $meal_portion) * 0.1, 5);
 $sum += $Lysin;
 $html .= '<tr><td>' . @round($pm->{'Lysin'}, 4) . '</td><td>' . $Lysin . '%</td></tr>';
 $Threonin = @round(abs($pm->{'Threonin'} - $cur_weight * $ideal_values_for_meal['Threonin'] * $meal_portion) * 0.1, 5);
 $sum += $Threonin;
 $html .= '<tr><td>' . @round($pm->{'Threonin'}, 4) . '</td><td>' . $Threonin . '%</td></tr>';