$p['weight']){ if(is_numeric($p['weight_int'])){ $template->setVariable('weight_int_val',$p['weight_int']); } if(is_numeric($p['weight_flow'])){ $template->setVariable(sprintf('weight_flow_selected_%d',$p['weight_flow']),"selected"); } } //- 年 if(2005 < date("Y")){ if(!empty($p['year']) && $p['year'] < (date("Y") - 1)){ $start = $p['year']; }else{ $start = date("Y") - 1; } for($y = $start;$y<=date("Y");$y++){ $template->setCurrentBlock('__Year__'); $template->setVariable('year_val',$y); $template->setVariable('year',$y); if($y == date("Y")){ $template->setVariable('selected','selected'); } $template->parseCurrentBlock(); } }else{ $template->setCurrentBlock('__Year__'); $template->setVariable('year_val',date("Y")); $template->setVariable('year',date("Y")); $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- 月 for($m=1;$m<=12;$m++){ $template->setCurrentBlock('__Month__'); $template->setVariable('month_val',$m); $template->setVariable('month',$m); if(empty($p['month'])){ if($m == date("n")){ $template->setVariable('selected','selected'); } }else{ if($m == sprintf("%d",$p['month'])){ $template->setVariable('selected','selected'); } } $template->parseCurrentBlock(); } //- 日 for($d=1;$d<=31;$d++){ $template->setCurrentBlock('__Date__'); $template->setVariable('date_val',$d); $template->setVariable('date',$d); if(empty($p['date'])){ if($d == date("j")){ $template->setVariable('selected','selected'); } }else{ if($d == sprintf("%d",$p['date'])){ $template->setVariable('selected','selected'); } } $template->parseCurrentBlock(); } $template->show(); } nb_input_prof1( $p ); ?>