From b98f7b8bdebc7dadf7a9e6a2db111720e00e39bf Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 9 Aug 2013 10:26:35 +0900 Subject: [PATCH] =?UTF-8?q?#278=20cartupdate=EC=97=90=EC=84=9C=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EC=9D=98=20name=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/shop.js | 56 ++++++++++++++++++++++---------------------- lib/shop.lib.php | 6 ++--- mobile/shop/item.php | 8 +++---- shop/cartoption.php | 6 ++--- shop/item.php | 8 +++---- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/js/shop.js b/js/shop.js index ba7def26c..edfef0d60 100644 --- a/js/shop.js +++ b/js/shop.js @@ -5,9 +5,9 @@ var isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1); $(function() { // 선택옵션 /* 가상서커 ctrl keyup 이베트 대응 */ - $("select[name='it_option[]']").live("keyup", function(e) { - var sel_count = $("select[name='it_option[]']").size(); - var idx = $("select[name='it_option[]']").index($(this)); + $("select.it_option").live("keyup", function(e) { + var sel_count = $("select.it_option").size(); + var idx = $("select.it_option").index($(this)); var code = e.keyCode; var val = $(this).val(); @@ -21,9 +21,9 @@ $(function() { }); /* 키보드 접근 후 옵션 선택 Enter keydown 이벤트 대응 */ - $("select[name='it_option[]']").live("keydown", function(e) { - var sel_count = $("select[name='it_option[]']").size(); - var idx = $("select[name='it_option[]']").index($(this)); + $("select.it_option").live("keydown", function(e) { + var sel_count = $("select.it_option").size(); + var idx = $("select.it_option").index($(this)); var code = e.keyCode; var val = $(this).val(); @@ -37,24 +37,24 @@ $(function() { }); if(isAndroid) { - $("select[name='it_option[]']").live("touchend", function() { + $("select.it_option").live("touchend", function() { option_add = true; }); } else { - $("select[name='it_option[]']").live("mousedown", function() { + $("select.it_option").live("mousedown", function() { option_add = true; }); } - $("select[name='it_option[]']").live("change", function() { - var sel_count = $("select[name='it_option[]']").size(); - var idx = $("select[name='it_option[]']").index($(this)); + $("select.it_option").live("change", function() { + var sel_count = $("select.it_option").size(); + var idx = $("select.it_option").index($(this)); var val = $(this).val(); var it_id = $("input[name='it_id[]']").val(); // 선택값이 없을 경우 하위 옵션은 disabled if(val == "") { - $("select[name='it_option[]']:gt("+idx+")").val("").attr("disabled", true); + $("select.it_option:gt("+idx+")").val("").attr("disabled", true); return; } @@ -64,7 +64,7 @@ $(function() { // 상위 옵션의 값을 읽어 옵션id 만듬 if(idx > 0) { - $("select[name='it_option[]']:lt("+idx+")").each(function() { + $("select.it_option:lt("+idx+")").each(function() { if(!opt_id) opt_id = $(this).val(); else @@ -80,12 +80,12 @@ $(function() { "./itemoption.php", { it_id: it_id, opt_id: opt_id, idx: idx, sel_count: sel_count }, function(data) { - $("select[name='it_option[]']").eq(idx+1).empty().html(data).attr("disabled", false); + $("select.it_option").eq(idx+1).empty().html(data).attr("disabled", false); // select의 옵션이 변경됐을 경우 하위 옵션 disabled if(idx+1 < sel_count) { var idx2 = idx + 1; - $("select[name='it_option[]']:gt("+idx2+")").val("").attr("disabled", true); + $("select.it_option:gt("+idx2+")").val("").attr("disabled", true); } } ); @@ -107,7 +107,7 @@ $(function() { // 추가옵션 /* 가상서커 ctrl keyup 이베트 대응 */ - $("select[name='it_supply[]']").live("keyup", function(e) { + $("select.it_supply").live("keyup", function(e) { var $el = $(this); var code = e.keyCode; var val = $(this).val(); @@ -122,7 +122,7 @@ $(function() { }); /* 키보드 접근 후 옵션 선택 Enter keydown 이벤트 대응 */ - $("select[name='it_supply[]']").live("keydown", function(e) { + $("select.it_supply").live("keydown", function(e) { var $el = $(this); var code = e.keyCode; var val = $(this).val(); @@ -137,16 +137,16 @@ $(function() { }); if(isAndroid) { - $("select[name='it_supply[]']").live("touchend", function() { + $("select.it_supply").live("touchend", function() { supply_add = true; }); } else { - $("select[name='it_supply[]']").live("mousedown", function() { + $("select.it_supply").live("mousedown", function() { supply_add = true; }); } - $("select[name='it_supply[]']").live("change", function() { + $("select.it_supply").live("change", function() { var $el = $(this); var val = $(this).val(); @@ -162,7 +162,7 @@ $(function() { var mode = $(this).text(); var this_qty, max_qty = 9999, min_qty = 1; var $el_qty = $(this).closest("li").find("input[name^=ct_qty]"); - var stock = parseInt($(this).closest("li").find("input[name='io_stock[]']").val()); + var stock = parseInt($(this).closest("li").find("input.io_stock").val()); switch(mode) { case "증가": @@ -234,7 +234,7 @@ $(function() { alert("수량은 1에서 9999 사이의 값으로 입력해 주십시오."); $(this).val(1); } else { - var stock = parseInt($(this).closest("li").find("input[name='io_stock[]']").val()); + var stock = parseInt($(this).closest("li").find("input.io_stock").val()); if(d_val > stock) { alert("재고수량 보다 많은 수량을 구매할 수 없습니다."); $(this).val(stock); @@ -253,9 +253,9 @@ function sel_option_process(add_exec) var id = ""; var value, info, sel_opt, item, price, stock, run_error = false; var option = sep = ""; - info = $("select[name='it_option[]']:last").val().split(","); + info = $("select.it_option:last").val().split(","); - $("select[name='it_option[]']").each(function(index) { + $("select.it_option").each(function(index) { value = $(this).val(); item = $(this).closest("tr").find("th label").text(); @@ -344,8 +344,8 @@ function add_sel_option(type, id, option, price, stock) opt += "\n"; opt += "\n"; opt += "\n"; - opt += "\n"; - opt += "\n"; + opt += "\n"; + opt += "\n"; opt += ""+option+"\n"; opt += ""+opt_prc+"\n"; opt += "
\n"; @@ -404,8 +404,8 @@ function same_option_check(val) // 가격계산 function price_calculate() { - var it_price = parseInt($("input[name=it_price]").val()); - var $el_prc = $("input[name^=io_price]"); + var it_price = parseInt($("input#it_price").val()); + var $el_prc = $("input.io_price"); var $el_qty = $("input[name^=ct_qty]"); var $el_type = $("input[name^=io_type]"); var price, type, qty, total = 0; diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 793df8936..e98fb949e 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -948,7 +948,7 @@ function get_item_options($it_id, $subject) $str .= ''.PHP_EOL; $str .= ''.PHP_EOL; - $select = ''.PHP_EOL; $select .= ''.PHP_EOL; for($k=0; $k<$opt_count; $k++) { $opt_val = $opt[$k]; @@ -966,7 +966,7 @@ function get_item_options($it_id, $subject) $str .= ''.PHP_EOL; $str .= ''.PHP_EOL; - $select = ''.PHP_EOL; $select .= ''.PHP_EOL; for($i=0; $row=sql_fetch_array($result); $i++) { if($row['io_price'] >= 0) @@ -1036,7 +1036,7 @@ function get_item_supply($it_id, $subject) $str .= ''.PHP_EOL; $str .= ''.PHP_EOL; - $select = ''.PHP_EOL; $select .= ''.PHP_EOL; for($k=0; $k<$opt_count; $k++) { $opt_val = $opt[$k]; diff --git a/mobile/shop/item.php b/mobile/shop/item.php index 1a39e8197..622a2f36e 100644 --- a/mobile/shop/item.php +++ b/mobile/shop/item.php @@ -308,7 +308,7 @@ else 판매가격 원 - + @@ -405,8 +405,8 @@ else - - + + (+0원)
@@ -632,7 +632,7 @@ else function fitemcheck(f, act) { // 판매가격이 0 보다 작다면 - if (f.it_price.value < 0) + if (document.getElementById("it_price").value < 0) { alert("전화로 문의해 주시면 감사하겠습니다."); return; diff --git a/shop/cartoption.php b/shop/cartoption.php index 8a7529f55..6c2f05358 100644 --- a/shop/cartoption.php +++ b/shop/cartoption.php @@ -27,7 +27,7 @@ if(!mysql_num_rows($result))
- + ][]" value=""> - - + +
diff --git a/shop/item.php b/shop/item.php index 1d4a9de4e..70a2d49f7 100644 --- a/shop/item.php +++ b/shop/item.php @@ -298,7 +298,7 @@ else 판매가격 원 - + @@ -401,8 +401,8 @@ else - - + + (+0원)
@@ -652,7 +652,7 @@ else function fitemcheck(f, act) { // 판매가격이 0 보다 작다면 - if (f.it_price.value < 0) + if (document.getElementById("it_price").value < 0) { alert("전화로 문의해 주시면 감사하겠습니다."); return;