- Timestamp:
- 2007/07/20 15:58:59 (17 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update
-
Property
svn:ignore
set to
.cache
.settings
.projectOptions
-
Property
svn:ignore
set to
-
branches/feature-module-update/html/admin/products/product_class.php
r12157 r15078 22 22 $this->tpl_mainno = 'products'; 23 23 $this->tpl_subno = 'product'; 24 $this->tpl_subtitle = ' ¾¦ÉÊÅÐÏ¿';24 $this->tpl_subtitle = '商品登録'; 25 25 global $arrSRANK; 26 26 $this->arrSRANK = $arrSRANK; … … 37 37 $objPage = new LC_Page(); 38 38 $objView = new SC_AdminView(); 39 // ǧ¾Ú²ÄÈݤÎȽÄê39 // 認証可否の判定 40 40 $objSess = new SC_Session(); 41 41 sfIsSuccess($objSess); 42 42 43 // ¸¡º÷¥Ñ¥é¥á¡¼¥¿¤Î°ú¤·Ñ¤®43 // 検索パラメータの引き継ぎ 44 44 foreach ($_POST as $key => $val) { 45 45 if (ereg("^search_", $key)) { … … 52 52 53 53 switch($_POST['mode']) { 54 // µ¬³Êºï½üÍ×µá54 // 規格削除要求 55 55 case 'delete': 56 56 $objQuery = new SC_Query(); … … 82 82 } 83 83 84 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸85 break; 86 87 // ÊÔ½¸Í×µá84 lfProductClassPage(); // 規格登録ページ 85 break; 86 87 // 編集要求 88 88 case 'pre_edit': 89 89 $objQuery = new SC_Query(); … … 92 92 93 93 if($ret > 0) { 94 // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(DB¤ÎÃͤòÍ¥À褹¤ë¡£)94 // 規格組み合わせ一覧の取得(DBの値を優先する。) 95 95 $objPage->arrClassCat = lfGetClassCatListEdit($_POST['product_id']); 96 96 } 97 97 98 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸99 break; 100 // µ¬³ÊÁȤ߹ç¤ï¤»É½¼¨98 lfProductClassPage(); // 規格登録ページ 99 break; 100 // 規格組み合わせ表示 101 101 case 'disp': 102 102 $objPage->arrForm['select_class_id1'] = $_POST['select_class_id1']; … … 105 105 $objPage->arrErr = lfClassError(); 106 106 if (count($objPage->arrErr) == 0) { 107 // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ107 // 規格組み合わせ一覧の取得 108 108 $objPage->arrClassCat = lfGetClassCatListDisp($_POST['select_class_id1'], $_POST['select_class_id2']); 109 109 } 110 110 111 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸112 break; 113 // µ¬³ÊÅÐÏ¿Í×µá111 lfProductClassPage(); // 規格登録ページ 112 break; 113 // 規格登録要求 114 114 case 'edit': 115 // ÆþÎÏÃͤÎÊÑ´¹115 // 入力値の変換 116 116 $objPage->arrForm = lfConvertParam($_POST); 117 // ¥¨¥é¡¼¥Á¥§¥Ã¥¯117 // エラーチェック 118 118 $objPage->arrErr = lfProductClassError($objPage->arrForm); 119 119 120 120 if(count($objPage->arrErr) == 0) { 121 // ³Îǧ¥Ú¡¼¥¸ÀßÄê121 // 確認ページ設定 122 122 $objPage->tpl_mainpage = 'products/product_class_confirm.tpl'; 123 lfProductConfirmPage(); // ³Îǧ¥Ú¡¼¥¸É½¼¨123 lfProductConfirmPage(); // 確認ページ表示 124 124 } else { 125 // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ125 // 規格組み合わせ一覧の取得 126 126 $objPage->arrClassCat = lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); 127 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸128 } 129 break; 130 // ³Îǧ¥Ú¡¼¥¸¤«¤é¤ÎÌá¤ê127 lfProductClassPage(); // 規格登録ページ 128 } 129 break; 130 // 確認ページからの戻り 131 131 case 'confirm_return': 132 // ¥Õ¥©¡¼¥à¥Ñ¥é¥á¡¼¥¿¤Î°ú¤·Ñ¤®132 // フォームパラメータの引き継ぎ 133 133 $objPage->arrForm = $_POST; 134 // µ¬³Ê¤ÎÁªÂò¾ðÊó¤Ï°ú¤·Ñ¤¬¤Ê¤¤¡£134 // 規格の選択情報は引き継がない。 135 135 $objPage->arrForm['select_class_id1'] = ""; 136 136 $objPage->arrForm['select_class_id2'] = ""; 137 // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(¥Ç¥Õ¥©¥ë¥ÈÃͤϽÐÎϤ·¤Ê¤¤)137 // 規格組み合わせ一覧の取得(デフォルト値は出力しない) 138 138 $objPage->arrClassCat = lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); 139 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸139 lfProductClassPage(); // 規格登録ページ 140 140 break; 141 141 case 'complete': 142 // ´°Î»¥Ú¡¼¥¸ÀßÄê142 // 完了ページ設定 143 143 $objPage->tpl_mainpage = 'products/product_class_complete.tpl'; 144 // ¾¦Éʵ¬³Ê¤ÎÅÐÏ¿144 // 商品規格の登録 145 145 lfInsertProductClass($_POST, $_POST['product_id']); 146 146 break; 147 147 default: 148 lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸148 lfProductClassPage(); // 規格登録ページ 149 149 break; 150 150 } … … 153 153 $objView->display(MAIN_FRAME); 154 154 //----------------------------------------------------------------------------------------------------------------------------- 155 /* µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸É½¼¨ÍÑ*/155 /* 規格登録ページ表示用 */ 156 156 function lfProductClassPage() { 157 157 global $objPage; … … 161 161 $arrClass = sfGetIDValueList("dtb_class", 'class_id', 'name'); 162 162 163 // µ¬³ÊʬÎबÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤µ¬³Ê¤Ïɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£163 // 規格分類が登録されていない規格は表示しないようにする。 164 164 $arrClassCatCount = sfGetClassCatCount(); 165 165 … … 170 170 } 171 171 172 // ¾¦ÉÊ̾¤ò¼èÆÀ172 // 商品名を取得 173 173 $objQuery = new SC_Query(); 174 174 $product_name = $objQuery->getOne("SELECT name FROM dtb_products WHERE product_id = ?", array($_POST['product_id'])); … … 179 179 global $objPage; 180 180 181 // ¥Ç¥Õ¥©¥ë¥ÈÃͤÎÆɹþ181 // デフォルト値の読込 182 182 $col = "product_code, price01, price02, stock, stock_unlimited"; 183 183 $arrRet = $objQuery->select($col, "dtb_products_class", "product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0", array($product_id));; … … 196 196 } 197 197 198 /* µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ*/198 /* 規格組み合わせ一覧の取得 */ 199 199 function lfGetClassCatListDisp($class_id1, $class_id2, $default = true) { 200 200 global $objPage; … … 202 202 203 203 if($class_id2 != "") { 204 // µ¬³Ê1¤Èµ¬³Ê2204 // 規格1と規格2 205 205 $sql = "SELECT * "; 206 206 $sql.= "FROM vw_cross_class AS crs_cls "; … … 208 208 $arrRet = $objQuery->getall($sql, array($class_id1, $class_id2)); 209 209 } else { 210 // µ¬³Ê1¤Î¤ß210 // 規格1のみ 211 211 $sql = "SELECT * "; 212 212 $sql.= "FROM vw_cross_class AS crs_cls "; … … 219 219 220 220 if($default) { 221 // ¥Ç¥Õ¥©¥ë¥ÈÃͤòÀßÄê221 // デフォルト値を設定 222 222 lfSetDefaultClassCat($objQuery, $_POST['product_id'], $max); 223 223 } … … 230 230 } 231 231 232 /* µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(ÊÔ½¸²èÌÌ) */232 /* 規格組み合わせ一覧の取得(編集画面) */ 233 233 function lfGetClassCatListEdit($product_id) { 234 234 global $objPage; 235 // ´û¸ÊÔ½¸¤Î¾ì¹ç235 // 既存編集の場合 236 236 $objQuery = new SC_Query(); 237 237 … … 258 258 $max = count($arrList); 259 259 260 // ¥Ç¥Õ¥©¥ë¥ÈÃͤòÀßÄê260 // デフォルト値を設定 261 261 lfSetDefaultClassCat($objQuery, $product_id, $max); 262 262 … … 272 272 $objPage->arrForm['price01:'.$no] = $arrList[$cnt]['price01']; 273 273 $objPage->arrForm['price02:'.$no] = $arrList[$cnt]['price02']; 274 // JavaScript ½é´ü²½ÍÑʸ»úÎó274 // JavaScript初期化用文字列 275 275 $line.= "'check:".$no."',"; 276 276 } … … 286 286 } 287 287 288 /* µ¬³Ê¤ÎÅÐÏ¿*/288 /* 規格の登録 */ 289 289 function lfInsertProductClass($arrList, $product_id) { 290 290 $objQuery = new SC_Query(); … … 292 292 $objQuery->begin(); 293 293 294 // ´û¸µ¬³Ê¤Îºï½ü294 // 既存規格の削除 295 295 $where = "product_id = ?"; 296 296 $objQuery->delete("dtb_products_class", $where, array($product_id)); 297 297 298 298 $cnt = 1; 299 // ¤¹¤Ù¤Æ¤Îµ¬³Ê¤òÅÐÏ¿¤¹¤ë¡£299 // すべての規格を登録する。 300 300 while($arrList["classcategory_id1:".$cnt] != "") { 301 301 if($arrList["check:".$cnt] == 1) { … … 311 311 $sqlval['create_date'] = "now()"; 312 312 $sqlval['update_date'] = "now()"; 313 // INSERT ¤Î¼Â¹Ô313 // INSERTの実行 314 314 $objQuery->insert("dtb_products_class", $sqlval); 315 315 } … … 320 320 } 321 321 322 // µ¬³ÊÁªÂò¥¨¥é¡¼¥Á¥§¥Ã¥¯322 // 規格選択エラーチェック 323 323 function lfClassError() { 324 324 $objErr = new SC_CheckError(); 325 $objErr->doFunc(array(" µ¬³Ê1", "select_class_id1"), array("EXIST_CHECK"));326 $objErr->doFunc(array(" µ¬³Ê", "select_class_id1", "select_class_id2"), array("TOP_EXIST_CHECK"));327 $objErr->doFunc(array(" µ¬³Ê1", "µ¬³Ê2", "select_class_id1", "select_class_id2"), array("DIFFERENT_CHECK"));325 $objErr->doFunc(array("規格1", "select_class_id1"), array("EXIST_CHECK")); 326 $objErr->doFunc(array("規格", "select_class_id1", "select_class_id2"), array("TOP_EXIST_CHECK")); 327 $objErr->doFunc(array("規格1", "規格2", "select_class_id1", "select_class_id2"), array("DIFFERENT_CHECK")); 328 328 return $objErr->arrErr; 329 329 } 330 330 331 /* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹*/331 /* 取得文字列の変換 */ 332 332 function lfConvertParam($array) { 333 333 /* 334 * ʸ»úÎó¤ÎÊÑ´¹335 * K : ¡ÖȾ³Ñ(Êݶ¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹336 * C : ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹337 * V : ÂùÅÀÉÕ¤¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹338 * n : ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(Êݶ¸)¡×¤ËÊÑ´¹334 * 文字列の変換 335 * K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換 336 * C : 「全角ひら仮名」を「全角かた仮名」に変換 337 * V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します 338 * n : 「全角」数字を「半角(ハンカク)」に変換 339 339 */ 340 340 … … 348 348 } 349 349 350 // ʸ»úÊÑ´¹350 // 文字変換 351 351 foreach ($arrConvList as $key => $val) { 352 // POST ¤µ¤ì¤Æ¤¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£352 // POSTされてきた値のみ変換する。 353 353 if(isset($array[$key])) { 354 354 $array[$key] = mb_convert_kana($array[$key] ,$val); … … 358 358 } 359 359 360 // ¾¦Éʵ¬³Ê¥¨¥é¡¼¥Á¥§¥Ã¥¯360 // 商品規格エラーチェック 361 361 function lfProductClassError($array) { 362 362 $objErr = new SC_CheckError($array); … … 365 365 while($array["classcategory_id1:".$no] != "") { 366 366 if($array["check:".$no] == 1) { 367 $objErr->doFunc(array(" ¾¦ÉÊ¥³¡¼¥É", "product_code:".$no, STEXT_LEN), array("MAX_LENGTH_CHECK"));367 $objErr->doFunc(array("商品コード", "product_code:".$no, STEXT_LEN), array("MAX_LENGTH_CHECK")); 368 368 $objErr->doFunc(array(NORMAL_PRICE_TITLE, "price01:".$no, PRICE_LEN), array("ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 369 369 $objErr->doFunc(array(SALE_PRICE_TITLE, "price02:".$no, PRICE_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 370 370 371 371 if($array["stock_unlimited:".$no] != '1') { 372 $objErr->doFunc(array(" ºß¸Ë¿ô", "stock:".$no, AMOUNT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));372 $objErr->doFunc(array("在庫数", "stock:".$no, AMOUNT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 373 373 } 374 374 } … … 384 384 } 385 385 386 /* ³Îǧ¥Ú¡¼¥¸É½¼¨ÍÑ*/386 /* 確認ページ表示用 */ 387 387 function lfProductConfirmPage() { 388 388 global $objPage;
Note: See TracChangeset
for help on using the changeset viewer.