source: branches/dev/html/products/detail.php @ 11959

Revision 11959, 14.4 KB checked in by inoue, 20 years ago (diff)

トラックバックのフロント部分

Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9require_once(DATA_PATH . "include/page_layout.inc");
10
11class LC_Page {
12    function LC_Page() {
13        /** ɬ¤º»ØÄꤹ¤ë **/
14        global $arrSTATUS;
15        $this->arrSTATUS = $arrSTATUS;
16        global $arrSTATUS_IMAGE;
17        $this->arrSTATUS_IMAGE = $arrSTATUS_IMAGE;
18        global $arrDELIVERYDATE;
19        $this->arrDELIVERYDATE = $arrDELIVERYDATE;
20        global $arrRECOMMEND;
21        $this->arrRECOMMEND = $arrRECOMMEND;
22       
23        //$this->tpl_mainpage="products/detail.tpl";
24       
25        /*
26         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
27         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
28         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
29        */
30        session_cache_limiter('private-no-expire');
31    }
32}
33
34$objPage = new LC_Page();
35$objView = new SC_SiteView();
36$objCustomer = new SC_Customer();
37$objQuery = new SC_Query();
38
39// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
40$objPage = sfGetPageLayout($objPage, false, "products/detail.php");
41
42// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
43$objFormParam = new SC_FormParam();
44// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
45lfInitParam();
46// POSTÃͤμèÆÀ
47$objFormParam->setParam($_POST);
48
49// ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹
50$objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
51// ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½
52lfInitFile();
53
54// ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£
55if($_GET['admin'] == 'on') {
56    $where = "del_flg = 0";
57} else {
58    $where = "del_flg = 0 AND status = 1";
59}
60
61if($_POST['mode'] != "") {
62    $tmp_id = $_POST['product_id'];
63} else {
64    $tmp_id = $_GET['product_id'];
65}
66
67// ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯
68if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) {
69    sfDispSiteError(PRODUCT_NOT_FOUND);
70}
71// ¥í¥°¥¤¥óȽÄê
72if($objCustomer->isLoginSuccess()) {
73    //¤ªµ¤¤ËÆþ¤ê¥Ü¥¿¥óɽ¼¨
74    $objPage->tpl_login = true;
75
76/* ±ÜÍ÷¥í¥°µ¡Ç½¤Ï¸½ºß̤»ÈÍÑ
77   
78    $table = "dtb_customer_reading";
79    $where = "customer_id = ? ";
80    $arrval[] = $objCustomer->getValue('customer_id');
81    //¸ÜµÒ¤Î±ÜÍ÷¾¦ÉÊ¿ô
82    $rpcnt = $objQuery->count($table, $where, $arrval);
83
84    //±ÜÍ÷¿ô¤¬ÀßÄê¿ô°Ê²¼
85    if ($rpcnt < CUSTOMER_READING_MAX){
86        //±ÜÍ÷ÍúÎò¤Ë¿·µ¬ÄɲÃ
87        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
88    } else {
89        //±ÜÍ÷ÍúÎò¤ÎÃæ¤Ç°ìÈָŤ¤¤â¤Î¤òºï½ü¤·¤Æ¿·µ¬ÄɲÃ
90        $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?";
91        $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id")));
92        $where = "customer_id = ? AND update_date = ? ";
93        $arrval = array($objCustomer->getValue("customer_id"), $old);
94        //ºï½ü
95        $objQuery->delete($table, $where, $arrval);
96        //ÄɲÃ
97        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
98    }
99*/
100}
101
102
103// µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ®
104$objPage = lfMakeSelect($objPage, $tmp_id);
105
106// ¾¦ÉÊID¤òFORMÆâ¤ËÊÝ»ý¤¹¤ë¡£
107$objPage->tpl_product_id = $tmp_id;
108
109switch($_POST['mode']) {
110case 'cart':
111    // ÆþÎÏÃͤÎÊÑ´¹
112    $objFormParam->convParam();
113    $objPage->arrErr = lfCheckError();
114    if(count($objPage->arrErr) == 0) {
115        $objCartSess = new SC_CartSession();
116        $classcategory_id1 = $_POST['classcategory_id1'];
117        $classcategory_id2 = $_POST['classcategory_id2'];
118               
119        // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç
120        if(!$objPage->tpl_classcat_find1) {
121            $classcategory_id1 = '0';
122        }
123       
124        // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç
125        if(!$objPage->tpl_classcat_find2) {
126            $classcategory_id2 = '0';
127        }
128       
129        $objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
130        $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $objFormParam->getValue('quantity'));
131        header("Location: " . URL_CART_TOP);
132
133        exit;
134    }
135    break;
136       
137default:
138    break;
139}
140
141$objQuery = new SC_Query();
142// DB¤«¤é¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë¡£
143$arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id));
144$objPage->arrProduct = $arrRet[0];
145
146// ¾¦ÉÊ¥³¡¼¥É¤Î¼èÆÀ
147$code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code";
148$arrProductCode = $objQuery->getall($code_sql, array($tmp_id));
149$arrProductCode = sfswaparray($arrProductCode);
150$objPage->arrProductCode = $arrProductCode["product_code"];
151
152// ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ
153if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) {
154  $objPage->tpl_sale_limit = SALE_LIMIT_MAX;
155} else {
156  $objPage->tpl_sale_limit = $objPage->arrProduct['sale_limit'];
157}
158
159// ¥µ¥Ö¥¿¥¤¥È¥ë¤ò¼èÆÀ
160$arrFirstCat = GetFirstCat($arrRet[0]['category_id']);
161$tpl_subtitle = $arrFirstCat['name'];
162$objPage->tpl_subtitle = $tpl_subtitle;
163
164// DB¤«¤é¤Î¥Ç¡¼¥¿¤ò°ú¤­·Ñ¤°
165$objUpFile->setDBFileList($objPage->arrProduct);
166// ¥Õ¥¡¥¤¥ëɽ¼¨ÍÑÇÛÎó¤òÅϤ¹
167$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true);
168// »ÙʧÊýË¡¤Î¼èÆÀ
169$objPage->arrPayment = lfGetPayment();
170// ÆþÎϾðÊó¤òÅϤ¹
171$objPage->arrForm = $objFormParam->getFormParamList();
172//¥ì¥Ó¥å¡¼¾ðÊó¤Î¼èÆÀ
173$objPage->arrReview = lfGetReviewData($tmp_id);
174// ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤Î¼èÆÀ
175$objPage->arrTrackback = lfGetTrackbackData($tmp_id);
176$objPage->trackback_url = TRACKBACK_TO_URL . $tmp_id;
177// ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë
178$objPage->tpl_title = "¾¦Éʾܺ٠". $objPage->arrProduct["name"];
179//¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨
180$objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id);
181//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
182$objPage->arrRelateProducts = lfGetRelateProducts($tmp_id);
183
184// ³ÈÂç²èÁü¤Î¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¥»¥Ã¥È
185list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"]));
186$objPage->tpl_large_width = $large_width + 60;
187$objPage->tpl_large_height = $large_height + 80;
188
189$objView->assignobj($objPage);
190$objView->display(SITE_FRAME);
191//-----------------------------------------------------------------------------------------------------------------------------------
192/* ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ */
193function lfInitFile() {
194    global $objUpFile;
195    $objUpFile->addFile("°ìÍ÷-¥á¥¤¥ó²èÁü", 'main_list_image', array('jpg','gif'),IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
196    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó²èÁü", 'main_image', array('jpg'), IMAGE_SIZE, true, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT);
197    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó³ÈÂç²èÁü", 'main_large_image', array('jpg'), IMAGE_SIZE, false, LARGE_IMAGE_HEIGHT, LARGE_IMAGE_HEIGHT);
198    for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
199        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_HEIGHT, NORMAL_SUBIMAGE_HEIGHT);
200        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö³ÈÂç²èÁü$cnt", "sub_large_image$cnt", array('jpg'), IMAGE_SIZE, false, LARGE_SUBIMAGE_HEIGHT, LARGE_SUBIMAGE_HEIGHT);
201    }
202    $objUpFile->addFile("¾¦ÉÊÈæ³Ó²èÁü", 'file1', array('jpg'), IMAGE_SIZE, false, NORMAL_IMAGE_HEIGHT, NORMAL_IMAGE_HEIGHT);
203    $objUpFile->addFile("¾¦Éʾܺ٥ե¡¥¤¥ë", 'file2', array('pdf'), PDF_SIZE, false, 0, 0, false);
204}
205
206/* µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® */
207function lfMakeSelect($objPage, $product_id) {
208    global $objPage;
209    $classcat_find1 = false;
210    $classcat_find2 = false;
211    // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎ̵ͭ
212    $stock_find = false;
213   
214    // µ¬³Ê̾°ìÍ÷
215    $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name");
216    // µ¬³ÊʬÎà̾°ìÍ÷
217    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
218    // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ   
219    $arrProductsClass = lfGetProductsClass($product_id);
220   
221    // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ
222    $objPage->tpl_class_name1 = $arrClassName[$arrProductsClass[0]['class_id1']];
223    // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ
224    $objPage->tpl_class_name2 = $arrClassName[$arrProductsClass[0]['class_id2']];
225   
226    // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô
227    $count = count($arrProductsClass);
228   
229    $classcat_id1 = "";
230   
231    $arrSele = array();
232    $arrList = array();
233   
234    $list_id = 0;
235    $arrList[0] = "\tlist0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'";
236    $arrVal[0] = "\tval0 = new Array(''";
237   
238    for ($i = 0; $i < $count; $i++) {
239        // ºß¸Ë¤Î¥Á¥§¥Ã¥¯
240        if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') {
241            continue;
242        }
243       
244        $stock_find = true;
245       
246        // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
247        if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){
248            $arrList[$list_id].=");\n";
249            $arrVal[$list_id].=");\n";
250            $classcat_id1 = $arrProductsClass[$i]['classcategory_id1'];
251            $arrSele[$classcat_id1] = $arrClassCatName[$classcat_id1];
252            $list_id++;
253        }
254       
255        // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
256        $classcat_id2 = $arrProductsClass[$i]['classcategory_id2'];
257       
258        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ
259        if($arrList[$list_id] == "") {
260            $arrList[$list_id] = "\tlist".$list_id." = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤', '".$arrClassCatName[$classcat_id2]."'";
261        } else {
262            $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'";
263        }
264       
265        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ
266        if($arrVal[$list_id] == "") {
267            $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'";
268        } else {
269            $arrVal[$list_id].= ", '".$classcat_id2."'";
270        }
271    }   
272   
273    $arrList[$list_id].=");\n";
274    $arrVal[$list_id].=");\n";
275       
276    // µ¬³Ê1
277    $objPage->arrClassCat1 = $arrSele;
278   
279    $lists = "\tlists = new Array(";
280    $no = 0;
281   
282    foreach($arrList as $val) {
283        $objPage->tpl_javascript.= $val;
284        if ($no != 0) {
285            $lists.= ",list".$no;
286        } else {
287            $lists.= "list".$no;
288        }
289        $no++;
290    }
291    $objPage->tpl_javascript.=$lists.");\n";
292   
293    $vals = "\tvals = new Array(";
294    $no = 0;
295   
296    foreach($arrVal as $val) {
297        $objPage->tpl_javascript.= $val;
298        if ($no != 0) {
299            $vals.= ",val".$no;
300        } else {
301            $vals.= "val".$no;
302        }
303        $no++;
304    }
305    $objPage->tpl_javascript.=$vals.");\n";
306   
307    // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID
308    $objPage->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . $_POST['classcategory_id2'] . "');";
309
310    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
311    if($arrProductsClass[0]['classcategory_id1'] != '0') {
312        $classcat_find1 = true;
313    }
314   
315    // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
316    if($arrProductsClass[0]['classcategory_id2'] != '0') {
317        $classcat_find2 = true;
318    }
319       
320    $objPage->tpl_classcat_find1 = $classcat_find1;
321    $objPage->tpl_classcat_find2 = $classcat_find2;
322    $objPage->tpl_stock_find = $stock_find;
323       
324    return $objPage;
325}
326
327/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
328function lfInitParam() {
329    global $objFormParam;
330
331    $objFormParam->addParam("µ¬³Ê1", "classcategory_id1", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
332    $objFormParam->addParam("µ¬³Ê2", "classcategory_id2", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
333    $objFormParam->addParam("¸Ä¿ô", "quantity", INT_LEN, "n", array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
334}
335
336/* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */
337function lfGetProductsClass($product_id) {
338    $arrRet = array();
339    if(sfIsInt($product_id)) {
340        // ¾¦Éʵ¬³Ê¼èÆÀ
341        $objQuery = new SC_Query();
342        $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited";
343        $table = "vw_product_class AS prdcls";
344        $where = "product_id = ?";
345        $objQuery->setorder("rank1 DESC, rank2 DESC");
346        $arrRet = $objQuery->select($col, $table, $where, array($product_id));
347    }
348    return $arrRet;
349}
350
351/* ÅÐÏ¿ºÑ¤ß¥ª¥¹¥¹¥á¾¦ÉÊ¤ÎÆÉ¤ß¹þ¤ß */
352function lfPreGetRecommendProducts($product_id) {
353    $objQuery = new SC_Query();
354    $objQuery->setorder("rank DESC");
355    $arrRet = $objQuery->select("recommend_product_id, comment", "dtb_recommend_products", "product_id = ?", array($product_id));
356    $max = count($arrRet);
357    $no = 0;
358    for($i = 0; $i < $max; $i++) {
359        $where = "del_flg = 0 AND product_id = ? AND status = 1";
360        $arrProductInfo = $objQuery->select("main_list_image, price02_min, price02_max, price01_min, price01_max, name, point_rate", "vw_products_allclass  AS allcls", $where, array($arrRet[$i]['recommend_product_id']));
361               
362        if(count($arrProductInfo) > 0) {
363            $arrRecommend[$no] = $arrProductInfo[0];
364            $arrRecommend[$no]['product_id'] = $arrRet[$i]['recommend_product_id'];
365            $arrRecommend[$no]['comment'] = $arrRet[$i]['comment'];
366            $no++;
367        }   
368    }
369    return $arrRecommend;
370}
371
372/* ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯ */
373function lfCheckError() {
374    global $objFormParam;
375    global $objPage;
376    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
377    $arrRet =  $objFormParam->getHashArray();
378    $objErr = new SC_CheckError($arrRet);
379    $objErr->arrErr = $objFormParam->checkError();
380       
381    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
382    if ($objPage->tpl_classcat_find1) {
383        $objErr->doFunc(array("µ¬³Ê1", "classcategory_id1"), array("EXIST_CHECK"));
384    }
385    if ($objPage->tpl_classcat_find2) {
386        $objErr->doFunc(array("µ¬³Ê2", "classcategory_id2"), array("EXIST_CHECK"));
387    }
388           
389    return $objErr->arrErr;
390}
391
392//±ÜÍ÷ÍúÎò¿·µ¬ÅÐÏ¿
393function lfRegistReadingData($tmp_id, $customer_id){
394    $objQuery = new SC_Query;
395    $sqlval['customer_id'] = $customer_id;
396    $sqlval['reading_product_id'] = $tmp_id;
397    $sqlval['create_date'] = 'NOW()';
398    $sqlval['update_date'] = 'NOW()';
399    $objQuery->insert("dtb_customer_reading", $sqlval);
400}
401
402//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
403function lfGetRelateProducts($tmp_id) {
404    $objQuery = new SC_Query;
405    //¼«Æ°Ãê½Ð
406    $objQuery->setorder("random()");
407    //ɽ¼¨·ï¿ô¤ÎÀ©¸Â
408    $objQuery->setlimit(RELATED_PRODUCTS_MAX);
409    //¸¡º÷¾ò·ï
410    $col = "name, main_list_image, price01_min, price02_min, price01_max, price02_max, point_rate";
411    $from = "vw_products_allclass AS allcls ";
412    $where = "del_flg = 0 AND status = 1 AND (stock_max <> 0 OR stock_max IS NULL) AND product_id = ? ";
413    $arrval[] = $tmp_id;
414    //·ë²Ì¤Î¼èÆÀ
415    $arrProducts = $objQuery->select($col, $from, $where, $arrval);
416   
417    return $arrProducts;
418}
419
420//¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
421function lfGetReviewData($id) {
422    $objQuery = new SC_Query;
423    //¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
424    $col = "create_date, reviewer_url, reviewer_name, recommend_level, title, comment";
425    $from = "dtb_review";
426    $where = "del_flg = 0 AND status = 1 AND product_id = ? ORDER BY create_date DESC LIMIT " . REVIEW_REGIST_MAX;
427    $arrval[] = $id;
428    $arrReview = $objQuery->select($col, $from, $where, $arrval);
429    return $arrReview;
430}
431
432/*
433 * ¾¦Éʤ´¤È¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë
434 *
435 * @param $product_id
436 * @return $arrTrackback
437 */
438function lfGetTrackbackData($product_id) {
439
440    $arrTrackback = array();
441
442    // ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯µ¡Ç½¤Î²ÔƯ¾õ¶·¥Á¥§¥Ã¥¯
443    if (sfGetSiteControlFlg(SITE_CONTROL_TRACKBACK) != 1) {
444        return $arrTrackback;
445    }   
446
447    $objQuery = new SC_Query;
448    //¾¦Éʤ´¤È¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë
449    $col = "blog_name, url, title, excerpt, title, create_date";
450    $from = "dtb_trackback";
451    $where = "del_flg = 0 AND status = 1 AND product_id = ? ORDER BY create_date DESC LIMIT " . TRACKBACK_VIEW_MAX;
452    $arrval[] = $product_id;
453    $arrTrackback = $objQuery->select($col, $from, $where, $arrval);
454    return $arrTrackback;
455}
456
457//»ÙʧÊýË¡¤Î¼èÆÀ
458//payment_id    1:¥¯¥ì¥¸¥Ã¥È¡¡2:¥·¥ç¥Ã¥Ô¥ó¥°¥í¡¼¥ó 
459function lfGetPayment() {
460    $objQuery = new SC_Query;
461    $col = "payment_id, rule, payment_method";
462    $from = "dtb_payment";
463    $where = "del_flg = 0";
464    $order = "payment_id";
465    $objQuery->setorder($order);
466    $arrRet = $objQuery->select($col, $from, $where);
467    return $arrRet;
468}
469
470?>
Note: See TracBrowser for help on using the repository browser.