| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 4 | * |
|---|
| 5 | * http://www.lockon.co.jp/ |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | //¶¦ÄÌÉôÉÊ¤ÎÆÉ¤ß¹þ¤ß |
|---|
| 9 | require_once("../require.php"); |
|---|
| 10 | |
|---|
| 11 | class LC_Page{ |
|---|
| 12 | function LC_Page(){ |
|---|
| 13 | $this->tpl_mainpage = "rss/product.tpl"; |
|---|
| 14 | $this->encode = "UTF-8"; |
|---|
| 15 | ($_GET['product_id'] == "") ? $this->title = "¾¦ÉʰìÍ÷¾ðÊó" : $this->title = "¾¦ÉʾܺپðÊó"; |
|---|
| 16 | } |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | $objQuery = new SC_Query(); |
|---|
| 20 | $objPage = new LC_Page(); |
|---|
| 21 | $objView = new SC_SiteView(); |
|---|
| 22 | $objSiteInfo = new SC_SiteInfo(); |
|---|
| 23 | |
|---|
| 24 | //¾¦ÉÊID¤ò¼èÆÀ |
|---|
| 25 | $product_id = $_GET['product_id']; |
|---|
| 26 | |
|---|
| 27 | if($product_id != ""){ |
|---|
| 28 | //¾¦Éʾܺ٤ò¼èÆÀ |
|---|
| 29 | $arrProduct = lfGetProductsDetail($objQuery, $product_id); |
|---|
| 30 | }else{ |
|---|
| 31 | //¾¦ÉʰìÍ÷¤ò¼èÆÀ |
|---|
| 32 | $arrProduct = $objQuery->getall("SELECT product_id, name AS product_name FROM dtb_products"); |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | //ŹÊÞ¾ðÊó¤ò¥»¥Ã¥È |
|---|
| 36 | $objPage->arrSiteInfo = $objSiteInfo->data; |
|---|
| 37 | |
|---|
| 38 | //¾¦ÉʾðÊó¤ò¥»¥Ã¥È |
|---|
| 39 | $objPage->arrProduct = $arrProduct; |
|---|
| 40 | $objPage->arrProductKeys = array_keys(sfswaparray($arrProduct)); |
|---|
| 41 | |
|---|
| 42 | //¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ |
|---|
| 43 | $objView->assignobj($objPage); |
|---|
| 44 | |
|---|
| 45 | //¥¥ã¥Ã¥·¥å¤·¤Ê¤¤(ǰ¤Î¤¿¤á) |
|---|
| 46 | header("Paragrama: no-cache"); |
|---|
| 47 | |
|---|
| 48 | //XML¥Æ¥¥¹¥È(¤³¤ì¤¬¤Ê¤¤¤ÈÀµ¾ï¤ËRSS¤È¤·¤ÆÇ§¼±¤·¤Æ¤¯¤ì¤Ê¤¤¥Ä¡¼¥ë¤¬¤¢¤ë¤¿¤á) |
|---|
| 49 | header("Content-type: application/xml"); |
|---|
| 50 | |
|---|
| 51 | //²èÌÌɽ¼¨ |
|---|
| 52 | $objView->display($objPage->tpl_mainpage, true); |
|---|
| 53 | |
|---|
| 54 | //--------------------------------------------------------------------------------------------------------------------- |
|---|
| 55 | /************************************************************************************************************** |
|---|
| 56 | * ´Ø¿ô̾:lfGetProducts |
|---|
| 57 | * ÀâÌÀ¡¡:¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë |
|---|
| 58 | * °ú¿ô£±:$objQuery DBÁàºî¥¯¥é¥¹ |
|---|
| 59 | * °ú¿ô£²:$product_id ¾¦ÉÊID |
|---|
| 60 | * Ìá¤êÃÍ:$arrProduct ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹ |
|---|
| 61 | **************************************************************************************************************/ |
|---|
| 62 | function lfGetProductsDetail($objQuery, $product_id){ |
|---|
| 63 | $sql = ""; |
|---|
| 64 | $sql .= "SELECT |
|---|
| 65 | prod.product_id |
|---|
| 66 | ,prod.name AS product_name |
|---|
| 67 | ,prod.category_id |
|---|
| 68 | ,prod.point_rate |
|---|
| 69 | ,prod.comment3 |
|---|
| 70 | ,prod.main_list_comment |
|---|
| 71 | ,prod.main_list_image |
|---|
| 72 | ,prod.main_comment |
|---|
| 73 | ,prod.main_image |
|---|
| 74 | ,prod.main_large_image |
|---|
| 75 | ,cls.price01 |
|---|
| 76 | ,cls.price02 |
|---|
| 77 | ,cls.classcategory_id1 |
|---|
| 78 | ,cls.classcategory_id2 |
|---|
| 79 | ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id1) AS classcategory_name1 |
|---|
| 80 | ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id2) AS classcategory_name2 |
|---|
| 81 | ,(SELECT category_name FROM dtb_category AS cat WHERE cat.category_id = prod.category_id) AS category_name |
|---|
| 82 | FROM dtb_products AS prod, dtb_products_class AS cls |
|---|
| 83 | WHERE prod.product_id = cls.product_id AND prod.del_flg = 0 AND prod.status = 1 AND prod.product_id = ? |
|---|
| 84 | ORDER BY prod.product_id, cls.classcategory_id1, cls.classcategory_id2 |
|---|
| 85 | "; |
|---|
| 86 | $arrProduct = $objQuery->getall($sql, array($product_id)); |
|---|
| 87 | return $arrProduct; |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | ?> |
|---|