', $week, ' | ', sprintf('%01.1f', $weight), ' | ';
echo sprintf('%01.1f', $weight / (HEIGHT * HEIGHT), 1), ' | ';
if ($last == 0) {
echo '-';
} else {
if ($weight - $last > 0) {
echo '';
}
echo sprintf('%01.1f', $weight - $last);
}
echo ' | ';
if ($last == 0) {
echo '-';
} else {
if ($weight - $last > 0) {
echo '';
}
echo sprintf('%01.1f', 0.157473044 * ($weight - $last));
}
echo ' | ', sprintf('%01.1f', $weight - $first), ' | ';
echo '', sprintf('%01.1f', 0.157473044 * ($weight - $first)), ' |
';
}
}
$last = $weight;
}
$a1 = array_sum($diffs) / count($diffs);
$a2 = array_sum(array_slice($diffs, -4)) / 4;
$a3 = array_pop($diffs);
$bmi = $last / (HEIGHT * HEIGHT);
$target = 5 * floor($bmi/5);
$target2 = $target - 5;
$targs = array($target, $target2);
$tweeks = array();
foreach ($targets as $targ) {
list($tweek, $tbmi) = $targ;
if ($bmi > $tbmi && $tweek > $week) {
$tweeks[$tbmi] = $tweek;
$targs[] = $tbmi;
}
}
rsort($targs);
$target = array_shift($targs);
$target2 = array_shift($targs);
$b35 = $target * HEIGHT * HEIGHT - $last;
$b30 = ($target2) * HEIGHT * HEIGHT - $last;
$target_s = $target . ' (' . round($target * HEIGHT * HEIGHT, 1) . ')';
$target2_s = $target2 . ' (' . round($target2 * HEIGHT * HEIGHT, 1) . ')';
?>