Changeset 16338 for branches/beta/html/products
- Timestamp:
- 2007/10/09 01:21:38 (19 years ago)
- File:
-
- 1 edited
-
branches/beta/html/products/list.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
