Changeset 16338 for branches/beta/html
- Timestamp:
- 2007/10/09 01:21:38 (16 years ago)
- Location:
- branches/beta/html
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/html/mobile/products/list.php
r11975 r16338 1 1 <?php 2 2 /** 3 * 3 * 4 4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 5 5 * 6 6 * http://www.lockon.co.jp/ 7 * 7 * 8 8 * 9 9 * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¾¦ÉʰìÍ÷ … … 21 21 $this->arrDELIVERYDATE = $arrDELIVERYDATE; 22 22 global $arrPRODUCTLISTMAX; 23 $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX; 23 $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX; 24 24 /* 25 25 session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç … … 71 71 // ¾¦ÉÊTOP¤Îɽ¼¨½èÍý 72 72 /** ɬ¤º»ØÄꤹ¤ë **/ 73 $objPage->tpl_mainpage = "products/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 74 73 $objPage->tpl_mainpage = "products/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 74 75 75 $objPage->arrBestItems = sfGetBestProducts($conn, $category_id); 76 76 $objPage->BEST_ROOP_MAX = ceil((BEST_MAX-1)/2); … … 78 78 if ($_GET['mode'] == 'search' && strlen($_GET['category_id']) == 0 ){ 79 79 // ¸¡º÷»þ¤Ëcategory_id¤¬GET¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢²¾¤ËËä¤á¤¿ID¤ò¶õÇò¤ËÌ᤹ 80 $category_id = ''; 81 } 82 80 $category_id = ''; 81 } 82 83 83 // ¾¦ÉʰìÍ÷¤Îɽ¼¨½èÍý 84 84 $objPage = lfDispProductsList($category_id, $_GET['name'], $objPage->disp_number, $_REQUEST['orderby']); 85 85 86 86 // ¸¡º÷¾ò·ï¤ò²èÌ̤Ëɽ¼¨ 87 87 // ¥«¥Æ¥´¥ê¡¼¸¡º÷¾ò·ï … … 92 92 $arrSearch['category'] = $arrCat; 93 93 } 94 94 95 95 // ¾¦ÉÊ̾¸¡º÷¾ò·ï 96 96 if ($_GET['name'] === "") { … … 164 164 $objPage->arrSearch = $arrSearch; 165 165 166 sfCustomDisplay($objPage, true); 166 $objView = new SC_MobileView(); 167 $objView->assignObj($objPage); 168 $objView->display(SITE_FRAME); 167 169 168 170 //----------------------------------------------------------------------------------------------------------------------------------- … … 180 182 function lfDispProductsList($category_id, $name, $disp_num, $orderby) { 181 183 global $objPage; 182 $objQuery = new SC_Query(); 184 $objQuery = new SC_Query(); 183 185 $objPage->tpl_pageno = $_REQUEST['pageno']; 184 186 185 187 //ɽ¼¨·ï¿ô¤Ç¥Æ¥ó¥×¥ì¡¼¥È¤òÀÚ¤êÂØ¤¨¤ë 186 $objPage->tpl_mainpage = "products/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 188 $objPage->tpl_mainpage = "products/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 187 189 188 190 //ɽ¼¨½ç½ø … … 200 202 break; 201 203 } 202 204 203 205 // ¾¦Éʸ¡º÷¾ò·ï¤ÎºîÀ®¡Ê̤ºï½ü¡¢É½¼¨¡Ë 204 206 $where = "del_flg = 0 AND status = 1 "; … … 208 210 $arrval = array($category_id); 209 211 } 210 212 211 213 // ¾¦ÉÊ̾¤òwhereʸ¤Ë 212 214 $name = ereg_replace(",", "", $name); 213 215 if ( strlen($name) > 0 ){ 214 216 $where .= " AND ( name ILIKE ? OR comment3 ILIKE ?) "; 215 $ret = sfManualEscape($name); 217 $ret = sfManualEscape($name); 216 218 $arrval[] = "%$ret%"; 217 219 $arrval[] = "%$ret%"; 218 220 } 219 221 220 222 // ¹Ô¿ô¤Î¼èÆÀ 221 223 $linemax = $objQuery->count("vw_products_allclass AS allcls", $where, $arrval); 222 224 $objPage->tpl_linemax = $linemax; // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 223 225 224 226 // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 225 227 $objNavi = new SC_PageNavi($_REQUEST['pageno'], $linemax, $disp_num, "fnNaviPage", NAVI_PMAX); 226 228 227 229 $strnavi = $objNavi->strnavi; 228 230 $strnavi = str_replace('onclick="fnNaviPage', 'onclick="form1.mode.value=\''.'\'; fnNaviPage', $strnavi); 229 231 $objPage->tpl_strnavi = $strnavi; // ɽ¼¨Ê¸»úÎó 230 232 $startno = $objNavi->start_row; // ³«»Ï¹Ô 231 233 232 234 // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 233 235 $objQuery->setlimitoffset($disp_num, $startno); … … 236 238 // ¸¡º÷·ë²Ì¤Î¼èÆÀ 237 239 $objPage->arrProducts = $objQuery->select("*", "vw_products_allclass AS allcls", $where, $arrval); 238 240 239 241 // µ¬³Ê̾°ìÍ÷ 240 242 $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); … … 257 259 function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) { 258 260 global $objPage; 259 261 260 262 $classcat_find1 = false; 261 263 $classcat_find2 = false; 262 264 // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎÍ̵ 263 265 $stock_find = false; 264 265 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ 266 267 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ 266 268 $arrProductsClass = lfGetProductsClass($product_id); 267 269 268 270 // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ 269 271 $objPage->tpl_class_name1[$product_id] = $arrClassName[$arrProductsClass[0]['class_id1']]; 270 272 // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ 271 273 $objPage->tpl_class_name2[$product_id] = $arrClassName[$arrProductsClass[0]['class_id2']]; 272 273 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô 274 275 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô 274 276 $count = count($arrProductsClass); 275 277 276 278 $classcat_id1 = ""; 277 279 278 280 $arrSele = array(); 279 281 $arrList = array(); 280 282 281 283 $list_id = 0; 282 284 $arrList[0] = "\tlist". $product_id. "_0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'"; 283 285 $arrVal[0] = "\tval". $product_id. "_0 = new Array(''"; 284 286 285 287 for ($i = 0; $i < $count; $i++) { 286 288 // ºß¸Ë¤Î¥Á¥§¥Ã¥¯ … … 288 290 continue; 289 291 } 290 292 291 293 $stock_find = true; 292 294 293 295 // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 294 296 if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ … … 299 301 $list_id++; 300 302 } 301 303 302 304 // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 303 305 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 304 306 305 307 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ 306 308 if($arrList[$list_id] == "") { … … 309 311 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 310 312 } 311 313 312 314 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ 313 315 if($arrVal[$list_id] == "") { … … 316 318 $arrVal[$list_id].= ", '".$classcat_id2."'"; 317 319 } 318 } 319 320 } 321 320 322 $arrList[$list_id].=");\n"; 321 323 $arrVal[$list_id].=");\n"; 322 324 323 325 // µ¬³Ê1 324 326 $objPage->arrClassCat1[$product_id] = $arrSele; 325 327 326 328 $lists = "\tlists".$product_id. " = new Array("; 327 329 $no = 0; … … 336 338 } 337 339 $objPage->tpl_javascript.= $lists.");\n"; 338 340 339 341 $vals = "\tvals".$product_id. " = new Array("; 340 342 $no = 0; … … 349 351 } 350 352 $objPage->tpl_javascript.= $vals.");\n"; 351 353 352 354 // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID 353 355 $classcategory_id = "classcategory_id". $product_id; … … 358 360 $classcat_find1 = true; 359 361 } 360 362 361 363 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 362 364 if($arrProductsClass[0]['classcategory_id2'] != '0') { 363 365 $classcat_find2 = true; 364 366 } 365 367 366 368 $objPage->tpl_classcat_find1[$product_id] = $classcat_find1; 367 369 $objPage->tpl_classcat_find2[$product_id] = $classcat_find2; 368 370 $objPage->tpl_stock_find[$product_id] = $stock_find; 369 371 370 372 return $objPage; 371 373 } … … 388 390 function lfCheckError($id) { 389 391 global $objPage; 390 392 391 393 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 392 394 $objErr = new SC_CheckError(); 393 395 394 396 $classcategory_id1 = "classcategory_id". $id. "_1"; 395 397 $classcategory_id2 = "classcategory_id". $id. "_2"; … … 403 405 } 404 406 $objErr->doFunc(array("¸Ä¿ô", $quantity, INT_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 405 407 406 408 return $objErr->arrErr; 407 409 } … … 416 418 $objPage->tpl_sale_limit[$product['product_id']] = $product['sale_limit']; 417 419 } 418 420 419 421 return $objPage; 420 422 } -
branches/beta/html/products/list.php
r13579 r16338 18 18 $this->arrDELIVERYDATE = $arrDELIVERYDATE; 19 19 global $arrPRODUCTLISTMAX; 20 $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX; 20 $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX; 21 21 /* 22 22 session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç … … 66 66 // ¾¦ÉÊTOP¤Îɽ¼¨½èÍý 67 67 /** ɬ¤º»ØÄꤹ¤ë **/ 68 $objPage->tpl_mainpage = HTML_PATH . "user_data/templates/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 69 68 $objPage->tpl_mainpage = HTML_PATH . "user_data/templates/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 69 70 70 $objPage->arrBestItems = sfGetBestProducts($conn, $category_id); 71 71 $objPage->BEST_ROOP_MAX = ceil((BEST_MAX-1)/2); … … 73 73 if ($_GET['mode'] == 'search' && strlen($_GET['category_id']) == 0 ){ 74 74 // ¸¡º÷»þ¤Ëcategory_id¤¬GET¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢²¾¤ËËä¤á¤¿ID¤ò¶õÇò¤ËÌ᤹ 75 $category_id = ''; 76 } 77 75 $category_id = ''; 76 } 77 78 78 // ¾¦ÉʰìÍ÷¤Îɽ¼¨½èÍý 79 79 $objPage = lfDispProductsList($category_id, $_GET['name'], $objPage->disp_number, $_POST['orderby']); 80 80 81 81 // ¸¡º÷¾ò·ï¤ò²èÌ̤Ëɽ¼¨ 82 82 // ¥«¥Æ¥´¥ê¡¼¸¡º÷¾ò·ï … … 87 87 $arrSearch['category'] = $arrCat; 88 88 } 89 89 90 90 // ¾¦ÉÊ̾¸¡º÷¾ò·ï 91 91 if ($_GET['name'] === "") { … … 141 141 $objPage->arrSearch = $arrSearch; 142 142 143 sfCustomDisplay($objPage); 144 143 $objView = new SC_SiteView(); 144 $objView->assignObj($objPage); 145 $objView->display(SITE_FRAME); 145 146 //----------------------------------------------------------------------------------------------------------------------------------- 146 147 /* ¥«¥Æ¥´¥êID¤¬¥ë¡¼¥È¤«¤É¤¦¤«¤ÎȽÄê */ … … 157 158 function lfDispProductsList($category_id, $name, $disp_num, $orderby) { 158 159 global $objPage; 159 $objQuery = new SC_Query(); 160 $objQuery = new SC_Query(); 160 161 $objPage->tpl_pageno = $_POST['pageno']; 161 162 162 163 //ɽ¼¨·ï¿ô¤Ç¥Æ¥ó¥×¥ì¡¼¥È¤òÀÚ¤êÂØ¤¨¤ë 163 $objPage->tpl_mainpage = HTML_PATH . "user_data/templates/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 164 $objPage->tpl_mainpage = HTML_PATH . "user_data/templates/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 164 165 165 166 //ɽ¼¨½ç½ø … … 177 178 break; 178 179 } 179 180 180 181 // ¾¦Éʸ¡º÷¾ò·ï¤ÎºîÀ®¡Ê̤ºï½ü¡¢É½¼¨¡Ë 181 182 $where = "del_flg = 0 AND status = 1 "; … … 187 188 } 188 189 } 189 190 190 191 // ¾¦ÉÊ̾¤òwhereʸ¤Ë 191 192 $name = ereg_replace(",", "", $name); 192 193 if ( strlen($name) > 0 ){ 193 194 $where .= " AND ( name ILIKE ? OR comment3 ILIKE ?) "; 194 $ret = sfManualEscape($name); 195 $ret = sfManualEscape($name); 195 196 $arrval[] = "%$ret%"; 196 197 $arrval[] = "%$ret%"; 197 198 } 198 199 199 200 // ¹Ô¿ô¤Î¼èÆÀ 200 201 $linemax = $objQuery->count("vw_products_allclass AS allcls", $where, $arrval); 201 202 $objPage->tpl_linemax = $linemax; // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 202 203 203 204 // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 204 205 $objNavi = new SC_PageNavi($_POST['pageno'], $linemax, $disp_num, "fnNaviPage", NAVI_PMAX); 205 206 206 207 $strnavi = $objNavi->strnavi; 207 208 $strnavi = str_replace('onclick="fnNaviPage', 'onclick="form1.mode.value=\''.'\'; fnNaviPage', $strnavi); 208 209 $objPage->tpl_strnavi = $strnavi; // ɽ¼¨Ê¸»úÎó 209 210 $startno = $objNavi->start_row; // ³«»Ï¹Ô 210 211 211 212 // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 212 213 $objQuery->setlimitoffset($disp_num, $startno); 213 214 // ɽ¼¨½ç½ø 214 215 $objQuery->setorder($order); 215 216 217 218 219 220 221 222 216 217 218 219 220 221 222 223 223 224 // ¸¡º÷·ë²Ì¤Î¼èÆÀ 224 225 $objPage->arrProducts = $objQuery->select("*", "vw_products_allclass AS allcls", $where, $arrval); 225 226 226 227 // µ¬³Ê̾°ìÍ÷ 227 228 $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); … … 243 244 function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) { 244 245 global $objPage; 245 246 246 247 $classcat_find1 = false; 247 248 $classcat_find2 = false; 248 249 // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎÍ̵ 249 250 $stock_find = false; 250 251 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ 251 252 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ 252 253 $arrProductsClass = lfGetProductsClass($product_id); 253 254 254 255 // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ 255 256 $objPage->tpl_class_name1[$product_id] = $arrClassName[$arrProductsClass[0]['class_id1']]; 256 257 // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ 257 258 $objPage->tpl_class_name2[$product_id] = $arrClassName[$arrProductsClass[0]['class_id2']]; 258 259 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô 259 260 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô 260 261 $count = count($arrProductsClass); 261 262 262 263 $classcat_id1 = ""; 263 264 264 265 $arrSele = array(); 265 266 $arrList = array(); 266 267 267 268 $list_id = 0; 268 269 $arrList[0] = "\tlist". $product_id. "_0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'"; 269 270 $arrVal[0] = "\tval". $product_id. "_0 = new Array(''"; 270 271 271 272 for ($i = 0; $i < $count; $i++) { 272 273 // ºß¸Ë¤Î¥Á¥§¥Ã¥¯ … … 274 275 continue; 275 276 } 276 277 277 278 $stock_find = true; 278 279 279 280 // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 280 281 if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ … … 285 286 $list_id++; 286 287 } 287 288 288 289 // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 289 290 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 290 291 291 292 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ 292 293 if($arrList[$list_id] == "") { … … 295 296 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 296 297 } 297 298 298 299 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ 299 300 if($arrVal[$list_id] == "") { … … 302 303 $arrVal[$list_id].= ", '".$classcat_id2."'"; 303 304 } 304 } 305 305 } 306 306 307 $arrList[$list_id].=");\n"; 307 308 $arrVal[$list_id].=");\n"; 308 309 309 310 // µ¬³Ê1 310 311 $objPage->arrClassCat1[$product_id] = $arrSele; 311 312 312 313 $lists = "\tlists".$product_id. " = new Array("; 313 314 $no = 0; … … 322 323 } 323 324 $objPage->tpl_javascript.= $lists.");\n"; 324 325 325 326 $vals = "\tvals".$product_id. " = new Array("; 326 327 $no = 0; … … 335 336 } 336 337 $objPage->tpl_javascript.= $vals.");\n"; 337 338 338 339 // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID 339 340 $classcategory_id = "classcategory_id". $product_id; … … 344 345 $classcat_find1 = true; 345 346 } 346 347 347 348 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 348 349 if($arrProductsClass[0]['classcategory_id2'] != '0') { 349 350 $classcat_find2 = true; 350 351 } 351 352 352 353 $objPage->tpl_classcat_find1[$product_id] = $classcat_find1; 353 354 $objPage->tpl_classcat_find2[$product_id] = $classcat_find2; 354 355 $objPage->tpl_stock_find[$product_id] = $stock_find; 355 356 356 357 return $objPage; 357 358 } … … 374 375 function lfCheckError($id) { 375 376 global $objPage; 376 377 377 378 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 378 379 $objErr = new SC_CheckError(); 379 380 380 381 $classcategory_id1 = "classcategory_id". $id. "_1"; 381 382 $classcategory_id2 = "classcategory_id". $id. "_2"; … … 389 390 } 390 391 $objErr->doFunc(array("¸Ä¿ô", $quantity, INT_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 391 392 392 393 return $objErr->arrErr; 393 394 } … … 402 403 $objPage->tpl_sale_limit[$product['product_id']] = $product['sale_limit']; 403 404 } 404 405 405 406 return $objPage; 406 407 } … … 421 422 function lfconvertParam () { 422 423 global $objPage; 423 424 424 425 foreach ($objPage->arrForm as $key => $value) { 425 426 if (preg_match('/^quantity[0-9]+/', $key)) {
Note: See TracChangeset
for help on using the changeset viewer.