| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 4 | * |
|---|
| 5 | * http://www.lockon.co.jp/ |
|---|
| 6 | */ |
|---|
| 7 | require_once("../require.php"); |
|---|
| 8 | |
|---|
| 9 | class LC_Page { |
|---|
| 10 | var $arrCatList; |
|---|
| 11 | var $arrSRANK; |
|---|
| 12 | var $arrForm; |
|---|
| 13 | var $arrSubList; |
|---|
| 14 | var $arrHidden; |
|---|
| 15 | var $arrTempImage; |
|---|
| 16 | var $arrSaveImage; |
|---|
| 17 | var $tpl_mode; |
|---|
| 18 | var $arrSearchHidden; |
|---|
| 19 | function LC_Page() { |
|---|
| 20 | $this->tpl_mainpage = 'products/product_class.tpl'; |
|---|
| 21 | $this->tpl_subnavi = 'products/subnavi.tpl'; |
|---|
| 22 | $this->tpl_mainno = 'products'; |
|---|
| 23 | $this->tpl_subno = 'product'; |
|---|
| 24 | $this->tpl_subtitle = '¾¦ÉÊÅÐÏ¿'; |
|---|
| 25 | global $arrSRANK; |
|---|
| 26 | $this->arrSRANK = $arrSRANK; |
|---|
| 27 | global $arrDISP; |
|---|
| 28 | $this->arrDISP = $arrDISP; |
|---|
| 29 | global $arrCLASS; |
|---|
| 30 | $this->arrCLASS = $arrCLASS; |
|---|
| 31 | global $arrSTATUS; |
|---|
| 32 | $this->arrSTATUS = $arrSTATUS; |
|---|
| 33 | $this->tpl_onload = ""; |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | $objPage = new LC_Page(); |
|---|
| 38 | $objView = new SC_AdminView(); |
|---|
| 39 | // ǧ¾Ú²ÄÈݤÎȽÄê |
|---|
| 40 | $objSess = new SC_Session(); |
|---|
| 41 | sfIsSuccess($objSess); |
|---|
| 42 | |
|---|
| 43 | // ¸¡º÷¥Ñ¥é¥á¡¼¥¿¤Î°ú¤·Ñ¤® |
|---|
| 44 | foreach ($_POST as $key => $val) { |
|---|
| 45 | if (ereg("^search_", $key)) { |
|---|
| 46 | $objPage->arrSearchHidden[$key] = $val; |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | $objPage->tpl_product_id = $_POST['product_id']; |
|---|
| 51 | $objPage->tpl_pageno = $_POST['pageno']; |
|---|
| 52 | |
|---|
| 53 | switch($_POST['mode']) { |
|---|
| 54 | // µ¬³Êºï½üÍ×µá |
|---|
| 55 | case 'delete': |
|---|
| 56 | $objQuery = new SC_Query(); |
|---|
| 57 | |
|---|
| 58 | $objQuery->setLimitOffset(1); |
|---|
| 59 | $where = "product_id = ? AND NOT (classcategory_id1 = 0 AND classcategory_id2 = 0)"; |
|---|
| 60 | $objQuery->setOrder("rank1 DESC, rank2 DESC"); |
|---|
| 61 | $arrRet = $objQuery->select("*", "vw_cross_products_class AS crs_prd", $where, array($_POST['product_id'])); |
|---|
| 62 | |
|---|
| 63 | if(count($arrRet) > 0) { |
|---|
| 64 | |
|---|
| 65 | $sqlval['product_id'] = $arrRet[0]['product_id']; |
|---|
| 66 | $sqlval['classcategory_id1'] = '0'; |
|---|
| 67 | $sqlval['classcategory_id2'] = '0'; |
|---|
| 68 | $sqlval['product_code'] = $arrRet[0]['product_code']; |
|---|
| 69 | $sqlval['stock'] = $arrRet[0]['stock']; |
|---|
| 70 | $sqlval['price01'] = $arrRet[0]['price01']; |
|---|
| 71 | $sqlval['price02'] = $arrRet[0]['price02']; |
|---|
| 72 | $sqlval['creator_id'] = $_SESSION['member_id']; |
|---|
| 73 | $sqlval['create_date'] = "now()"; |
|---|
| 74 | $sqlval['update_date'] = "now()"; |
|---|
| 75 | |
|---|
| 76 | $objQuery->begin(); |
|---|
| 77 | $where = "product_id = ?"; |
|---|
| 78 | $objQuery->delete("dtb_products_class", $where, array($_POST['product_id'])); |
|---|
| 79 | $objQuery->insert("dtb_products_class", $sqlval); |
|---|
| 80 | |
|---|
| 81 | $objQuery->commit(); |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 85 | break; |
|---|
| 86 | |
|---|
| 87 | // ÊÔ½¸Í×µá |
|---|
| 88 | case 'pre_edit': |
|---|
| 89 | $objQuery = new SC_Query(); |
|---|
| 90 | $where = "product_id = ? AND NOT(classcategory_id1 = 0 AND classcategory_id2 = 0) "; |
|---|
| 91 | $ret = $objQuery->count("dtb_products_class", $where, array($_POST['product_id'])); |
|---|
| 92 | |
|---|
| 93 | if($ret > 0) { |
|---|
| 94 | // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(DB¤ÎÃͤòÍ¥À褹¤ë¡£) |
|---|
| 95 | $objPage->arrClassCat = lfGetClassCatListEdit($_POST['product_id']); |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 99 | break; |
|---|
| 100 | // µ¬³ÊÁȤ߹ç¤ï¤»É½¼¨ |
|---|
| 101 | case 'disp': |
|---|
| 102 | $objPage->arrForm['select_class_id1'] = $_POST['select_class_id1']; |
|---|
| 103 | $objPage->arrForm['select_class_id2'] = $_POST['select_class_id2']; |
|---|
| 104 | |
|---|
| 105 | $objPage->arrErr = lfClassError(); |
|---|
| 106 | if (count($objPage->arrErr) == 0) { |
|---|
| 107 | // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ |
|---|
| 108 | $objPage->arrClassCat = lfGetClassCatListDisp($_POST['select_class_id1'], $_POST['select_class_id2']); |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 112 | break; |
|---|
| 113 | // µ¬³ÊÅÐÏ¿Í×µá |
|---|
| 114 | case 'edit': |
|---|
| 115 | // ÆþÎÏÃͤÎÊÑ´¹ |
|---|
| 116 | $objPage->arrForm = lfConvertParam($_POST); |
|---|
| 117 | // ¥¨¥é¡¼¥Á¥§¥Ã¥¯ |
|---|
| 118 | $objPage->arrErr = lfProductClassError($objPage->arrForm); |
|---|
| 119 | |
|---|
| 120 | if(count($objPage->arrErr) == 0) { |
|---|
| 121 | // ³Îǧ¥Ú¡¼¥¸ÀßÄê |
|---|
| 122 | $objPage->tpl_mainpage = 'products/product_class_confirm.tpl'; |
|---|
| 123 | lfProductConfirmPage(); // ³Îǧ¥Ú¡¼¥¸É½¼¨ |
|---|
| 124 | } else { |
|---|
| 125 | // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ |
|---|
| 126 | $objPage->arrClassCat = lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); |
|---|
| 127 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 128 | } |
|---|
| 129 | break; |
|---|
| 130 | // ³Îǧ¥Ú¡¼¥¸¤«¤é¤ÎÌá¤ê |
|---|
| 131 | case 'confirm_return': |
|---|
| 132 | // ¥Õ¥©¡¼¥à¥Ñ¥é¥á¡¼¥¿¤Î°ú¤·Ñ¤® |
|---|
| 133 | $objPage->arrForm = $_POST; |
|---|
| 134 | // µ¬³Ê¤ÎÁªÂò¾ðÊó¤Ï°ú¤·Ñ¤¬¤Ê¤¤¡£ |
|---|
| 135 | $objPage->arrForm['select_class_id1'] = ""; |
|---|
| 136 | $objPage->arrForm['select_class_id2'] = ""; |
|---|
| 137 | // µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(¥Ç¥Õ¥©¥ë¥ÈÃͤϽÐÎϤ·¤Ê¤¤) |
|---|
| 138 | $objPage->arrClassCat = lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); |
|---|
| 139 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 140 | break; |
|---|
| 141 | case 'complete': |
|---|
| 142 | // ´°Î»¥Ú¡¼¥¸ÀßÄê |
|---|
| 143 | $objPage->tpl_mainpage = 'products/product_class_complete.tpl'; |
|---|
| 144 | // ¾¦Éʵ¬³Ê¤ÎÅÐÏ¿ |
|---|
| 145 | lfInsertProductClass($_POST, $_POST['product_id']); |
|---|
| 146 | break; |
|---|
| 147 | default: |
|---|
| 148 | lfProductClassPage(); // µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸ |
|---|
| 149 | break; |
|---|
| 150 | } |
|---|
| 151 | |
|---|
| 152 | $objView->assignobj($objPage); |
|---|
| 153 | $objView->display(MAIN_FRAME); |
|---|
| 154 | //----------------------------------------------------------------------------------------------------------------------------- |
|---|
| 155 | /* µ¬³ÊÅÐÏ¿¥Ú¡¼¥¸É½¼¨ÍÑ */ |
|---|
| 156 | function lfProductClassPage() { |
|---|
| 157 | global $objPage; |
|---|
| 158 | $objPage->arrHidden = $_POST; |
|---|
| 159 | $objPage->arrHidden['select_class_id1'] = ""; |
|---|
| 160 | $objPage->arrHidden['select_class_id2'] = ""; |
|---|
| 161 | $arrClass = sfGetIDValueList("dtb_class", 'class_id', 'name'); |
|---|
| 162 | |
|---|
| 163 | // µ¬³ÊʬÎबÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤µ¬³Ê¤Ïɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£ |
|---|
| 164 | $arrClassCatCount = sfGetClassCatCount(); |
|---|
| 165 | |
|---|
| 166 | foreach($arrClass as $key => $val) { |
|---|
| 167 | if($arrClassCatCount[$key] > 0) { |
|---|
| 168 | $objPage->arrClass[$key] = $arrClass[$key]; |
|---|
| 169 | } |
|---|
| 170 | } |
|---|
| 171 | |
|---|
| 172 | // ¾¦ÉÊ̾¤ò¼èÆÀ |
|---|
| 173 | $objQuery = new SC_Query(); |
|---|
| 174 | $product_name = $objQuery->getOne("SELECT name FROM dtb_products WHERE product_id = ?", array($_POST['product_id'])); |
|---|
| 175 | $objPage->arrForm['product_name'] = $product_name; |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | function lfSetDefaultClassCat($objQuery, $product_id, $max) { |
|---|
| 179 | global $objPage; |
|---|
| 180 | |
|---|
| 181 | // ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤ÎÆÉ¹þ |
|---|
| 182 | $col = "product_code, price01, price02, stock, stock_unlimited"; |
|---|
| 183 | $arrRet = $objQuery->select($col, "dtb_products_class", "product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0", array($product_id));; |
|---|
| 184 | |
|---|
| 185 | if(count($arrRet) > 0) { |
|---|
| 186 | $no = 1; |
|---|
| 187 | for($cnt = 0; $cnt < $max; $cnt++) { |
|---|
| 188 | $objPage->arrForm["product_code:".$no] = $arrRet[0]['product_code']; |
|---|
| 189 | $objPage->arrForm['stock:'.$no] = $arrRet[0]['stock']; |
|---|
| 190 | $objPage->arrForm['price01:'.$no] = $arrRet[0]['price01']; |
|---|
| 191 | $objPage->arrForm['price02:'.$no] = $arrRet[0]['price02']; |
|---|
| 192 | $objPage->arrForm['stock_unlimited:'.$no] = $arrRet[0]['stock_unlimited']; |
|---|
| 193 | $no++; |
|---|
| 194 | } |
|---|
| 195 | } |
|---|
| 196 | } |
|---|
| 197 | |
|---|
| 198 | /* µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ */ |
|---|
| 199 | function lfGetClassCatListDisp($class_id1, $class_id2, $default = true) { |
|---|
| 200 | global $objPage; |
|---|
| 201 | $objQuery = new SC_Query(); |
|---|
| 202 | |
|---|
| 203 | if($class_id2 != "") { |
|---|
| 204 | // µ¬³Ê1¤Èµ¬³Ê2 |
|---|
| 205 | $sql = "SELECT * "; |
|---|
| 206 | $sql.= "FROM vw_cross_class AS crs_cls "; |
|---|
| 207 | $sql.= "WHERE class_id1 = ? AND class_id2 = ? ORDER BY rank1 DESC, rank2 DESC;"; |
|---|
| 208 | $arrRet = $objQuery->getall($sql, array($class_id1, $class_id2)); |
|---|
| 209 | } else { |
|---|
| 210 | // µ¬³Ê1¤Î¤ß |
|---|
| 211 | $sql = "SELECT * "; |
|---|
| 212 | $sql.= "FROM vw_cross_class AS crs_cls "; |
|---|
| 213 | $sql.= "WHERE class_id1 = ? AND class_id2 = 0 ORDER BY rank1 DESC;"; |
|---|
| 214 | $arrRet = $objQuery->getall($sql, array($class_id1)); |
|---|
| 215 | |
|---|
| 216 | } |
|---|
| 217 | |
|---|
| 218 | $max = count($arrRet); |
|---|
| 219 | |
|---|
| 220 | if($default) { |
|---|
| 221 | // ¥Ç¥Õ¥©¥ë¥ÈÃͤòÀßÄê |
|---|
| 222 | lfSetDefaultClassCat($objQuery, $_POST['product_id'], $max); |
|---|
| 223 | } |
|---|
| 224 | |
|---|
| 225 | $objPage->arrForm["class_id1"] = $arrRet[0]['class_id1']; |
|---|
| 226 | $objPage->arrForm["class_id2"] = $arrRet[0]['class_id2']; |
|---|
| 227 | $objPage->tpl_onload.= "fnCheckAllStockLimit('$max', '" . DISABLED_RGB . "');"; |
|---|
| 228 | |
|---|
| 229 | return $arrRet; |
|---|
| 230 | } |
|---|
| 231 | |
|---|
| 232 | /* µ¬³ÊÁȤ߹ç¤ï¤»°ìÍ÷¤Î¼èÆÀ(ÊÔ½¸²èÌÌ) */ |
|---|
| 233 | function lfGetClassCatListEdit($product_id) { |
|---|
| 234 | global $objPage; |
|---|
| 235 | // ´û¸ÊÔ½¸¤Î¾ì¹ç |
|---|
| 236 | $objQuery = new SC_Query(); |
|---|
| 237 | |
|---|
| 238 | $col = "class_id1, class_id2, name1, name2, rank1, rank2, "; |
|---|
| 239 | $col.= "product_class_id, product_id, T1_classcategory_id AS classcategory_id1, T2_classcategory_id AS classcategory_id2, "; |
|---|
| 240 | $col.= "product_code, stock, stock_unlimited, sale_limit, price01, price02, status"; |
|---|
| 241 | |
|---|
| 242 | $sql = "SELECT $col FROM "; |
|---|
| 243 | $sql.= "( "; |
|---|
| 244 | $sql.= "SELECT T1.class_id AS class_id1, T2.class_id AS class_id2, T1.classcategory_id AS T1_classcategory_id, T2.classcategory_id AS T2_classcategory_id, T1.name AS name1, T2.name AS name2, T1.rank AS rank1, T2.rank AS rank2 "; |
|---|
| 245 | $sql.= "FROM dtb_classcategory AS T1, dtb_classcategory AS T2 "; |
|---|
| 246 | $sql.= "WHERE T1.class_id IN (SELECT class_id1 FROM vw_cross_products_class AS crs_prd WHERE product_id = ? GROUP BY class_id1, class_id2) AND T2.class_id IN (SELECT class_id2 FROM vw_cross_products_class AS crs_prd WHERE product_id = ? GROUP BY class_id1, class_id2)"; |
|---|
| 247 | $sql.= ") AS T1 "; |
|---|
| 248 | |
|---|
| 249 | $sql.= "LEFT JOIN (SELECT * FROM dtb_products_class WHERE product_id = ?) AS T3 "; |
|---|
| 250 | $sql.= "ON T1_classcategory_id = T3.classcategory_id1 AND T2_classcategory_id = T3.classcategory_id2 "; |
|---|
| 251 | $sql.= "ORDER BY rank1 DESC, rank2 DESC"; |
|---|
| 252 | |
|---|
| 253 | $arrList = $objQuery->getAll($sql, array($product_id, $product_id, $product_id)); |
|---|
| 254 | |
|---|
| 255 | $objPage->arrForm["class_id1"] = $arrList[0]['class_id1']; |
|---|
| 256 | $objPage->arrForm["class_id2"] = $arrList[0]['class_id2']; |
|---|
| 257 | |
|---|
| 258 | $max = count($arrList); |
|---|
| 259 | |
|---|
| 260 | // ¥Ç¥Õ¥©¥ë¥ÈÃͤòÀßÄê |
|---|
| 261 | lfSetDefaultClassCat($objQuery, $product_id, $max); |
|---|
| 262 | |
|---|
| 263 | $no = 1; |
|---|
| 264 | |
|---|
| 265 | for($cnt = 0; $cnt < $max; $cnt++) { |
|---|
| 266 | $objPage->arrForm["classcategory_id1:".$no] = $arrList[$cnt]['classcategory_id1']; |
|---|
| 267 | $objPage->arrForm["classcategory_id2:".$no] = $arrList[$cnt]['classcategory_id2']; |
|---|
| 268 | if($arrList[$cnt]['product_id'] != "") { |
|---|
| 269 | $objPage->arrForm["product_code:".$no] = $arrList[$cnt]['product_code']; |
|---|
| 270 | $objPage->arrForm['stock:'.$no] = $arrList[$cnt]['stock']; |
|---|
| 271 | $objPage->arrForm['stock_unlimited:'.$no] = $arrList[$cnt]['stock_unlimited']; |
|---|
| 272 | $objPage->arrForm['price01:'.$no] = $arrList[$cnt]['price01']; |
|---|
| 273 | $objPage->arrForm['price02:'.$no] = $arrList[$cnt]['price02']; |
|---|
| 274 | // JavaScript½é´ü²½ÍÑʸ»úÎó |
|---|
| 275 | $line.= "'check:".$no."',"; |
|---|
| 276 | } |
|---|
| 277 | $no++; |
|---|
| 278 | } |
|---|
| 279 | |
|---|
| 280 | $line = ereg_replace(",$", "", $line); |
|---|
| 281 | $objPage->tpl_javascript = "list = new Array($line);"; |
|---|
| 282 | $color = DISABLED_RGB; |
|---|
| 283 | $objPage->tpl_onload.= "fnListCheck(list); fnCheckAllStockLimit('$max', '$color');"; |
|---|
| 284 | |
|---|
| 285 | return $arrList; |
|---|
| 286 | } |
|---|
| 287 | |
|---|
| 288 | /* µ¬³Ê¤ÎÅÐÏ¿ */ |
|---|
| 289 | function lfInsertProductClass($arrList, $product_id) { |
|---|
| 290 | $objQuery = new SC_Query(); |
|---|
| 291 | |
|---|
| 292 | $objQuery->begin(); |
|---|
| 293 | |
|---|
| 294 | // ´û¸µ¬³Ê¤Îºï½ü |
|---|
| 295 | $where = "product_id = ?"; |
|---|
| 296 | $objQuery->delete("dtb_products_class", $where, array($product_id)); |
|---|
| 297 | |
|---|
| 298 | $cnt = 1; |
|---|
| 299 | // ¤¹¤Ù¤Æ¤Îµ¬³Ê¤òÅÐÏ¿¤¹¤ë¡£ |
|---|
| 300 | while($arrList["classcategory_id1:".$cnt] != "") { |
|---|
| 301 | if($arrList["check:".$cnt] == 1) { |
|---|
| 302 | $sqlval['product_id'] = $product_id; |
|---|
| 303 | $sqlval['classcategory_id1'] = $arrList["classcategory_id1:".$cnt]; |
|---|
| 304 | $sqlval['classcategory_id2'] = $arrList["classcategory_id2:".$cnt]; |
|---|
| 305 | $sqlval['product_code'] = $arrList["product_code:".$cnt]; |
|---|
| 306 | $sqlval['stock'] = $arrList["stock:".$cnt]; |
|---|
| 307 | $sqlval['stock_unlimited'] = $arrList["stock_unlimited:".$cnt]; |
|---|
| 308 | $sqlval['price01'] = $arrList['price01:'.$cnt]; |
|---|
| 309 | $sqlval['price02'] = $arrList['price02:'.$cnt]; |
|---|
| 310 | $sqlval['creator_id'] = $_SESSION['member_id']; |
|---|
| 311 | $sqlval['create_date'] = "now()"; |
|---|
| 312 | $sqlval['update_date'] = "now()"; |
|---|
| 313 | // INSERT¤Î¼Â¹Ô |
|---|
| 314 | $objQuery->insert("dtb_products_class", $sqlval); |
|---|
| 315 | } |
|---|
| 316 | $cnt++; |
|---|
| 317 | } |
|---|
| 318 | |
|---|
| 319 | $objQuery->commit(); |
|---|
| 320 | } |
|---|
| 321 | |
|---|
| 322 | // µ¬³ÊÁªÂò¥¨¥é¡¼¥Á¥§¥Ã¥¯ |
|---|
| 323 | function lfClassError() { |
|---|
| 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")); |
|---|
| 328 | return $objErr->arrErr; |
|---|
| 329 | } |
|---|
| 330 | |
|---|
| 331 | /* ¼èÆÀʸ»úÎó¤ÎÊÑ´¹ */ |
|---|
| 332 | function lfConvertParam($array) { |
|---|
| 333 | /* |
|---|
| 334 | * ʸ»úÎó¤ÎÊÑ´¹ |
|---|
| 335 | * K : ¡ÖȾ³Ñ(Êݶ¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹ |
|---|
| 336 | * C : ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹ |
|---|
| 337 | * V : ÂùÅÀÉÕ¤¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹ |
|---|
| 338 | * n : ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(Êݶ¸)¡×¤ËÊÑ´¹ |
|---|
| 339 | */ |
|---|
| 340 | |
|---|
| 341 | $no = 1; |
|---|
| 342 | while($array["classcategory_id1:".$no] != "") { |
|---|
| 343 | $arrConvList["product_code:".$no] = "KVa"; |
|---|
| 344 | $arrConvList["price01:".$no] = "n"; |
|---|
| 345 | $arrConvList["price02:".$no] = "n"; |
|---|
| 346 | $arrConvList["stock:".$no] = "n"; |
|---|
| 347 | $no++; |
|---|
| 348 | } |
|---|
| 349 | |
|---|
| 350 | // ʸ»úÊÑ´¹ |
|---|
| 351 | foreach ($arrConvList as $key => $val) { |
|---|
| 352 | // POST¤µ¤ì¤Æ¤¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£ |
|---|
| 353 | if(isset($array[$key])) { |
|---|
| 354 | $array[$key] = mb_convert_kana($array[$key] ,$val); |
|---|
| 355 | } |
|---|
| 356 | } |
|---|
| 357 | return $array; |
|---|
| 358 | } |
|---|
| 359 | |
|---|
| 360 | // ¾¦Éʵ¬³Ê¥¨¥é¡¼¥Á¥§¥Ã¥¯ |
|---|
| 361 | function lfProductClassError($array) { |
|---|
| 362 | $objErr = new SC_CheckError($array); |
|---|
| 363 | $no = 1; |
|---|
| 364 | |
|---|
| 365 | while($array["classcategory_id1:".$no] != "") { |
|---|
| 366 | if($array["check:".$no] == 1) { |
|---|
| 367 | $objErr->doFunc(array("¾¦ÉÊ¥³¡¼¥É", "product_code:".$no, STEXT_LEN), array("MAX_LENGTH_CHECK")); |
|---|
| 368 | $objErr->doFunc(array(NORMAL_PRICE_TITLE, "price01:".$no, PRICE_LEN), array("ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); |
|---|
| 369 | $objErr->doFunc(array(SALE_PRICE_TITLE, "price02:".$no, PRICE_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); |
|---|
| 370 | |
|---|
| 371 | if($array["stock_unlimited:".$no] != '1') { |
|---|
| 372 | $objErr->doFunc(array("ºß¸Ë¿ô", "stock:".$no, AMOUNT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); |
|---|
| 373 | } |
|---|
| 374 | } |
|---|
| 375 | if(count($objErr->arrErr) > 0) { |
|---|
| 376 | $objErr->arrErr["error:".$no] = $objErr->arrErr["product_code:".$no]; |
|---|
| 377 | $objErr->arrErr["error:".$no].= $objErr->arrErr["price01:".$no]; |
|---|
| 378 | $objErr->arrErr["error:".$no].= $objErr->arrErr["price02:".$no]; |
|---|
| 379 | $objErr->arrErr["error:".$no].= $objErr->arrErr["stock:".$no]; |
|---|
| 380 | } |
|---|
| 381 | $no++; |
|---|
| 382 | } |
|---|
| 383 | return $objErr->arrErr; |
|---|
| 384 | } |
|---|
| 385 | |
|---|
| 386 | /* ³Îǧ¥Ú¡¼¥¸É½¼¨ÍÑ */ |
|---|
| 387 | function lfProductConfirmPage() { |
|---|
| 388 | global $objPage; |
|---|
| 389 | $objPage->arrForm['mode'] = 'complete'; |
|---|
| 390 | $objPage->arrClass = sfGetIDValueList("dtb_class", 'class_id', 'name'); |
|---|
| 391 | $cnt = 0; |
|---|
| 392 | $check = 0; |
|---|
| 393 | $no = 1; |
|---|
| 394 | while($_POST["classcategory_id1:".$no] != "") { |
|---|
| 395 | if($_POST["check:".$no] != "") { |
|---|
| 396 | $check++; |
|---|
| 397 | } |
|---|
| 398 | $no++; |
|---|
| 399 | $cnt++; |
|---|
| 400 | } |
|---|
| 401 | $objPage->tpl_check = $check; |
|---|
| 402 | $objPage->tpl_count = $cnt; |
|---|
| 403 | } |
|---|
| 404 | ?> |
|---|