/* ********************************************************************************* * システム:katsuyo.net * *===============================================================================* * クラス:index |モジュール:index.php * * 概要 :週間iガイド レシピ表示画面 * * パス :APP_HOME/special/ * * 作成 :2006/07/21 J.Nikaido * *-------------------------------------------------------------------------------* * 更新 : * ********************************************************************************* */ require_once('../prepare.php'); function index($p){ // テンプレート読み込み $template =& loadTemplate( $p ); //本日日付取得 $date = date('Ymd H:i:s'); //公開期間外の場合 if(strtotime($date) < strtotime('20061016 00:00:00') || strtotime($date) > strtotime('20061130 23:59:59')){ $str = ""; $next_str = ""; $rcp_no = ""; $rcp_nm = ""; }else{ //公開期間:10/16〜10/31の場合 if(strtotime($date) >= strtotime('20061016 00:00:00') && strtotime($date) <= strtotime('20061031 23:59:59')){ $str = "10月16日更新"; $next_str = "次回更新は11/1!お楽しみに!"; $rcp_no = '8288'; } //公開期間:11/01〜11/14の場合 if(strtotime($date) >= strtotime('20061101 00:00:00') && strtotime($date) <= strtotime('20061114 23:59:59')){ $str = "11月1日更新"; $next_str = "次回更新は11/15!お楽しみに!"; $rcp_no = '9294'; } //公開期間:11/15〜11/28の場合 if(strtotime($date) >= strtotime('20061115 00:00:00') && strtotime($date) <= strtotime('20061128 23:59:59')){ $str = "11月15日更新"; $next_str = "次回更新は11/29!お楽しみに!"; $rcp_no = '9291'; } //公開期間:11/29〜11/30の場合 if(strtotime($date) >= strtotime('20061129 00:00:00') && strtotime($date) <= strtotime('20061130 23:59:59')){ $str = "11月29日更新"; $next_str = ""; $rcp_no = '8421'; } //DB接続 $db = DB::connect(constant('KTY_DSN')); if(DB::isError($db)){ echo "DB接続エラー:".DB::errorMessage($db)."\n"; exit; } //レシピ情報取得 $where = sprintf("rcp_no = %d and rcp_dlt = 0 ",$rcp_no); $sql = "select rcp_no, rcp_nm"; $sql .= sprintf(" from contents_data_bsc_r_new where %s",$where); $res = $db->query($sql); if(DB::isError($res)){ //echo "
クエリの送信が失敗しました。
"; echo "該当のレシピが見つかりません。
"; exit; } //件数取得 $non_num = $res->numRows(); if($non_num > 0){ while($row = $res->fetchRow(DB_FETCHMODE_ASSOC)){ $rcp_no = $row['rcp_no']; $rcp_nm = $row['rcp_nm']; } } } $template->setCurrentBlock('__iguide__'); $template->setVariable('str',$str); $template->setVariable('next_str',$next_str); $template->setVariable('rcp_no',$rcp_no); $template->setVariable('rcp_nm',$rcp_nm); $template->parseCurrentBlock(); $template->show(); //DB開放 $db->disconnect(); } index($p); ?>