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

Revision 11966, 14.4 KB checked in by inoue, 17 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
176// ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯µ¡Ç½¤Î²ÔƯ¾õ¶·¥Á¥§¥Ã¥¯
177if (sfGetSiteControlFlg(SITE_CONTROL_TRACKBACK) != 1) {
178    $objPage->arrTrackbackView = "OFF";
179} else {
180    $objPage->arrTrackbackView = "ON";
181    $objPage->arrTrackback = lfGetTrackbackData($tmp_id);
182}
183$objPage->trackback_url = TRACKBACK_TO_URL . $tmp_id;
184// ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë
185$objPage->tpl_title = "¾¦Éʾܺ٠". $objPage->arrProduct["name"];
186//¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨
187$objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id);
188//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
189$objPage->arrRelateProducts = lfGetRelateProducts($tmp_id);
190
191// ³ÈÂç²èÁü¤Î¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¥»¥Ã¥È
192list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"]));
193$objPage->tpl_large_width = $large_width + 60;
194$objPage->tpl_large_height = $large_height + 80;
195
196$objView->assignobj($objPage);
197$objView->display(SITE_FRAME);
198//-----------------------------------------------------------------------------------------------------------------------------------
199/* ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ */
200function lfInitFile() {
201    global $objUpFile;
202    $objUpFile->addFile("°ìÍ÷-¥á¥¤¥ó²èÁü", 'main_list_image', array('jpg','gif'),IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
203    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó²èÁü", 'main_image', array('jpg'), IMAGE_SIZE, true, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT);
204    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó³ÈÂç²èÁü", 'main_large_image', array('jpg'), IMAGE_SIZE, false, LARGE_IMAGE_HEIGHT, LARGE_IMAGE_HEIGHT);
205    for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
206        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_HEIGHT, NORMAL_SUBIMAGE_HEIGHT);
207        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö³ÈÂç²èÁü$cnt", "sub_large_image$cnt", array('jpg'), IMAGE_SIZE, false, LARGE_SUBIMAGE_HEIGHT, LARGE_SUBIMAGE_HEIGHT);
208    }
209    $objUpFile->addFile("¾¦ÉÊÈæ³Ó²èÁü", 'file1', array('jpg'), IMAGE_SIZE, false, NORMAL_IMAGE_HEIGHT, NORMAL_IMAGE_HEIGHT);
210    $objUpFile->addFile("¾¦Éʾܺ٥ե¡¥¤¥ë", 'file2', array('pdf'), PDF_SIZE, false, 0, 0, false);
211}
212
213/* µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® */
214function lfMakeSelect($objPage, $product_id) {
215    global $objPage;
216    $classcat_find1 = false;
217    $classcat_find2 = false;
218    // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎ̵ͭ
219    $stock_find = false;
220   
221    // µ¬³Ê̾°ìÍ÷
222    $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name");
223    // µ¬³ÊʬÎà̾°ìÍ÷
224    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
225    // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ   
226    $arrProductsClass = lfGetProductsClass($product_id);
227   
228    // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ
229    $objPage->tpl_class_name1 = $arrClassName[$arrProductsClass[0]['class_id1']];
230    // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ
231    $objPage->tpl_class_name2 = $arrClassName[$arrProductsClass[0]['class_id2']];
232   
233    // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô
234    $count = count($arrProductsClass);
235   
236    $classcat_id1 = "";
237   
238    $arrSele = array();
239    $arrList = array();
240   
241    $list_id = 0;
242    $arrList[0] = "\tlist0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'";
243    $arrVal[0] = "\tval0 = new Array(''";
244   
245    for ($i = 0; $i < $count; $i++) {
246        // ºß¸Ë¤Î¥Á¥§¥Ã¥¯
247        if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') {
248            continue;
249        }
250       
251        $stock_find = true;
252       
253        // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
254        if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){
255            $arrList[$list_id].=");\n";
256            $arrVal[$list_id].=");\n";
257            $classcat_id1 = $arrProductsClass[$i]['classcategory_id1'];
258            $arrSele[$classcat_id1] = $arrClassCatName[$classcat_id1];
259            $list_id++;
260        }
261       
262        // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
263        $classcat_id2 = $arrProductsClass[$i]['classcategory_id2'];
264       
265        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ
266        if($arrList[$list_id] == "") {
267            $arrList[$list_id] = "\tlist".$list_id." = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤', '".$arrClassCatName[$classcat_id2]."'";
268        } else {
269            $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'";
270        }
271       
272        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ
273        if($arrVal[$list_id] == "") {
274            $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'";
275        } else {
276            $arrVal[$list_id].= ", '".$classcat_id2."'";
277        }
278    }   
279   
280    $arrList[$list_id].=");\n";
281    $arrVal[$list_id].=");\n";
282       
283    // µ¬³Ê1
284    $objPage->arrClassCat1 = $arrSele;
285   
286    $lists = "\tlists = new Array(";
287    $no = 0;
288   
289    foreach($arrList as $val) {
290        $objPage->tpl_javascript.= $val;
291        if ($no != 0) {
292            $lists.= ",list".$no;
293        } else {
294            $lists.= "list".$no;
295        }
296        $no++;
297    }
298    $objPage->tpl_javascript.=$lists.");\n";
299   
300    $vals = "\tvals = new Array(";
301    $no = 0;
302   
303    foreach($arrVal as $val) {
304        $objPage->tpl_javascript.= $val;
305        if ($no != 0) {
306            $vals.= ",val".$no;
307        } else {
308            $vals.= "val".$no;
309        }
310        $no++;
311    }
312    $objPage->tpl_javascript.=$vals.");\n";
313   
314    // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID
315    $objPage->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . $_POST['classcategory_id2'] . "');";
316
317    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
318    if($arrProductsClass[0]['classcategory_id1'] != '0') {
319        $classcat_find1 = true;
320    }
321   
322    // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
323    if($arrProductsClass[0]['classcategory_id2'] != '0') {
324        $classcat_find2 = true;
325    }
326       
327    $objPage->tpl_classcat_find1 = $classcat_find1;
328    $objPage->tpl_classcat_find2 = $classcat_find2;
329    $objPage->tpl_stock_find = $stock_find;
330       
331    return $objPage;
332}
333
334/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
335function lfInitParam() {
336    global $objFormParam;
337
338    $objFormParam->addParam("µ¬³Ê1", "classcategory_id1", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
339    $objFormParam->addParam("µ¬³Ê2", "classcategory_id2", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
340    $objFormParam->addParam("¸Ä¿ô", "quantity", INT_LEN, "n", array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
341}
342
343/* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */
344function lfGetProductsClass($product_id) {
345    $arrRet = array();
346    if(sfIsInt($product_id)) {
347        // ¾¦Éʵ¬³Ê¼èÆÀ
348        $objQuery = new SC_Query();
349        $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited";
350        $table = "vw_product_class AS prdcls";
351        $where = "product_id = ?";
352        $objQuery->setorder("rank1 DESC, rank2 DESC");
353        $arrRet = $objQuery->select($col, $table, $where, array($product_id));
354    }
355    return $arrRet;
356}
357
358/* ÅÐÏ¿ºÑ¤ß¥ª¥¹¥¹¥á¾¦ÉʤÎÆɤ߹þ¤ß */
359function lfPreGetRecommendProducts($product_id) {
360    $objQuery = new SC_Query();
361    $objQuery->setorder("rank DESC");
362    $arrRet = $objQuery->select("recommend_product_id, comment", "dtb_recommend_products", "product_id = ?", array($product_id));
363    $max = count($arrRet);
364    $no = 0;
365    for($i = 0; $i < $max; $i++) {
366        $where = "del_flg = 0 AND product_id = ? AND status = 1";
367        $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']));
368               
369        if(count($arrProductInfo) > 0) {
370            $arrRecommend[$no] = $arrProductInfo[0];
371            $arrRecommend[$no]['product_id'] = $arrRet[$i]['recommend_product_id'];
372            $arrRecommend[$no]['comment'] = $arrRet[$i]['comment'];
373            $no++;
374        }   
375    }
376    return $arrRecommend;
377}
378
379/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
380function lfCheckError() {
381    global $objFormParam;
382    global $objPage;
383    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
384    $arrRet =  $objFormParam->getHashArray();
385    $objErr = new SC_CheckError($arrRet);
386    $objErr->arrErr = $objFormParam->checkError();
387       
388    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
389    if ($objPage->tpl_classcat_find1) {
390        $objErr->doFunc(array("µ¬³Ê1", "classcategory_id1"), array("EXIST_CHECK"));
391    }
392    if ($objPage->tpl_classcat_find2) {
393        $objErr->doFunc(array("µ¬³Ê2", "classcategory_id2"), array("EXIST_CHECK"));
394    }
395           
396    return $objErr->arrErr;
397}
398
399//±ÜÍ÷ÍúÎò¿·µ¬ÅÐÏ¿
400function lfRegistReadingData($tmp_id, $customer_id){
401    $objQuery = new SC_Query;
402    $sqlval['customer_id'] = $customer_id;
403    $sqlval['reading_product_id'] = $tmp_id;
404    $sqlval['create_date'] = 'NOW()';
405    $sqlval['update_date'] = 'NOW()';
406    $objQuery->insert("dtb_customer_reading", $sqlval);
407}
408
409//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
410function lfGetRelateProducts($tmp_id) {
411    $objQuery = new SC_Query;
412    //¼«Æ°Ãê½Ð
413    $objQuery->setorder("random()");
414    //ɽ¼¨·ï¿ô¤ÎÀ©¸Â
415    $objQuery->setlimit(RELATED_PRODUCTS_MAX);
416    //¸¡º÷¾ò·ï
417    $col = "name, main_list_image, price01_min, price02_min, price01_max, price02_max, point_rate";
418    $from = "vw_products_allclass AS allcls ";
419    $where = "del_flg = 0 AND status = 1 AND (stock_max <> 0 OR stock_max IS NULL) AND product_id = ? ";
420    $arrval[] = $tmp_id;
421    //·ë²Ì¤Î¼èÆÀ
422    $arrProducts = $objQuery->select($col, $from, $where, $arrval);
423   
424    return $arrProducts;
425}
426
427//¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
428function lfGetReviewData($id) {
429    $objQuery = new SC_Query;
430    //¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
431    $col = "create_date, reviewer_url, reviewer_name, recommend_level, title, comment";
432    $from = "dtb_review";
433    $where = "del_flg = 0 AND status = 1 AND product_id = ? ORDER BY create_date DESC LIMIT " . REVIEW_REGIST_MAX;
434    $arrval[] = $id;
435    $arrReview = $objQuery->select($col, $from, $where, $arrval);
436    return $arrReview;
437}
438
439/*
440 * ¾¦Éʤ´¤È¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë
441 *
442 * @param $product_id
443 * @return $arrTrackback
444 */
445function lfGetTrackbackData($product_id) {
446
447    $arrTrackback = array();
448
449    $objQuery = new SC_Query;
450    //¾¦Éʤ´¤È¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯¾ðÊó¤ò¼èÆÀ¤¹¤ë
451    $col = "blog_name, url, title, excerpt, title, create_date";
452    $from = "dtb_trackback";
453    $where = "del_flg = 0 AND status = 1 AND product_id = ? ORDER BY create_date DESC LIMIT " . TRACKBACK_VIEW_MAX;
454    $arrval[] = $product_id;
455    $arrTrackback = $objQuery->select($col, $from, $where, $arrval);
456    return $arrTrackback;
457}
458
459//»ÙʧÊýË¡¤Î¼èÆÀ
460//payment_id    1:¥¯¥ì¥¸¥Ã¥È¡¡2:¥·¥ç¥Ã¥Ô¥ó¥°¥í¡¼¥ó 
461function lfGetPayment() {
462    $objQuery = new SC_Query;
463    $col = "payment_id, rule, payment_method";
464    $from = "dtb_payment";
465    $where = "del_flg = 0";
466    $order = "payment_id";
467    $objQuery->setorder($order);
468    $arrRet = $objQuery->select($col, $from, $where);
469    return $arrRet;
470}
471
472?>
Note: See TracBrowser for help on using the repository browser.