$val){ $template->setCurrentBlock('__Genre__'); $template->setVariable('genre_val',$val['r_menu_no']); $template->setVariable('genre',$val['r_menu_nm']); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- 素材 foreach($ing_genre_arr as $key => $val){ $template->setCurrentBlock('__IngGenre__'); $template->setVariable('ing_genre_val',$key); $template->setVariable('ing_genre',$val); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- 調理法 foreach($cook_arr as $key => $val){ $template->setCurrentBlock('__Cook__'); $template->setVariable('cook_val',$val['r_cook_mtd_no']); $template->setVariable('cook',$val['r_cook_mtd_nm']); /* if($d == date("j")){ $template->setVariable('selected','selected'); } */ $template->parseCurrentBlock(); } //- 調理種類 foreach($kind_arr as $key => $val){ $template->setCurrentBlock('__Kind__'); $template->setVariable('kind_val',$val['r_knd_no']); $template->setVariable('kind',$val['r_knd_nm']); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- カロリー foreach($cal_arr as $key => $val){ $template->setCurrentBlock('__Calorie__'); $template->setVariable('cal_val',$key); $template->setVariable('cal',$val); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- オリジナルレシピジャンル foreach($nb_genre_arr as $key => $val){ $template->setCurrentBlock('__OrgGenre__'); $template->setVariable('org_genre_val',$val['nb_genre_id']); $template->setVariable('org_genre',$val['nb_genre_name']); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- オリジナルレシピ種類 foreach($nb_kind_arr as $key => $val){ $template->setCurrentBlock('__OrgKind__'); $template->setVariable('org_kind_val',$val['nb_kind_id']); $template->setVariable('org_kind',$val['nb_kind_name']); // $template->setVariable('selected','selected'); $template->parseCurrentBlock(); } //- オススメレシピリスト if( 0 < $rest ){ $recommend_list = get_RecommendRecipe($rest); srand((double)microtime() * 1000000); $random_idx = range( 0 , (count($recommend_list) - 1)); shuffle($random_idx); for($i=0;$i<=5;$i++){ $template->setCurrentBlock('__RecipeList__'); $template->setVariable('rcp_id',$recommend_list[$random_idx[$i]]['rcp_no']); $template->setVariable('eat_ymd_val',$now_date); $template->setVariable('recipe_title',$recommend_list[$random_idx[$i]]['rcp_nm']); $template->parseCurrentBlock(); } //- おすすめブロック $template->TouchBlock('__Recommend__'); } if("ks" == $p['mode']){ $this->db = cs4_open(); $sweets_genre = get_SweetsGenre($this->db); cs4_close($this->db); for($i=0;$isetCurrentBlock('__GenreList__'); $template->setVariable('gnr_id',substr($sweets_genre[$i]['r_gnr_no'],1,1)); $template->setVariable('title',$sweets_genre[$i]['r_gnr_nm']); $template->parseCurrentBlock(); } $template->setCurrentBlock('__KS__'); $template->setVariable('date_mix_val',$input_ymd); $template->setVariable('type_mix_val',$p['type']); $template->setVariable('date_word_val',$input_ymd); $template->setVariable('type_word_val',$p['type']); $template->setVariable('date_sweets_val',$input_ymd); $template->setVariable('type_sweets_val',$p['type']); $template->parseCurrentBlock(); $template->hideBlock('__Other__'); }elseif("other" == $p['mode']){ $template->hideBlock('__KS__'); $template->setCurrentBlock('__Other__'); $template->setVariable('eat_date_val',$input_ymd); $template->setVariable('type_val',$p['type']); $template->setVariable('eat_date_val2',$input_ymd); $template->setVariable('type_val2',$p['type']); $template->parseCurrentBlock(); } $template->setVariable('contents_name',NOTEBOOK_NAME); $template->show(); } nb_input_search( $p ); ?>