Changeset 16695
- Timestamp:
- 2007/11/05 19:27:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/html/admin/products/product.php
r16650 r16695 19 19 $this->tpl_mainpage = 'products/product.tpl'; 20 20 $this->tpl_subnavi = 'products/subnavi.tpl'; 21 $this->tpl_mainno = 'products'; 21 $this->tpl_mainno = 'products'; 22 22 $this->tpl_subno = 'product'; 23 23 $this->tpl_subtitle = '¾¦ÉÊÅÐÏ¿'; … … 37 37 $this->arrDELIVERYDATE = $arrDELIVERYDATE; 38 38 $this->tpl_nonclass = true; 39 $this->tpl_movilink_flg = sfIsMoviLink(); 39 $this->tpl_movilink_flg 40 = function_exists('sfIsMoviLink') ? sfIsMoviLink() : ''; 40 41 } 41 42 } … … 61 62 foreach ($_POST as $key => $val) { 62 63 if (ereg("^search_", $key)) { 63 $objPage->arrSearchHidden[$key] = $val; 64 $objPage->arrSearchHidden[$key] = $val; 64 65 } 65 66 } … … 78 79 // DB¥Ç¡¼¥¿¤«¤é²èÁü¥Õ¥¡¥¤¥ë̾¤ÎÆÉ¹þ 79 80 $objUpFile->setDBFileList($arrForm); 80 81 81 82 if($_POST['mode'] == "copy"){ 82 83 $arrForm["copy_product_id"] = $arrForm["product_id"]; … … 85 86 $arrKey = $objUpFile->keyname; 86 87 $arrSaveFile = $objUpFile->save_file; 87 88 88 89 foreach($arrSaveFile as $key => $val){ 89 lfMakeScaleImage($arrKey[$key], $arrKey[$key], true); 90 lfMakeScaleImage($arrKey[$key], $arrKey[$key], true); 90 91 } 91 92 } 92 93 $objPage->arrForm = $arrForm; 93 94 94 95 // ¾¦ÉÊ¥¹¥Æ¡¼¥¿¥¹¤ÎÊÑ´¹ 95 96 $arrRet = sfSplitCBValue($objPage->arrForm['product_flag'], "product_flag"); … … 97 98 // DB¤«¤é¤ª¤¹¤¹¤á¾¦ÉÊ¤ÎÆÉ¤ß¹þ¤ß 98 99 $objPage->arrRecommend = lfPreGetRecommendProducts($_POST['product_id']); 99 100 100 101 // µ¬³ÊÅÐÏ¿¤¢¤ê¤Ê¤·È½Äê 101 102 $objPage->tpl_nonclass = lfCheckNonClass($_POST['product_id']); … … 107 108 // µ¬³ÊÅÐÏ¿¤¢¤ê¤Ê¤·È½Äê 108 109 $tpl_nonclass = lfCheckNonClass($_POST['product_id']); 109 110 110 111 if($_POST['product_id'] == "" and sfIsInt($_POST['copy_product_id'])){ 111 112 $tpl_nonclass = lfCheckNonClass($_POST['copy_product_id']); 112 113 } 113 114 $objPage->tpl_nonclass = $tpl_nonclass; 114 115 115 116 // ÆþÎÏÃͤÎÊÑ´¹ 116 117 $objPage->arrForm = lfConvertParam($objPage->arrForm); … … 129 130 case 'complete': 130 131 $objPage->tpl_mainpage = 'products/complete.tpl'; 131 132 132 133 $objPage->tpl_product_id = lfRegistProduct($_POST); // ¥Ç¡¼¥¿ÅÐÏ¿ 133 134 134 135 $objQuery = new SC_Query(); 135 136 // ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô … … 184 185 $sub_find = false; 185 186 for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { 186 if( $objPage->arrForm['sub_title'.$cnt] != "" || 187 $objPage->arrForm['sub_comment'.$cnt] != "" || 188 $objPage->arrForm['sub_image'.$cnt] != "" || 189 $objPage->arrForm['sub_large_image'.$cnt] != "" || 190 is_array($objPage->arrFile['sub_image'.$cnt]) || 187 if( $objPage->arrForm['sub_title'.$cnt] != "" || 188 $objPage->arrForm['sub_comment'.$cnt] != "" || 189 $objPage->arrForm['sub_image'.$cnt] != "" || 190 $objPage->arrForm['sub_large_image'.$cnt] != "" || 191 is_array($objPage->arrFile['sub_image'.$cnt]) || 191 192 is_array($objPage->arrFile['sub_large_image'.$cnt])) { 192 193 $sub_find = true; … … 205 206 global $objPage; 206 207 $objQuery = new SC_Query(); 207 208 208 209 for($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) { 209 210 $keyname = "recommend_id" . $i; … … 212 213 213 214 if($_POST[$keyname] != "" && $_POST[$delkey] != 1) { 214 $arrRet = $objQuery->select("main_list_image, product_code_min, name", "vw_products_allclass AS allcls", "product_id = ?", array($_POST[$keyname])); 215 $arrRet = $objQuery->select("main_list_image, product_code_min, name", "vw_products_allclass AS allcls", "product_id = ?", array($_POST[$keyname])); 215 216 $arrRecommend[$i] = $arrRet[0]; 216 217 $arrRecommend[$i]['product_id'] = $_POST[$keyname]; … … 251 252 $max = count($arrRet); 252 253 $no = 1; 253 254 254 255 for($i = 0; $i < $max; $i++) { 255 $arrProductInfo = $objQuery->select("main_list_image, product_code_min, name", "vw_products_allclass AS allcls", "product_id = ?", array($arrRet[$i]['recommend_product_id'])); 256 $arrProductInfo = $objQuery->select("main_list_image, product_code_min, name", "vw_products_allclass AS allcls", "product_id = ?", array($arrRet[$i]['recommend_product_id'])); 256 257 $arrRecommend[$no] = $arrProductInfo[0]; 257 258 $arrRecommend[$no]['product_id'] = $arrRet[$i]['recommend_product_id']; … … 268 269 $table = "vw_products_nonclass AS noncls "; 269 270 $where = "product_id = ?"; 270 271 271 272 // view¤â¹Ê¹þ¤ß(mysqlÂбþ) 272 273 sfViewWhere("&&noncls_where&&", $where, array($product_id)); 273 274 274 275 $arrRet = $objQuery->select($col, $table, $where, array($product_id)); 275 276 276 277 // ¥â¥Ó¥ê¥ó¥¯¤¬Í¸ú¤Ê¾ì¹ç 277 278 if(sfIsMoviLink()) { … … 279 280 $table = "dtb_products"; 280 281 $where = "product_id = ?"; 281 $arrMoviLink = $objQuery->select($col, $table, $where, array($product_id)); 282 $arrMoviLink = $objQuery->select($col, $table, $where, array($product_id)); 282 283 foreach($arrMoviLink[0] as $key => $val) { 283 284 $arrRet[0][$key] = $val; 284 285 } 285 } 286 286 } 287 287 288 return $arrRet[0]; 288 289 } … … 292 293 global $objPage; 293 294 global $objUpFile; 294 295 295 296 // ¥«¥Æ¥´¥ê¤ÎÆÉ¹þ 296 297 list($objPage->arrCatVal, $objPage->arrCatOut) = sfGetLevelCatList(false); … … 299 300 $objPage->arrForm['status'] = 1; 300 301 } 301 302 302 303 if(!is_array($objPage->arrForm['product_flag'])) { 303 304 // ¾¦ÉÊ¥¹¥Æ¡¼¥¿¥¹¤Îʬ³äÆÉ¹þ 304 305 $objPage->arrForm['product_flag'] = sfSplitCheckBoxes($objPage->arrForm['product_flag']); 305 306 } 306 307 307 308 // HIDDENÍѤËÇÛÎó¤òÅϤ¹¡£ 308 309 $objPage->arrHidden = array_merge((array)$objPage->arrHidden, (array)$objUpFile->getHiddenFileList()); 309 310 // FormÍÑÇÛÎó¤òÅϤ¹¡£ 310 311 $objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 311 312 312 313 313 314 // ¥¢¥ó¥«¡¼¤òÀßÄê 314 315 if($_POST['image_key'] != ""){ … … 317 318 $anchor_hash = "location.hash='#" . $_POST['anchor_key'] . "'"; 318 319 } 319 320 320 321 $objPage->tpl_onload = "fnCheckSaleLimit('" . DISABLED_RGB . "'); fnCheckStockLimit('" . DISABLED_RGB . "'); " . $anchor_hash; 321 322 } … … 328 329 $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó³ÈÂç²èÁü", 'main_large_image', array('jpg', 'gif', 'png'), IMAGE_SIZE, false, LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT); 329 330 for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { 330 $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg', 'gif', 'png'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_WIDTH, NORMAL_SUBIMAGE_HEIGHT); 331 $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg', 'gif', 'png'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_WIDTH, NORMAL_SUBIMAGE_HEIGHT); 331 332 $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö³ÈÂç²èÁü$cnt", "sub_large_image$cnt", array('jpg', 'gif', 'png'), IMAGE_SIZE, false, LARGE_SUBIMAGE_WIDTH, LARGE_SUBIMAGE_HEIGHT); 332 333 } … … 341 342 $objQuery = new SC_Query(); 342 343 $objQuery->begin(); 343 344 344 345 // INSERT¤¹¤ëÃͤòºîÀ®¤¹¤ë¡£ 345 346 $sqlval['name'] = $arrList['name']; … … 349 350 $sqlval['main_list_comment'] = $arrList['main_list_comment']; 350 351 $sqlval['main_comment'] = $arrList['main_comment']; 351 $sqlval['point_rate'] = $arrList['point_rate']; 352 $sqlval['point_rate'] = $arrList['point_rate']; 352 353 $sqlval['deliv_fee'] = $arrList['deliv_fee']; 353 354 $sqlval['comment1'] = $arrList['comment1']; … … 363 364 $sqlval['update_date'] = "Now()"; 364 365 $sqlval['creator_id'] = $_SESSION['member_id']; 365 366 366 367 // ¥â¥Ó¥ê¥ó¥¯¤¬Í¸ú¤Ê¾ì¹ç 367 368 if(sfIsMoviLink()) { … … 370 371 $sqlval['movilink_draft_text1'] = $arrList['movilink_draft_text1']; 371 372 $sqlval['movilink_draft_text2'] = $arrList['movilink_draft_text2']; 372 $sqlval['movilink_code1'] = $arrList['movilink_code1']; 373 $sqlval['movilink_kana'] = $arrList['movilink_kana']; 374 $sqlval['movilink_price'] = $arrList['movilink_price']; 375 } 376 373 $sqlval['movilink_code1'] = $arrList['movilink_code1']; 374 $sqlval['movilink_kana'] = $arrList['movilink_kana']; 375 $sqlval['movilink_price'] = $arrList['movilink_price']; 376 } 377 377 378 $arrRet = $objUpFile->getDBFileList(); 378 379 $sqlval = array_merge($sqlval, $arrRet); 379 380 380 381 for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { 381 382 $sqlval['sub_title'.$cnt] = $arrList['sub_title'.$cnt]; … … 398 399 $sqlval['product_id'] = $product_id; 399 400 } 400 401 401 402 // ¥³¥Ô¡¼¾¦Éʤξì¹ç¤Ë¤Ïµ¬³Ê¤â¥³¥Ô¡¼¤¹¤ë 402 403 if($_POST["copy_product_id"] != "" and sfIsInt($_POST["copy_product_id"])){ … … 412 413 413 414 $objQuery->query("INSERT INTO dtb_products_class (product_id, ". $col .") SELECT ?, " . $col. " FROM dtb_products_class WHERE product_id = ? ORDER BY product_class_id", array($product_id, $_POST["copy_product_id"])); 414 415 415 416 } 416 417 … … 420 421 $arrRet = lfGetProduct($arrList['product_id']); 421 422 $objUpFile->deleteDBFile($arrRet); 422 423 423 424 // ¥«¥Æ¥´¥êÆâ¥é¥ó¥¯¤ÎÄ´À°½èÍý 424 425 $old_catid = $objQuery->get("dtb_products", "category_id", "product_id = ?", array($arrList['product_id'])); 425 426 sfMoveCatRank($objQuery, "dtb_products", "product_id", "category_id", $old_catid, $arrList['category_id'], $arrList['product_id']); 426 427 427 428 // UPDATE¤Î¼Â¹Ô 428 429 $where = "product_id = ?"; 429 430 $objQuery->update("dtb_products", $sqlval, $where, array($arrList['product_id'])); 430 431 } 431 432 432 433 // µ¬³ÊÅÐÏ¿ 433 434 sfInsertProductClass($objQuery, $arrList, $product_id); 434 435 435 436 // ¤ª¤¹¤¹¤á¾¦ÉÊÅÐÏ¿ 436 437 lfInsertRecommendProducts($objQuery, $arrList, $product_id); 437 438 438 439 $objQuery->commit(); 439 440 return $product_id; … … 447 448 * K : ¡ÖȾ³Ñ(Êݶ¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹ 448 449 * C : ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹ 449 * V : ÂùÅÀÉÕ¤¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹ 450 * V : ÂùÅÀÉÕ¤¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹ 450 451 * n : ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(Êݶ¸)¡×¤ËÊÑ´¹ 451 452 */ 452 453 // ¿Íʪ´ðËܾðÊó 453 454 454 455 // ¥¹¥Ý¥Ã¥È¾¦ÉÊ 455 456 $arrConvList['name'] = "KVa"; … … 465 466 // Á÷ÎÁ¤Î»ØÄê¤Ê¤· 466 467 $arrConvList['deliv_fee'] = "n"; 467 468 468 469 // ¾ÜºÙ-¥µ¥Ö 469 470 for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { … … 473 474 $arrConvList["sub_comment$cnt"] = "KVa"; 474 475 } 475 476 476 477 // ¤ª¤¹¤¹¤á¾¦ÉÊ 477 478 for ($cnt = 1; $cnt <= RECOMMEND_PRODUCT_MAX; $cnt++) { … … 486 487 } 487 488 } 488 489 489 490 global $arrSTATUS; 490 491 $array['product_flag'] = sfMergeCheckBoxes($array['product_flag'], count($arrSTATUS)); 491 492 492 493 return $array; 493 494 } … … 497 498 global $objPage; 498 499 global $arrAllowedTag; 499 500 500 501 $objErr = new SC_CheckError($array); 501 502 $objErr->doFunc(array("¾¦ÉÊ̾", "name", STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); … … 509 510 $objErr->doFunc(array("¥á¡¼¥«¡¼URL", "comment1", URL_LEN), array("SPTAB_CHECK", "URL_CHECK", "MAX_LENGTH_CHECK")); 510 511 $objErr->doFunc(array("ȯÁ÷ÆüÌܰÂ", "deliv_date_id", INT_LEN), array("NUM_CHECK")); 511 512 512 513 // ¥â¥Ó¥ê¥ó¥¯¤¬Í¸ú¤Ê¾ì¹ç 513 514 if(sfIsMoviLink()) { … … 515 516 $objErr->doFunc(array("¾¦ÉÊ̾(¥Õ¥ê¥¬¥Ê)", "movilink_kana", STEXT_LEN), array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK")); 516 517 $objErr->doFunc(array("¾¦ÉʲÁ³Ê", "movilink_price", INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 517 518 518 519 if($array['movilink_net_fix'] == "") { 519 520 $objErr->doFunc(array("¾¦ÉÊÊó½·Î¨", "movilink_net_percent", PERCENTAGE_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 520 521 } 521 522 522 523 if($array['movilink_net_percent'] == "") { 523 524 $objErr->doFunc(array("¾¦ÉÊÊó½·³Û", "movilink_net_fix", INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 524 525 } 525 526 526 527 if($array['movilink_net_fix'] != "" && $array['movilink_net_percent'] != "") { 527 528 $objErr->arrErr['movilink_net_fix'] = "¢¨ ¾¦ÉÊÊó½·Î¨¤«¾¦ÉÊÊ󽷳ۤΤɤÁ¤é¤«¤òµÆþ¤·¤Æ¤¯¤À¤µ¤¤<br>"; 528 $objErr->arrErr['movilink_net_percent'] = "¢¨ ¾¦ÉÊÊó½·Î¨¤«¾¦ÉÊÊ󽷳ۤΤɤÁ¤é¤«¤òµÆþ¤·¤Æ¤¯¤À¤µ¤¤<br>"; 529 $objErr->arrErr['movilink_net_percent'] = "¢¨ ¾¦ÉÊÊó½·Î¨¤«¾¦ÉÊÊ󽷳ۤΤɤÁ¤é¤«¤òµÆþ¤·¤Æ¤¯¤À¤µ¤¤<br>"; 529 530 } 530 531 $objErr->doFunc(array("¹¹ð¥¿¥°¸¶¹Æ1", "movilink_draft_text1", 8), array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 531 532 $objErr->doFunc(array("¹¹ð¥¿¥°¸¶¹Æ2", "movilink_draft_text2", 8), array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 532 533 } 533 534 534 535 if($objPage->tpl_nonclass) { 535 536 $objErr->doFunc(array("¾¦ÉÊ¥³¡¼¥É", "product_code", STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK","MAX_LENGTH_CHECK","MAX_LENGTH_CHECK")); 536 537 $objErr->doFunc(array("Ä̾ï²Á³Ê", "price01", PRICE_LEN), array("ZERO_CHECK", "SPTAB_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 537 538 $objErr->doFunc(array("¾¦ÉʲÁ³Ê", "price02", PRICE_LEN), array("EXIST_CHECK", "NUM_CHECK", "ZERO_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK")); 538 539 539 540 if($array['stock_unlimited'] != "1") { 540 541 $objErr->doFunc(array("ºß¸Ë¿ô", "stock", AMOUNT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 541 542 } 542 543 } 543 544 if($array['sale_unlimited'] != "1") { 544 545 if($array['sale_unlimited'] != "1") { 545 546 $objErr->doFunc(array("¹ØÆþÀ©¸Â", "sale_limit", AMOUNT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 546 547 } 547 548 548 549 if(isset($objErr->arrErr['category_id'])) { 549 550 // ¼«Æ°ÁªÂò¤òËɤ°¤¿¤á¤Ë¥À¥ß¡¼Ê¸»ú¤òÆþ¤ì¤Æ¤ª¤¯ 550 551 $objPage->arrForm['category_id'] = "#"; 551 552 } 552 553 553 554 for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { 554 555 $objErr->doFunc(array("¾ÜºÙ-¥µ¥Ö¥¿¥¤¥È¥ë$cnt", "sub_title$cnt", STEXT_LEN), array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 555 556 $objErr->doFunc(array("¾ÜºÙ-¥µ¥Ö¥³¥á¥ó¥È$cnt", "sub_comment$cnt", LLTEXT_LEN), array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 556 $objErr->doFunc(array("¾ÜºÙ-¥µ¥Ö¥³¥á¥ó¥È$cnt", "sub_comment$cnt", $arrAllowedTag), array("HTML_TAG_CHECK")); 557 } 558 557 $objErr->doFunc(array("¾ÜºÙ-¥µ¥Ö¥³¥á¥ó¥È$cnt", "sub_comment$cnt", $arrAllowedTag), array("HTML_TAG_CHECK")); 558 } 559 559 560 for ($cnt = 1; $cnt <= RECOMMEND_PRODUCT_MAX; $cnt++) { 560 561 if($_POST["recommend_id$cnt"] != "" && $_POST["recommend_delete$cnt"] != 1) { … … 562 563 } 563 564 } 564 565 565 566 return $objErr->arrErr; 566 567 } … … 593 594 // ½Ì¾®¤·¤¿²èÁü¤ò¥»¥Ã¥È¤¹¤ë 594 595 function lfSetScaleImage(){ 595 596 596 597 $subno = str_replace("sub_large_image", "", $_POST['image_key']); 597 598 switch ($_POST['image_key']){ … … 616 617 global $objUpFile; 617 618 $arrImageKey = array_flip($objUpFile->keyname); 618 619 619 620 if($objUpFile->temp_file[$arrImageKey[$from_key]]){ 620 621 $from_path = $objUpFile->temp_dir . $objUpFile->temp_file[$arrImageKey[$from_key]]; … … 624 625 return ""; 625 626 } 626 627 627 628 if(file_exists($from_path)){ 628 629 // ¸µ²èÁü¥µ¥¤¥º¤ò¼èÆÀ 629 630 list($from_w, $from_h) = getimagesize($from_path); 630 631 631 632 // À¸À®Àè¤Î²èÁü¥µ¥¤¥º¤ò¼èÆÀ 632 633 $to_w = $objUpFile->width[$arrImageKey[$to_key]]; 633 634 $to_h = $objUpFile->height[$arrImageKey[$to_key]]; 634 635 635 636 636 637 if($forced) $objUpFile->save_file[$arrImageKey[$to_key]] = ""; 637 638 638 639 if(($objUpFile->temp_file[$arrImageKey[$to_key]] == "" and $objUpFile->save_file[$arrImageKey[$to_key]] == "")){ 639 640 $path = $objUpFile->makeThumb($from_path, $to_w, $to_h);
Note: See TracChangeset
for help on using the changeset viewer.