From 8187debad1d2d315b7e8cb3703257679c5ac3582 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 12 Jun 2013 18:44:47 +0900 Subject: [PATCH] =?UTF-8?q?#209=20=EC=BF=A0=ED=8F=B0=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EC=9D=B8=EC=A7=80=EC=88=98=EB=8B=A8=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/shop/orderform.php | 70 ++++++++++++++++++++++-------------- shop/ordercoupon.php | 3 -- shop/orderform.php | 64 ++++++++++++++++++++------------- shop/orderitemcoupon.php | 3 -- shop/ordersendcostcoupon.php | 3 -- 5 files changed, 83 insertions(+), 60 deletions(-) diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index fcaed20cc..0ab87258f 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -195,31 +195,35 @@ ob_start(); - 0) - { - ?> +
+ 주문 + +
+ +
+ 쿠폰 + 0 원 +
배송비
- - 0) { ?>
총계 - +
- +
+ + +
" }, + { it_id: it_id, sw_direct: "" }, function(data) { $cp_btn_el.after(data); } @@ -718,7 +722,7 @@ $(function() { }); $(".cp_apply").live("click", function() { - var $el = $(this).closest("li"); + var $el = $(this).closest("tr"); var cp_id = $el.find("input[name='f_cp_id[]']").val(); var amount = $el.find("input[name='f_cp_amt[]']").val(); var subj = $el.find("input[name='f_cp_subj[]']").val(); @@ -764,7 +768,9 @@ $(function() { calculate_total_amount(); $("#it_coupon_frm").remove(); - $cp_btn_el.focus(); + $cp_btn_el.text("변경").focus(); + if(!$cp_row_el.find(".it_coupon_cancel").size()) + $cp_btn_el.after(""); }); $("#it_coupon_close").live("click", function() { @@ -772,11 +778,12 @@ $(function() { $cp_btn_el.focus(); }); - $("#it_coupon_cancel").live("click", function() { - coupon_cancel($cp_row_el); + $(".it_coupon_cancel").live("click", function() { + coupon_cancel($(this).closest("tr")); calculate_total_amount(); $("#it_coupon_frm").remove(); - $cp_btn_el.focus(); + $(this).closest("tr").find(".it_coupon_btn").text("적용").focus(); + $(this).remove(); }); $("#od_coupon_btn").click(function() { @@ -793,7 +800,7 @@ $(function() { }); $(".od_cp_apply").live("click", function() { - var $el = $(this).closest("li"); + var $el = $(this).closest("tr"); var cp_id = $el.find("input[name='o_cp_id[]']").val(); var amount = parseInt($el.find("input[name='o_cp_amt[]']").val()); var subj = $el.find("input[name='o_cp_subj[]']").val(); @@ -813,7 +820,9 @@ $(function() { $("input[name=od_cp_id]").val(cp_id); calculate_order_amount(); $("#od_coupon_frm").remove(); - $("#od_coupon_btn").focus(); + $("#od_coupon_btn").text("쿠폰변경").focus(); + if(!$("#od_coupon_cancel").size()) + $("#od_coupon_btn").after(""); }); $("#od_coupon_close").live("click", function() { @@ -826,7 +835,8 @@ $(function() { $("input[name=od_amount]").val(org_amount); calculate_order_amount(); $("#od_coupon_frm").remove(); - $("#od_coupon_btn").focus(); + $("#od_coupon_btn").text("쿠폰적용").focus(); + $(this).remove(); }); $("#sc_coupon_btn").click(function() { @@ -844,7 +854,7 @@ $(function() { }); $(".sc_cp_apply").live("click", function() { - var $el = $(this).closest("li"); + var $el = $(this).closest("tr"); var cp_id = $el.find("input[name='s_cp_id[]']").val(); var amount = parseInt($el.find("input[name='s_cp_amt[]']").val()); var subj = $el.find("input[name='s_cp_subj[]']").val(); @@ -860,7 +870,9 @@ $(function() { $("input[name=sc_cp_id]").val(cp_id); calculate_order_amount(); $("#sc_coupon_frm").remove(); - $("#sc_coupon_btn").focus(); + $("#sc_coupon_btn").text("쿠폰변경").focus(); + if(!$("#sc_coupon_cancel").size()) + $("#sc_coupon_btn").after(""); }); $("#sc_coupon_close").live("click", function() { @@ -873,7 +885,8 @@ $(function() { $("input[name=od_send_cost]").val(send_cost); calculate_order_amount(); $("#sc_coupon_frm").remove(); - $("#sc_coupon_btn").focus(); + $("#sc_coupon_btn").text("쿠폰적용").focus(); + $(this).remove(); }); $("#od_settle_bank").bind("click", function() { @@ -905,20 +918,23 @@ function calculate_total_amount() { var $it_amt = $("input[name^=it_amount]"); var $cp_amt = $("input[name^=cp_amount]"); - var tot_sell_amount = sell_amount = 0; + var tot_sell_amount = sell_amount = tot_cp_amount = 0; var it_amount, cp_amount; var send_cost = parseInt($("input[name=org_send_cost]").val()); $it_amt.each(function(index) { it_amount = parseInt($(this).val()); cp_amount = parseInt($cp_amt.eq(index).val()); - sell_amount += (it_amount - cp_amount); + sell_amount += it_amount; + tot_cp_amount += cp_amount; }); - tot_sell_amount = sell_amount + send_cost; + tot_sell_amount = sell_amount - tot_cp_amount + send_cost; - $("#ct_tot_amount").text(number_format(String(tot_sell_amount))); - $("form[name=sm_form] input[name=good_mny]").val(tot_sell_amount); + $("#ct_tot_coupon").text(number_format(String(tot_cp_amount))+" 원"); + $("#ct_tot_amount").text(number_format(String(tot_sell_amount))+" 원"); + + $("input[name=good_mny]").val(tot_sell_amount); $("input[name=od_amount]").val(sell_amount); $("input[name=org_od_amount]").val(sell_amount); $("input[name=od_send_cost]").val(send_cost); diff --git a/shop/ordercoupon.php b/shop/ordercoupon.php index f1f73d1ee..25a8aa5c1 100644 --- a/shop/ordercoupon.php +++ b/shop/ordercoupon.php @@ -65,8 +65,5 @@ $count = mysql_num_rows($result); ?>
- 0) { ?> - -
\ No newline at end of file diff --git a/shop/orderform.php b/shop/orderform.php index 2a45a1c6f..40b9c8f85 100644 --- a/shop/orderform.php +++ b/shop/orderform.php @@ -270,31 +270,35 @@ setTimeout("init_pay_button();",300); - 0) - { - ?> +
+ 주문 + +
+ +
+ 쿠폰 + 0 원 +
배송비
- - 0) { ?>
총계 - +
- +
+ + +
@@ -969,7 +973,9 @@ $(function() { calculate_total_amount(); $("#it_coupon_frm").remove(); - $cp_btn_el.focus(); + $cp_btn_el.text("변경").focus(); + if(!$cp_row_el.find(".it_coupon_cancel").size()) + $cp_btn_el.after(""); }); $("#it_coupon_close").live("click", function() { @@ -977,11 +983,12 @@ $(function() { $cp_btn_el.focus(); }); - $("#it_coupon_cancel").live("click", function() { - coupon_cancel($cp_row_el); + $(".it_coupon_cancel").live("click", function() { + coupon_cancel($(this).closest("tr")); calculate_total_amount(); $("#it_coupon_frm").remove(); - $cp_btn_el.focus(); + $(this).closest("tr").find(".it_coupon_btn").text("적용").focus(); + $(this).remove(); }); $("#od_coupon_btn").click(function() { @@ -998,7 +1005,7 @@ $(function() { }); $(".od_cp_apply").live("click", function() { - var $el = $(this).closest("li"); + var $el = $(this).closest("tr"); var cp_id = $el.find("input[name='o_cp_id[]']").val(); var amount = parseInt($el.find("input[name='o_cp_amt[]']").val()); var subj = $el.find("input[name='o_cp_subj[]']").val(); @@ -1018,7 +1025,9 @@ $(function() { $("input[name=od_cp_id]").val(cp_id); calculate_order_amount(); $("#od_coupon_frm").remove(); - $("#od_coupon_btn").focus(); + $("#od_coupon_btn").text("쿠폰변경").focus(); + if(!$("#od_coupon_cancel").size()) + $("#od_coupon_btn").after(""); }); $("#od_coupon_close").live("click", function() { @@ -1031,7 +1040,8 @@ $(function() { $("input[name=od_amount]").val(org_amount); calculate_order_amount(); $("#od_coupon_frm").remove(); - $("#od_coupon_btn").focus(); + $("#od_coupon_btn").text("쿠폰적용").focus(); + $(this).remove(); }); $("#sc_coupon_btn").click(function() { @@ -1049,7 +1059,7 @@ $(function() { }); $(".sc_cp_apply").live("click", function() { - var $el = $(this).closest("li"); + var $el = $(this).closest("tr"); var cp_id = $el.find("input[name='s_cp_id[]']").val(); var amount = parseInt($el.find("input[name='s_cp_amt[]']").val()); var subj = $el.find("input[name='s_cp_subj[]']").val(); @@ -1065,7 +1075,9 @@ $(function() { $("input[name=sc_cp_id]").val(cp_id); calculate_order_amount(); $("#sc_coupon_frm").remove(); - $("#sc_coupon_btn").focus(); + $("#sc_coupon_btn").text("쿠폰변경").focus(); + if(!$("#sc_coupon_cancel").size()) + $("#sc_coupon_btn").after(""); }); $("#sc_coupon_close").live("click", function() { @@ -1078,7 +1090,8 @@ $(function() { $("input[name=od_send_cost]").val(send_cost); calculate_order_amount(); $("#sc_coupon_frm").remove(); - $("#sc_coupon_btn").focus(); + $("#sc_coupon_btn").text("쿠폰적용").focus(); + $(this).remove(); }); $("#od_settle_bank").bind("click", function() { @@ -1106,19 +1119,22 @@ function calculate_total_amount() { var $it_amt = $("input[name^=it_amount]"); var $cp_amt = $("input[name^=cp_amount]"); - var tot_sell_amount = sell_amount = 0; + var tot_sell_amount = sell_amount = tot_cp_amount = 0; var it_amount, cp_amount; var send_cost = parseInt($("input[name=org_send_cost]").val()); $it_amt.each(function(index) { it_amount = parseInt($(this).val()); cp_amount = parseInt($cp_amt.eq(index).val()); - sell_amount += (it_amount - cp_amount); + sell_amount += it_amount; + tot_cp_amount += cp_amount; }); - tot_sell_amount = sell_amount + send_cost; + tot_sell_amount = sell_amount - tot_cp_amount + send_cost; + + $("#ct_tot_coupon").text(number_format(String(tot_cp_amount))+" 원"); + $("#ct_tot_amount").text(number_format(String(tot_sell_amount))+" 원"); - $("#ct_tot_amount").text(number_format(String(tot_sell_amount))); $("input[name=good_mny]").val(tot_sell_amount); $("input[name=od_amount]").val(sell_amount); $("input[name=org_od_amount]").val(sell_amount); diff --git a/shop/orderitemcoupon.php b/shop/orderitemcoupon.php index 73d0eed46..f64ac4087 100644 --- a/shop/orderitemcoupon.php +++ b/shop/orderitemcoupon.php @@ -86,8 +86,5 @@ $count = mysql_num_rows($result); ?>
- 0) { ?> - -
\ No newline at end of file diff --git a/shop/ordersendcostcoupon.php b/shop/ordersendcostcoupon.php index f80b4db2a..98fdba271 100644 --- a/shop/ordersendcostcoupon.php +++ b/shop/ordersendcostcoupon.php @@ -69,8 +69,5 @@ $count = mysql_num_rows($result); ?>
- 0) { ?> - -
\ No newline at end of file