source: branches/version-1/html/products/detail.php @ 16650

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