sprintf("%0.1f",$p['weight'])){ require_once('template/error.html'); exit; } */ function nb_input_goal( $p ) { if($user_goal = get_UserGoal($p)){ if(empty($p['goal_weight_int']) && !empty($user_goal[0]['goal_weight'])){ $db_goal = explode(".",$user_goal[0]['goal_weight']); $p['goal_weight_int'] = $db_goal[0]; $p['goal_weight_flow'] = $db_goal[1]; } if(empty($p['start_weight_int']) && !empty($user_goal[0]['start_weight'])){ $db_start = explode(".",$user_goal[0]['start_weight']); $p['start_weight_int'] = $db_start[0]; $p['start_weight_flow'] = $db_start[1]; } } // テンプレート読み込み $template =& loadTemplate( $p ); //- 目標体重(整数部分) if(!empty($p['goal_weight_int']) && is_numeric($p['goal_weight_int']) && 300 > $p['goal_weight_int']){ $template->setVariable('goal_weight_int_val',$p['goal_weight_int']); } //- 目標体重(小数部分) if(!empty($p['goal_weight_flow']) && is_numeric($p['goal_weight_flow'])){ $place_name = sprintf("goal_selected_%d",$p['goal_weight_flow']); $template->setVariable($place_name , 'selected'); } //- スタート体重(整数部分) if(!empty($p['start_weight_int']) && is_numeric($p['start_weight_int']) && 300 > $p['start_weight_int']){ $template->setVariable('start_weight_int_val',$p['start_weight_int']); } //- スタート体重(小数部分) if(!empty($p['start_weight_flow']) && is_numeric($p['start_weight_flow'])){ $place_name = sprintf("start_selected_%d",$p['start_weight_flow']); $template->setVariable($place_name , 'selected'); } $template->show(); } nb_input_goal( $p ); ?>