ymd -> ".$ymd."
"; //print "prev -> ".$prev_ymd."
"; //var_dump($profile); //var_dump($prev_profile); $user_goal = get_UserGoal($p); $goal_val = $user_goal[0]['goal_weight']; $start_val = $user_goal[0]['start_weight']; // テンプレート読み込み $template =& loadTemplate( $p ); $interval = (empty($p['id'])) ? "1" : $p['id']; $template->setVariable('interval_id',$interval); $template->setVariable('arg_page',$p['page']); if(!empty($user_goal[0]['goal_weight'])){ $template->setCurrentBlock('__GoalWeight__'); $template->setVariable('goal_weight',$user_goal[0]['goal_weight']); $template->parseCurrentBlock(); $template->touchBlock('__GoalLegend__'); if(!empty($user_goal[0]['start_weight'])){ $template->touchBlock('__StartLegend__'); } } for($i=0;$isetCurrentBlock('__TodaysWeight__'); $template->setVariable('todays_weight',$profile[$i]['weight']); $template->parseCurrentBlock(); if(!empty($user_goal[0]['start_weight'])){ $diff = $profile[$i]['weight'] - $user_goal[0]['start_weight']; $diff = (0 < $diff) ? sprintf("+%s",$diff) : $diff; $template->setCurrentBlock('__FromStart__'); // $template->setVariable('from_start',$profile[$i]['weight'] - $user_goal[0]['start_weight']); $template->setVariable('from_start',$diff); $template->parseCurrentBlock(); } if(!empty($user_goal[0]['start_weight']) && !empty($user_goal[0]['goal_weight'])){ $template->setCurrentBlock('__RestWeight__'); $template->setVariable('rest_weight',$profile[$i]['weight'] - $user_goal[0]['goal_weight']); $template->parseCurrentBlock(); } break; } } //- 一ヶ月前の登録有無 $start_ymd = (empty($p['date'])) ? date("Ymd") : $p['date']; $end_ymd = (empty($p['date'])) ? date("Ymd",mktime( 0, 0, 0, date("n") - 1, date("j"), date("Y"))) : date("Ymd",mktime( 0, 0, 0, substr($p['date'],4,2) - 1, substr($p['date'],6,2), substr($p['date'],0,4))); if(get_UserProf($p ,$start_ymd ,$end_ymd)){ // $template->touchBlock('__Month__'); } /* //- 三ヶ月前の登録有無 $ymd = ""; $ymd = (empty($p['date'])) ? date("Ymd",mktime( 0, 0, 0, date("n") - 3, date("j"), date("Y"))) : date("Ymd",mktime( 0, 0, 0, substr($p['date'],4,2) - 3, substr($p['date'],6,2), substr($p['date'],0,4))); if(get_UserProf($p ,$ymd)){ $template->touchBlock('__3Month__'); } //- 六ヶ月前の登録有無 $ymd = ""; $ymd = (empty($p['date'])) ? date("Ymd",mktime( 0, 0, 0, date("n") - 6, date("j"), date("Y"))) : date("Ymd",mktime( 0, 0, 0, substr($p['date'],4,2) - 6, substr($p['date'],6,2), substr($p['date'],0,4))); if(get_UserProf($p ,$ymd)){ $template->touchBlock('__6Month__'); } //- 一年前の登録有無 $ymd = ""; $ymd = (empty($p['date'])) ? date("Ymd",mktime( 0, 0, 0, date("n"), date("j"), date("Y") - 1)) : date("Ymd",mktime( 0, 0, 0, substr($p['date'],4,2), substr($p['date'],6,2), substr($p['date'],0,4) - 1)); if(get_UserProf($p ,$ymd)){ $template->touchBlock('__Year__'); } */ if(1 < $p['page']){ $template->setCurrentBlock('__PageNext__'); $template->setVariable('page_next',($p['page'] - 1)); $template->parseCurrentBlock(); } if(0 < count($prev_profile)){ $template->setCurrentBlock('__PagePrev__'); $template->setVariable('page_prev',($p['page'] + 1)); $template->parseCurrentBlock(); } $template->show(); } nb_prof_graph( $p ); ?>