sprintf("%0.1f",$p['weight'])){ require_once('template/error.html'); exit; } //- 身長入力値チェック if(!is_numeric($p['height_int'])){ require_once('template/error.html'); exit; }else{ $p['height'] = sprintf("%d.%d",$p['height_int'],$p['height_flow']); } if(250 < sprintf("%0.1f",$p['height']) || 50 > sprintf("%0.1f",$p['height'])){ require_once('template/error.html'); exit; } //- BMI値取得 $bmi_value = get_Bmi($p); //- 適正カロリー取得 $best_calorie = get_NecessaryCalorie($p); // テンプレート読み込み $template =& loadTemplate( $p ); if($bmi_value <= 18.5){ $template->touchBlock('__Condition_3__'); $template->hideBlock('__Condition_1__'); $template->hideBlock('__Condition_2__'); } if($bmi_value > 18.5 && $bmi_value < 25){ $template->touchBlock('__Condition_2__'); $template->hideBlock('__Condition_1__'); $template->hideBlock('__Condition_3__'); } if($bmi_value >= 25){ $template->touchBlock('__Condition_1__'); $template->hideBlock('__Condition_2__'); $template->hideBlock('__Condition_3__'); } $template->setVariable('best_calorie',$best_calorie); $template->setVariable('bmi_value',$bmi_value); $template->show(); } nb_free_profile( $p ); ?>