= 16){ $today = date('Ymd', $date_tomorrow); $today_s = date('Y/m/d', $date_tomorrow); }else{ $today = date("Ymd"); $today_s = date("Y/m/d"); } // テンプレート読み込み $template =& loadTemplate( $p ); for($s=1;$ssetCurrentBlock('__Set__'); $template->setVariable('set_nm',$line_arr[6]); //セット名 $template->setVariable('ttl_time',$line_arr[5]); //調理時間 $template->parseCurrentBlock(); $template->setCurrentBlock('__Cmt__'); $template->setVariable('cmt',$line_arr[4]); //コメント $template->parseCurrentBlock(); //******************************// // 画像パス取得処理 // //******************************// //お弁当画像パス取得 $img = sprintf("image/%sbb.jpg",$today); if(file_exists($img)){ $img_path = sprintf("",str_replace(KTY_SERVER_ROOT,"",$img)); $template->setCurrentBlock('__Image__'); $template->setVariable('image',$img_path); $template->parseCurrentBlock(); }else{ $template->hideBlock('__Image__'); } //******************************// // レシピ取得処理 // //******************************// //DB接続 $this->db = cs4_open(); //抽出条件設定 $where1 = sprintf(" rcp_no = %s and rcp_dlt = 0 ", $line_arr[1]); $where2 = sprintf(" rcp_no = %s and rcp_dlt = 0 ", $line_arr[2]); $where3 = sprintf(" rcp_no = %s and rcp_dlt = 0 ", $line_arr[3]); //抽出 $ret1=cs4_select($this->db,"bsc_r_new",$where1); $ret2=cs4_select($this->db,"bsc_r_new",$where2); $ret3=cs4_select($this->db,"bsc_r_new",$where3); while($row = cs4_fetch_row($ret1)) { $rcp_nm1 = $row['rcp_nm']; } while($row = cs4_fetch_row($ret2)) { $rcp_nm2 = $row['rcp_nm']; } while($row = cs4_fetch_row($ret3)) { $rcp_nm3 = $row['rcp_nm']; } $template->setCurrentBlock('__Recipe__'); $template->setVariable('r_no1',$line_arr[1]); $template->setVariable('r_nm1',$rcp_nm1); $template->setVariable('r_no2',$line_arr[2]); $template->setVariable('r_nm2',$rcp_nm2); $template->setVariable('r_no3',$line_arr[3]); $template->setVariable('r_nm3',$rcp_nm3); $template->parseCurrentBlock(); $template->show(); } } } bentou_top( $p ); ?>