function on_web(price1,price2,max_num) { var order_form = document.SendPayForm_id; var check_loc = true; if(order_form.buyername.value==""){ alert("예약자명을 입력해 주십시요."); order_form.buyername.focus(); return false; } else if(order_form.birthdate.value=="") { alert("생년월일 또는 사업자등록번호를 입력해 주십시요."); order_form.buyertel.focus(); return false; }else if(order_form.postcode.value=="") { alert("우편번호를 입력해주십시오."); order_form.postcode.focus(); return false; }else if(order_form.address.value=="") { alert("주소를 입력해주십시오."); order_form.address.focus(); return false; }else if(order_form.buyertel.value.length < 10) { alert("연락처를 정확히 입력해 주십시요."); order_form.buyertel.focus(); return false; } else if(order_form.buyerpurpose.value==""){ alert("사용목적을 입력해주십시오."); order_form.buyerpurpose.focus(); return false; }else if(order_form.stay_num.value==""){ alert("사용인원을 입력해주십시오."); order_form.stay_num.focus(); return false; } else if(order_form.agree1.checked == false) { alert("개인정보 수집 및 이용안내에 동의 후 예약이 가능합니다."); order_form.agree1.focus(); return false; } else if(order_form.agree2.checked == false) { alert("개인정보 제3자 제공에 동의 후 예약이 가능합니다."); order_form.agree2.focus(); return false; } else { all_calculate(price1,price2,max_num); order_form.submit(); } } function hangul() { if((event.keyCode < 12592) || (event.keyCode > 12687)){ alert("한글만 입력이 가능합니다."); event.returnValue = false } } function price_change(nth,price1,price2,max_num){ var cnt = 0; var num = 0; var price = 0; var total_price = 0; var tt_total_price = 0; if($("#tool"+nth+"_cnt").val() && $("#tool"+nth+"_num").val() ){ cnt = $("#tool"+nth+"_cnt").val(); num = $("#tool"+nth+"_num").val(); price = $("#tool"+nth+"_price").val(); total_price = price * cnt * num; }else{ cnt = 0; num = 0; total_price = 0; } $("#tool"+nth+"_total_input").val(total_price); $("#tool"+nth+"_total_price").text(number_format(total_price)); $("input[id*='_total_input']").each(function(){ tt_total_price += parseInt($(this).val()); }); $("#total_price").text(number_format(tt_total_price)); $("#total_tools_price").val(tt_total_price); all_calculate(price1,price2,max_num); } function price_change2(nth,price1,price2,max_num){ var num = 0; var price = 0; var total_price = 0; var tt_total_price = 0; if($("#tool"+nth+"_num").val()){ num = $("#tool"+nth+"_num").val(); price = $("#tool"+nth+"_price").val(); total_price = price * num; }else{ num = 0; total_price = 0; } $("#tool"+nth+"_total_input").val(total_price); $("#tool"+nth+"_total_price").text(number_format(total_price)); $("input[id*='_total_input']").each(function(){ tt_total_price += parseInt($(this).val()); }); $("#total_price").text(number_format(tt_total_price)); $("#total_tools_price").val(tt_total_price); all_calculate(price1,price2,max_num); } function all_calculate(price1,price2,max_num){ var first_price = first_calculate(price1,price2,max_num); var second_price = second_calculate(); var all_price = parseInt(first_price) + parseInt(second_price); var total_price = all_price*11/10; var vat_price = all_price* 0.1; $("#total_price_tag").html(""+number_format(total_price)+"원"+" (기본 이용료: "+number_format(first_price)+"원 + 시설 이용료: "+number_format(second_price)+"원 + 부가세(VAT): "+number_format(all_price*0.1)+"원) "); $("#frm_total_price").val(total_price); $("#frm_first_price").val(first_price); $("#frm_second_price").val(second_price); $("#frm_vat_price").val(vat_price); } function all_calculate_return(price1,price2,max_num){ var first_price = first_calculate(price1,price2,max_num); var second_price = second_calculate(); var all_price = parseInt(first_price) + parseInt(second_price); var total_price = all_price*11/10; return total_price; } function first_calculate(price1,price2,max_num){ if($("input[name='special_event']:checked").val()=="n"){ return max_num*price1; }else{ return max_num*price2; } } function second_calculate(){ var tt_total_price =0; $("input[id*='_total_input']").each(function(){ tt_total_price += parseInt($(this).val()); }); return tt_total_price; } function number_format( number ) { var nArr = String(number).split('').join(',').split(''); for( var i=nArr.length-1, j=1; i>=0; i--, j++) if( j%6 != 0 && j%2 == 0) nArr[i] = ''; return nArr.join(''); }