sprintf("%d",$p['weight_int']) || 9 < sprintf("%d",$p['weight_flow'])){ require_once('template/error.html'); exit; } }else{ require_once('template/error.html'); exit; } //- 日付入力チェック if($p['date'] = date("Ymd",mktime(0,0,0,$p['month'],$p['date'],$p['year']))){ // require_once('template/error.html'); // exit; } function nb_input_prof2( $p ) { $type_arr = get_MealType(); $exercise_arr = get_ExerciseList(); if($profile = get_UserProf($p , date("Ymd"))){ $p['height'] = $profile[0]['height']; if(!empty($p['height'])){ $p['height_int'] = 0; $p['height_flow'] = 0; $arr_height = explode(".",$p['height']); $p['height_int'] = (is_numeric($arr_height[0])) ? $arr_height[0] : "0" ; $p['height_flow'] = (is_numeric($arr_height[1])) ? $arr_height[1] : "0" ; } $p['age'] = $profile[0]['age_code']; $p['sex'] = $profile[0]['sex_code']; $p['exercise'] = $profile[0]['exercise_code']; } // テンプレート読み込み $template =& loadTemplate( $p ); //- 身長 if(!empty($p['height']) && is_numeric($p['height']) && 300 > $p['height']){ if(is_numeric($p['height_int'])){ $template->setVariable('height_int_val',$p['height_int']); } if(is_numeric($p['height_flow'])){ $template->setVariable(sprintf('height_flow_selected_%d',$p['height_flow']),"selected"); } } //- 年齢 if(!empty($p['age']) && is_numeric($p['age'])){ $place_name = sprintf("selected_%d",$p['age']); $template->setVariable($place_name , 'selected'); } //- 性別 if(!is_null($p['sex'])){ $place_name = sprintf("selected_sex_%d",$p['sex']); $template->setVariable($place_name , 'selected'); } //- 運動量 //- 無料版に合わせて変更 if(!empty($p['exercise']) && is_numeric($p['exercise'])){ $template->setVariable(sprintf('exec_chk_%d',$p['exercise']),'checked'); }else{ $template->setVariable('exec_chk_1','checked'); } /* foreach($exercise_arr as $key => $val){ //- 無料ユーザ用ID=5を除外する mod by Aida 06/02/14 if(5 > $val['exercise_id']){ $template->setCurrentBlock('__Exercise__'); $template->setVariable('exercise_val',$val['exercise_id']); $template->setVariable('exercise',$val['exercise_name']); if(!empty($p['exercise']) && is_numeric($p['exercise']) && $val['exercise_id'] == $p['exercise']){ $template->setVariable('selected' , 'selected'); } $template->parseCurrentBlock(); } } */ $template->setVariable('weight_int_val',$p['weight_int']); $template->setVariable('weight_flow_val',$p['weight_flow']); $template->setVariable('date_val',$p['date']); $template->show(); } nb_input_prof2( $p ); ?>