source: temp/trunk/html/rss/product.php @ 6547

Revision 6547, 4.0 KB checked in by kakinaka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8//¶¦ÄÌÉôÉÊ¤ÎÆÉ¤ß¹þ¤ß
9require_once("../require.php");
10
11class 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
27if($product_id != ""){
28    //¾¦Éʾܺ٤ò¼èÆÀ
29    $arrProduct = lfGetProductsDetail($objQuery, $product_id);
30   
31    // ÃͤΥ»¥Ã¥È¤·Ä¾¤·
32    foreach($arrProduct as $key => $val){
33       
34        // ²èÁü¥Õ¥¡¥¤¥ë¤ÎURL¥»¥Ã¥È
35        (file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_list_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
36        $arrProduct[$key]["main_list_image"] = $dir . $arrProduct[$key]["main_list_image"];
37        (file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
38        $arrProduct[$key]["main_image"] = $dir . $arrProduct[$key]["main_image"];
39        (file_exists(IMAGE_SAVE_DIR . $arrProduct[$key]["main_large_image"])) ? $dir = IMAGE_SAVE_URL_RSS : $dir = IMAGE_TEMP_URL_RSS;
40        $arrProduct[$key]["main_large_image"] = $dir . $arrProduct[$key]["main_large_image"];
41       
42        // ¥Ý¥¤¥ó¥È·×»»
43        $arrProduct[$key]["point"] = sfPrePoint($arrProduct[$key]["price02"], $arrProduct[$key]["point_rate"], POINT_RULE, $arrProduct[$key]["product_id"]);
44    }
45}else{
46    //¾¦ÉʰìÍ÷¤ò¼èÆÀ
47    $arrProduct = $objQuery->getall("SELECT product_id, name AS product_name FROM dtb_products");
48}
49
50//ŹÊÞ¾ðÊó¤ò¥»¥Ã¥È
51$objPage->arrSiteInfo = $objSiteInfo->data;
52
53//¾¦ÉʾðÊó¤ò¥»¥Ã¥È
54$objPage->arrProduct = $arrProduct;
55$objPage->arrProductKeys = array_keys(sfswaparray($arrProduct));
56
57//¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ
58$objView->assignobj($objPage);
59
60//¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤(ǰ¤Î¤¿¤á)
61header("Paragrama: no-cache");
62
63//XML¥Æ¥­¥¹¥È(¤³¤ì¤¬¤Ê¤¤¤ÈÀµ¾ï¤ËRSS¤È¤·¤ÆÇ§¼±¤·¤Æ¤¯¤ì¤Ê¤¤¥Ä¡¼¥ë¤¬¤¢¤ë¤¿¤á)
64header("Content-type: application/xml");
65DETAIL_P_HTML;
66
67//²èÌÌɽ¼¨
68$objView->display($objPage->tpl_mainpage, true);
69
70//---------------------------------------------------------------------------------------------------------------------
71/**************************************************************************************************************
72 * ´Ø¿ô̾:lfGetProducts
73 * ÀâÌÀ¡¡:¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë
74 * °ú¿ô£±:$objQuery     DBÁàºî¥¯¥é¥¹
75 * °ú¿ô£²:$product_id   ¾¦ÉÊID
76 * Ìá¤êÃÍ:$arrProduct   ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹
77 **************************************************************************************************************/
78function lfGetProductsDetail($objQuery, $product_id){
79    $sql = "";
80    $sql .= "SELECT ";
81    $sql .= "   prod.product_id ";
82    $sql .= "   ,prod.name AS product_name ";
83    $sql .= "   ,prod.category_id ";
84    $sql .= "   ,prod.point_rate ";
85    $sql .= "   ,prod.comment3 ";
86    $sql .= "   ,prod.main_list_comment ";
87    $sql .= "   ,prod.main_list_image ";
88    $sql .= "   ,prod.main_comment ";
89    $sql .= "   ,prod.main_image ";
90    $sql .= "   ,prod.main_large_image ";
91    $sql .= "   ,cls.price01 ";
92    $sql .= "   ,cls.price02 ";
93    $sql .= "   ,cls.classcategory_id1 ";
94    $sql .= "   ,cls.classcategory_id2 ";
95    $sql .= "   ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id1) AS classcategory_name1 ";
96    $sql .= "   ,(SELECT name FROM dtb_classcategory AS clscat WHERE clscat.classcategory_id = cls.classcategory_id2) AS classcategory_name2 ";
97    $sql .= "   ,(SELECT category_name FROM dtb_category AS cat WHERE cat.category_id = prod.category_id) AS category_name";
98    $sql .= " FROM dtb_products AS prod, dtb_products_class AS cls";
99    $sql .= " WHERE prod.product_id = cls.product_id AND prod.del_flg = 0 AND prod.status = 1";
100   
101    if($product_id != "ALL"){
102        $sql .= " AND prod.product_id = ?";
103        $arrval = array($product_id);
104    }
105    $sql .= " ORDER BY prod.product_id, cls.classcategory_id1, cls.classcategory_id2";
106    $arrProduct = $objQuery->getall($sql, $arrval);
107    return $arrProduct;
108}
109
110?>
Note: See TracBrowser for help on using the repository browser.