Changeset 11729 for branches/comu/html/rss/product.php
- Timestamp:
- 2007/03/10 21:35:02 (19 years ago)
- File:
-
- 1 edited
-
branches/comu/html/rss/product.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/comu/html/rss/product.php
r15 r11729 6 6 */ 7 7 8 // ¶¦ÄÌÉôÉÊ¤ÎÆÉ¤ß¹þ¤ß8 //共通部品の読み込み 9 9 require_once("../require.php"); 10 10 … … 13 13 $this->tpl_mainpage = "rss/product.tpl"; 14 14 $this->encode = "UTF-8"; 15 $this->title = " ¾¦ÉʰìÍ÷¾ðÊó";15 $this->title = "商品一覧情報"; 16 16 } 17 17 } … … 22 22 $objSiteInfo = new SC_SiteInfo(); 23 23 24 // ŹÊÞ¾ðÊó¤ò¥»¥Ã¥È24 //店舗情報をセット 25 25 $arrSiteInfo = $objSiteInfo->data; 26 26 27 // ¾¦ÉÊID¤ò¼èÆÀ27 //商品IDを取得 28 28 $product_id = $_GET['product_id']; 29 29 $mode = $_GET['mode']; 30 30 31 31 if(($product_id != "" and is_numeric($product_id)) or $mode == "all"){ 32 // ¾¦Éʾܺ٤ò¼èÆÀ32 //商品詳細を取得 33 33 ($mode == "all") ? $arrProduct = lfGetProductsDetail($objQuery, $mode) : $arrProduct = lfGetProductsDetail($objQuery, $product_id); 34 34 35 // ÃͤΥ»¥Ã¥È¤·Ä¾¤·35 // 値のセットし直し 36 36 foreach($arrProduct as $key => $val){ 37 // ¾¦ÉʲÁ³Ê¤òÀǹþ¤ß¤ËÊÔ½¸37 //商品価格を税込みに編集 38 38 $arrProduct[$key]["price02"] = sfPreTax($arrProduct[$key]["price02"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]); 39 39 40 // ²èÁü¥Õ¥¡¥¤¥ë¤ÎURL¥»¥Ã¥È40 // 画像ファイルのURLセット 41 41 (file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS; 42 42 $arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"]; … … 46 46 $arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"]; 47 47 48 // ¥Ý¥¤¥ó¥È·×»»48 // ポイント計算 49 49 $arrProduct[$key]["point"] = sfPrePoint($arrProduct[$key]["price02"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]); 50 50 } 51 51 }elseif($mode == "list"){ 52 // ¾¦ÉʰìÍ÷¤ò¼èÆÀ52 //商品一覧を取得 53 53 $arrProduct = $objQuery->getall("SELECT product_id, name AS product_name FROM dtb_products"); 54 54 }else{ 55 55 $arrProduct = lfGetProductsAllclass($objQuery); 56 56 57 // ÃͤΥ»¥Ã¥È¤·Ä¾¤·57 // 値のセットし直し 58 58 foreach($arrProduct as $key => $val){ 59 // ¾¦ÉʲÁ³Ê¤òÀǹþ¤ß¤ËÊÔ½¸59 //商品価格を税込みに編集 60 60 $arrProduct[$key]["price01_max"] = sfPreTax($arrProduct[$key]["price01_max"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]); 61 61 $arrProduct[$key]["price01_min"] = sfPreTax($arrProduct[$key]["price01_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]); … … 63 63 $arrProduct[$key]["price02_min"] = sfPreTax($arrProduct[$key]["price02_min"], $arrSiteInfo["tax"], $arrSiteInfo["tax_rule"]); 64 64 65 // ²èÁü¥Õ¥¡¥¤¥ë¤ÎURL¥»¥Ã¥È65 // 画像ファイルのURLセット 66 66 (file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS; 67 67 $arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"]; … … 71 71 $arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"]; 72 72 73 // ¥Ý¥¤¥ó¥È·×»»73 // ポイント計算 74 74 $arrProduct[$key]["point_max"] = sfPrePoint($arrProduct[$key]["price02_max"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]); 75 75 $arrProduct[$key]["point_min"] = sfPrePoint($arrProduct[$key]["price02_min"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]); … … 77 77 } 78 78 79 // ¾¦ÉʾðÊó¤ò¥»¥Ã¥È79 //商品情報をセット 80 80 $objPage->arrProduct = $arrProduct; 81 81 if(is_array(sfswaparray($arrProduct))){ … … 83 83 } 84 84 85 // ŹÊÞ¾ðÊó¤ò¥»¥Ã¥È85 //店舗情報をセット 86 86 $objPage->arrSiteInfo = $arrSiteInfo; 87 87 88 // ¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ88 //セットしたデータをテンプレートファイルに出力 89 89 $objView->assignobj($objPage); 90 90 91 // ¥¥ã¥Ã¥·¥å¤·¤Ê¤¤(ǰ¤Î¤¿¤á)91 //キャッシュしない(念のため) 92 92 header("Paragrama: no-cache"); 93 93 94 //XML ¥Æ¥¥¹¥È(¤³¤ì¤¬¤Ê¤¤¤ÈÀµ¾ï¤ËRSS¤È¤·¤ÆÇ§¼±¤·¤Æ¤¯¤ì¤Ê¤¤¥Ä¡¼¥ë¤¬¤¢¤ë¤¿¤á)94 //XMLテキスト(これがないと正常にRSSとして認識してくれないツールがあるため) 95 95 header("Content-type: application/xml"); 96 96 DETAIL_P_HTML; 97 97 98 // ²èÌÌɽ¼¨98 //画面表示 99 99 $objView->display($objPage->tpl_mainpage, true); 100 100 101 101 //--------------------------------------------------------------------------------------------------------------------- 102 102 /************************************************************************************************************** 103 * ´Ø¿ô̾:lfGetProducts104 * ÀâÌÀ¡¡:¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë105 * °ú¿ô£±:$objQuery DBÁàºî¥¯¥é¥¹106 * °ú¿ô£²:$product_id ¾¦ÉÊID107 * Ìá¤êÃÍ:$arrProduct ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹103 * 関数名:lfGetProducts 104 * 説明 :商品情報を取得する 105 * 引数1:$objQuery DB操作クラス 106 * 引数2:$product_id 商品ID 107 * 戻り値:$arrProduct 取得結果を配列で返す 108 108 **************************************************************************************************************/ 109 109 function lfGetProductsDetail($objQuery, $product_id = "all"){ … … 141 141 142 142 /************************************************************************************************************** 143 * ´Ø¿ô̾:lfGetProductsAllclass144 * ÀâÌÀ¡¡:¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë(vw_products_allclass»ÈÍÑ)145 * °ú¿ô£±:$objQuery DBÁàºî¥¯¥é¥¹146 * Ìá¤êÃÍ:$arrProduct ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹143 * 関数名:lfGetProductsAllclass 144 * 説明 :商品情報を取得する(vw_products_allclass使用) 145 * 引数1:$objQuery DB操作クラス 146 * 戻り値:$arrProduct 取得結果を配列で返す 147 147 **************************************************************************************************************/ 148 148 function lfGetProductsAllclass($objQuery){
Note: See TracChangeset
for help on using the changeset viewer.
