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

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